ERC-7857 · Final · ERC · 2025-01-02
ERC-7857: AI Agents NFT with Private Metadata
An NFT standard for AI agents whose valuable metadata (model, memory, persona) stays encrypted off-chain, with TEE or ZK proofs verifying that it was correctly re-encrypted for each new owner.
What problem does it solve?
An NFT can prove who owns something, but its metadata is normally public and static. For an AI agent, the metadata is the asset: model weights, memory and character definitions. Publishing it would give it away, and simply moving an ERC-721 token does not move the ability to decrypt private data.
ERC-7857 defines how to transfer an agent NFT so that:
- the encrypted data really is handed over and the transfer is verifiable on-chain,
- only the new owner can decrypt it, and
- an execution environment can check ownership before loading the agent.
How it works
Only hashes and sealed keys go on-chain. The actual data is stored encrypted off-chain.
Verifier. An on-chain IERC7857DataVerifier checks proofs produced by an off-chain prover. The proof system can be a Trusted Execution Environment (TEE) or zero-knowledge proofs (ZKP). verifyTransferValidity checks that the prover knew the original data, decrypted it with the old key and re-encrypted it with a new key, encrypted that new key to the receiver's public key, that the new ciphertext hashes match, and that the receiver (or their delegated access assistant) signed to confirm the data is available in storage.
Metadata. intelligentDataOf(tokenId) returns a list of { dataDescription, dataHash }.
NFT operations.
iTransfer(to, tokenId, proofs): transfer ownership together with re-encrypted data.iClone(to, tokenId, proofs): give a copy of the data to a new token without giving up the original.authorizeUsage(tokenId, user)/revokeAuthorization: let someone use the agent without seeing its data. This relies on a "Sealed Executor" (a trusted party, TEE or FHE) that runs requests on the user's behalf; it is out of scope for the standard.- Familiar
approve,setApprovalForAll,ownerOf, plusdelegateAccess(assistant)for signing data-availability confirmations.
Events include Transferred, Cloned, Authorization, and PublishedSealedKey, which carries the new sealed keys for the receiver.
Sample code
Transferring an agent once the prover has produced proofs (ethers v6; ABI abbreviated):
import { Contract } from "ethers";
const agentNft = new Contract(nftAddr, [
"function iTransfer(address to, uint256 tokenId, tuple(tuple(bytes32 oldDataHash, bytes32 newDataHash, bytes nonce, bytes encryptedPubKey, bytes proof) accessProof, tuple(uint8 oracleType, bytes32 oldDataHash, bytes32 newDataHash, bytes sealedKey, bytes encryptedPubKey, bytes nonce, bytes proof) ownershipProof)[] proofs)",
"function intelligentDataOf(uint256 tokenId) view returns (tuple(string dataDescription, bytes32 dataHash)[])",
"event PublishedSealedKey(address indexed to, uint256 indexed tokenId, bytes[] sealedKeys)",
], signer);
// proofs: one TransferValidityProof per data item, generated off-chain by the TEE/ZK prover
const tx = await agentNft.iTransfer(buyer, tokenId, proofs);
await tx.wait();
const data = await agentNft.intelligentDataOf(tokenId); // new data hashes
The buyer then reads the sealed key from PublishedSealedKey and decrypts it with their private key.
Things to know
- Status is Final.
- It does not inherit ERC-721; implementations may add ERC-721 for marketplace compatibility.
- TEE and ZKP differ: with ZKP the prover (the sender) knows the re-encryption key, so the new owner should re-encrypt on the next update or the previous owner can still read it.
- Security rests heavily on the off-chain prover, storage and Sealed Executor, none of which the standard defines. Verify replay protection and proof checks carefully.
- Usage authorization does not reveal the data to the user; it only works if a trustworthy executor enforces it.