{"eip":7007,"title":"Verifiable AI-Generated Content Token","description":"An ERC-721 extension for verifiable AI-generated content tokens using Zero-Knowledge and Optimistic Machine Learning techniques","authors":["Cathie So (@socathie)","Xiaohang Yu (@xhyumiracle)","Conway (@0x1cc)","Lee Ting Ting (@tina1998612)","Kartin \u003ckartin@hyperoracle.io\u003e"],"status":"Final","type":"Standards Track","category":"ERC","created":"2023-05-10","requires":[165,721],"discussionsTo":"https://ethereum-magicians.org/t/eip-7007-zkml-aigc-nfts-an-erc-721-extension-interface-for-zkml-based-aigc-nfts/14216","repo":"ERCs","label":"ERC-7007","officialUrl":"https://eips.ethereum.org/EIPS/eip-7007","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7007.md","url":"https://eips.huatuo.xyz/eip-7007/","tldr":{"en":"An ERC-721 extension for AI-generated content NFTs where the token ID is tied to the prompt and the output can be verified on-chain with zkML (validity proofs) or opML (fraud proofs).","ja":"AI 生成コンテンツ NFT 向けの ERC-721 拡張。トークン ID がプロンプトに紐づき、出力を zkML（有効性証明）または opML（不正証明）でオンチェーン検証できる。","ko":"AI 생성 콘텐츠 NFT를 위한 ERC-721 확장. 토큰 ID가 프롬프트에 묶여 있고, 출력은 zkML(유효성 증명) 또는 opML(사기 증명)로 온체인에서 검증할 수 있다.","zh":"一个面向 AI 生成内容 NFT 的 ERC-721 扩展：代币 ID 与提示词绑定，输出可以通过 zkML（有效性证明）或 opML（欺诈证明）在链上验证。"},"tags":["nft","ai","zkml","opml","erc721"],"explainers":{"en":{"lang":"en","tldr":"An ERC-721 extension for AI-generated content NFTs where the token ID is tied to the prompt and the output can be verified on-chain with zkML (validity proofs) or opML (fraud proofs).","tags":["nft","ai","zkml","opml","erc721"],"related":[721,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7007/","markdown":"## What problem does it solve?\n\nAnyone can mint an image and claim \"this was generated by model X from prompt Y\". Nothing in a regular NFT proves it. That makes it hard for model authors to share models while capturing value from their outputs, and hard for buyers to trust provenance.\n\nERC-7007 standardizes NFTs whose content is **verifiably** the output of a specific ML model for a specific prompt, using either:\n\n- **zkML**: a zero-knowledge proof that the inference was computed correctly (validity proof), or\n- **opML**: an optimistic result that anyone can challenge during a challenge period (fraud proof).\n\n## How it works\n\nEvery compliant contract implements ERC-721, ERC-165 and `IERC7007` (interface ID `0x702c55a6`):\n\n| Function / event | Purpose |\n| --- | --- |\n| `addAigcData(tokenId, prompt, aigcData, proof)` | Bind a prompt and its generated output to a token |\n| `verify(prompt, aigcData, proof)` | Return `true` only if the output is finalized and correct |\n| `AigcData(tokenId, prompt, aigcData, proof)` event | Records what was added |\n\nHow `verify` behaves depends on the proof type:\n\n- **zkML:** checks the ZK proof against a verifier contract. `addAigcData` should only succeed if `verify` returns `true`.\n- **opML:** `proof` may be empty; `verify` returns `true` only after the challenge period has ended and the data is up to date. `addAigcData` may be called before finalization.\n\nThe `tokenId` is defined as the hash of the prompt, so the same prompt cannot be minted twice in a collection.\n\nOptional extensions:\n\n- **Enumerable** (`0xfa1a557a`): `tokenId(prompt)` and `prompt(tokenId)`.\n- **Updatable** (`0x3f37dce2`): `update(prompt, aigcData)` plus an `Update` event, for opML results that change after a successful challenge.\n\nThe metadata JSON adds `prompt`, `aigc_type` (image, video, audio…), `aigc_data` (URI of the content) and `proof_type` (`validity` or `fraud`). The spec recommends publishing a commitment to the model on-chain beforehand and checking it inside `verify`.\n\n## Sample code\n\nReading and verifying an AIGC-NFT (ethers v6):\n\n```ts\nimport { Contract, JsonRpcProvider, keccak256, toUtf8Bytes } from \"ethers\";\n\nconst abi = [\n  \"function supportsInterface(bytes4) view returns (bool)\",\n  \"function verify(bytes prompt, bytes aigcData, bytes proof) view returns (bool)\",\n  \"function tokenURI(uint256) view returns (string)\",\n  \"event AigcData(uint256 indexed tokenId, bytes indexed prompt, bytes indexed aigcData, bytes proof)\",\n];\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst nft = new Contract(process.env.AIGC_NFT!, abi, provider);\n\nconsole.log(\"ERC-7007:\", await nft.supportsInterface(\"0x702c55a6\"));\n\nconst prompt = toUtf8Bytes(\"a lighthouse in a storm, oil painting\");\nconst tokenId = BigInt(keccak256(prompt)); // common implementation choice: id = hash(prompt)\nconsole.log(\"tokenURI:\", await nft.tokenURI(tokenId));\n\n// aigcData and proof come from the generator / prover off-chain\nconst ok = await nft.verify(prompt, process.env.AIGC_DATA!, process.env.PROOF ?? \"0x\");\nconsole.log(\"verified:\", ok);\n```\n\n## Things to know\n\n- **Status: Final.**\n- The exact hash used for `tokenId` is implementation-specific; check the contract rather than assuming keccak256 of the raw prompt bytes.\n- Prompts are visible in the mempool, so someone could front-run a claim. The spec says implementations must use an anti-front-running scheme such as commit-reveal or time locks.\n- In opML, `aigcData` can change during the challenge period. Indexers and marketplaces should watch for `Update` events and not treat data as final until `verify` returns `true`.\n- The standard proves the output came from a committed model and prompt. It does not address copyright or licensing of the generated content.\n"},"ja":{"lang":"ja","tldr":"AI 生成コンテンツ NFT 向けの ERC-721 拡張。トークン ID がプロンプトに紐づき、出力を zkML（有効性証明）または opML（不正証明）でオンチェーン検証できる。","tags":["nft","ai","zkml","opml","erc721"],"related":[721,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7007/","markdown":"## 何を解決するのか\n\n誰でも画像をミントして「これはモデル X がプロンプト Y から生成した」と主張できます。通常の NFT にはそれを証明するものが何もありません。そのため、モデルの作者がモデルを共有しつつ出力から価値を得ることが難しく、購入者が出所を信頼することも難しくなります。\n\nERC-7007 は、コンテンツが特定のモデルによる特定のプロンプトの出力であることを**検証可能**にした NFT を標準化します。方式は次のどちらかです。\n\n- **zkML**: 推論が正しく計算されたことのゼロ知識証明（有効性証明）。\n- **opML**: チャレンジ期間中に誰でも異議を申し立てられる楽観的な結果（不正証明）。\n\n## 仕組み\n\n準拠するすべてのコントラクトは、ERC-721、ERC-165、`IERC7007`（インターフェース ID `0x702c55a6`）を実装します。\n\n| 関数 / イベント | 役割 |\n| --- | --- |\n| `addAigcData(tokenId, prompt, aigcData, proof)` | プロンプトと生成された出力をトークンに紐づける |\n| `verify(prompt, aigcData, proof)` | 出力が確定していて正しい場合にのみ `true` を返す |\n| `AigcData(tokenId, prompt, aigcData, proof)` イベント | 追加された内容を記録する |\n\n`verify` の挙動は証明の種類によって異なります。\n\n- **zkML:** ZK 証明を verifier コントラクトに対して検証します。`addAigcData` は `verify` が `true` を返した場合にのみ成功すべきです。\n- **opML:** `proof` は空でもかまいません。`verify` は、チャレンジ期間が終了し、データが最新である場合にのみ `true` を返します。`addAigcData` は確定前に呼び出してもかまいません。\n\n`tokenId` はプロンプトのハッシュと定義されているため、同じプロンプトをコレクション内で 2 回ミントすることはできません。\n\n任意の拡張:\n\n- **Enumerable**（`0xfa1a557a`）: `tokenId(prompt)` と `prompt(tokenId)`。\n- **Updatable**（`0x3f37dce2`）: `update(prompt, aigcData)` と `Update` イベント。チャレンジが成功したあとに変わる opML の結果のためのものです。\n\nメタデータ JSON には `prompt`、`aigc_type`（image、video、audio など）、`aigc_data`（コンテンツの URI）、`proof_type`（`validity` または `fraud`）が追加されます。仕様は、モデルへのコミットメントを事前にオンチェーンで公開し、`verify` の中で確認することを推奨しています。\n\n## サンプルコード\n\nAIGC-NFT の読み取りと検証（ethers v6）:\n\n```ts\nimport { Contract, JsonRpcProvider, keccak256, toUtf8Bytes } from \"ethers\";\n\nconst abi = [\n  \"function supportsInterface(bytes4) view returns (bool)\",\n  \"function verify(bytes prompt, bytes aigcData, bytes proof) view returns (bool)\",\n  \"function tokenURI(uint256) view returns (string)\",\n  \"event AigcData(uint256 indexed tokenId, bytes indexed prompt, bytes indexed aigcData, bytes proof)\",\n];\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst nft = new Contract(process.env.AIGC_NFT!, abi, provider);\n\nconsole.log(\"ERC-7007:\", await nft.supportsInterface(\"0x702c55a6\"));\n\nconst prompt = toUtf8Bytes(\"a lighthouse in a storm, oil painting\");\nconst tokenId = BigInt(keccak256(prompt)); // common implementation choice: id = hash(prompt)\nconsole.log(\"tokenURI:\", await nft.tokenURI(tokenId));\n\n// aigcData and proof come from the generator / prover off-chain\nconst ok = await nft.verify(prompt, process.env.AIGC_DATA!, process.env.PROOF ?? \"0x\");\nconsole.log(\"verified:\", ok);\n```\n\n## 知っておくべきこと\n\n- **ステータス: Final。**\n- `tokenId` に使う正確なハッシュは実装依存です。生のプロンプトバイト列の keccak256 だと決めつけず、コントラクトを確認してください。\n- プロンプトは mempool 上で見えるため、誰かがクレームをフロントランできます。仕様は、実装が commit-reveal やタイムロックなどのフロントランニング対策を使わなければならないとしています。\n- opML では、チャレンジ期間中に `aigcData` が変わることがあります。インデクサーやマーケットプレイスは `Update` イベントを監視し、`verify` が `true` を返すまでデータを確定したものとして扱ってはいけません。\n- この標準が証明するのは、出力がコミット済みのモデルとプロンプトから生成されたことです。生成コンテンツの著作権やライセンスは扱いません。\n"},"ko":{"lang":"ko","tldr":"AI 생성 콘텐츠 NFT를 위한 ERC-721 확장. 토큰 ID가 프롬프트에 묶여 있고, 출력은 zkML(유효성 증명) 또는 opML(사기 증명)로 온체인에서 검증할 수 있다.","tags":["nft","ai","zkml","opml","erc721"],"related":[721,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7007/","markdown":"## 어떤 문제를 해결하나요?\n\n누구나 이미지를 민팅하고 \"이것은 모델 X가 프롬프트 Y로 생성했다\"고 주장할 수 있습니다. 일반 NFT에는 이를 증명할 수단이 없습니다. 그래서 모델 제작자가 모델을 공유하면서 그 출력물에서 가치를 얻기 어렵고, 구매자가 출처를 신뢰하기도 어렵습니다.\n\nERC-7007은 콘텐츠가 특정 모델의 특정 프롬프트에 대한 출력임을 **검증할 수 있는** NFT를 표준화합니다. 방식은 다음 중 하나입니다.\n\n- **zkML**: 추론이 올바르게 계산되었음을 보이는 영지식 증명(유효성 증명).\n- **opML**: 챌린지 기간 동안 누구나 이의를 제기할 수 있는 낙관적 결과(사기 증명).\n\n## 어떻게 동작하나요?\n\n규격을 따르는 모든 컨트랙트는 ERC-721, ERC-165, `IERC7007`(인터페이스 ID `0x702c55a6`)을 구현합니다.\n\n| 함수 / 이벤트 | 역할 |\n| --- | --- |\n| `addAigcData(tokenId, prompt, aigcData, proof)` | 프롬프트와 생성된 출력을 토큰에 연결 |\n| `verify(prompt, aigcData, proof)` | 출력이 확정되었고 올바를 때만 `true` 반환 |\n| `AigcData(tokenId, prompt, aigcData, proof)` 이벤트 | 추가된 내용을 기록 |\n\n`verify`의 동작은 증명 유형에 따라 다릅니다.\n\n- **zkML:** ZK 증명을 verifier 컨트랙트에 대해 검사합니다. `addAigcData`는 `verify`가 `true`를 반환할 때만 성공해야 합니다.\n- **opML:** `proof`는 비어 있을 수 있습니다. `verify`는 챌린지 기간이 끝나고 데이터가 최신일 때만 `true`를 반환합니다. `addAigcData`는 확정 전에 호출할 수 있습니다.\n\n`tokenId`는 프롬프트의 해시로 정의되므로, 같은 프롬프트를 한 컬렉션 안에서 두 번 민팅할 수 없습니다.\n\n선택적 확장:\n\n- **Enumerable**(`0xfa1a557a`): `tokenId(prompt)`와 `prompt(tokenId)`.\n- **Updatable**(`0x3f37dce2`): `update(prompt, aigcData)`와 `Update` 이벤트. 챌린지 성공 후 바뀌는 opML 결과를 위한 것입니다.\n\n메타데이터 JSON에는 `prompt`, `aigc_type`(image, video, audio 등), `aigc_data`(콘텐츠 URI), `proof_type`(`validity` 또는 `fraud`)이 추가됩니다. 스펙은 모델에 대한 커밋먼트를 미리 온체인에 공개하고 `verify` 안에서 확인하기를 권장합니다.\n\n## 샘플 코드\n\nAIGC-NFT 읽기 및 검증(ethers v6):\n\n```ts\nimport { Contract, JsonRpcProvider, keccak256, toUtf8Bytes } from \"ethers\";\n\nconst abi = [\n  \"function supportsInterface(bytes4) view returns (bool)\",\n  \"function verify(bytes prompt, bytes aigcData, bytes proof) view returns (bool)\",\n  \"function tokenURI(uint256) view returns (string)\",\n  \"event AigcData(uint256 indexed tokenId, bytes indexed prompt, bytes indexed aigcData, bytes proof)\",\n];\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst nft = new Contract(process.env.AIGC_NFT!, abi, provider);\n\nconsole.log(\"ERC-7007:\", await nft.supportsInterface(\"0x702c55a6\"));\n\nconst prompt = toUtf8Bytes(\"a lighthouse in a storm, oil painting\");\nconst tokenId = BigInt(keccak256(prompt)); // common implementation choice: id = hash(prompt)\nconsole.log(\"tokenURI:\", await nft.tokenURI(tokenId));\n\n// aigcData and proof come from the generator / prover off-chain\nconst ok = await nft.verify(prompt, process.env.AIGC_DATA!, process.env.PROOF ?? \"0x\");\nconsole.log(\"verified:\", ok);\n```\n\n## 알아둘 점\n\n- **상태: Final.**\n- `tokenId`에 쓰이는 정확한 해시는 구현에 따라 다릅니다. 원본 프롬프트 바이트의 keccak256이라고 가정하지 말고 컨트랙트를 확인하세요.\n- 프롬프트는 mempool에서 보이므로 누군가 클레임을 프런트러닝할 수 있습니다. 스펙은 구현이 commit-reveal이나 타임락 같은 프런트러닝 방지 방식을 반드시 사용해야 한다고 말합니다.\n- opML에서는 챌린지 기간 동안 `aigcData`가 바뀔 수 있습니다. 인덱서와 마켓플레이스는 `Update` 이벤트를 지켜봐야 하며, `verify`가 `true`를 반환하기 전에는 데이터를 최종본으로 취급해서는 안 됩니다.\n- 이 표준이 증명하는 것은 출력이 커밋된 모델과 프롬프트에서 나왔다는 점입니다. 생성된 콘텐츠의 저작권이나 라이선스는 다루지 않습니다.\n"},"zh":{"lang":"zh","tldr":"一个面向 AI 生成内容 NFT 的 ERC-721 扩展：代币 ID 与提示词绑定，输出可以通过 zkML（有效性证明）或 opML（欺诈证明）在链上验证。","tags":["nft","ai","zkml","opml","erc721"],"related":[721,165],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7007/","markdown":"## 它解决什么问题？\n\n任何人都可以铸造一张图片，并声称\"这是由模型 X 根据提示词 Y 生成的\"。普通 NFT 中没有任何东西能证明这一点。这使得模型作者很难在分享模型的同时从其输出中获得价值，买家也很难信任其来源。\n\nERC-7007 对内容**可验证地**是特定模型针对特定提示词的输出的 NFT 进行了标准化，采用以下两种方式之一：\n\n- **zkML**：证明推理计算正确的零知识证明（有效性证明），或\n- **opML**：一个乐观结果，任何人都可以在挑战期内对其提出质疑（欺诈证明）。\n\n## 它如何运作\n\n每个合规合约都实现 ERC-721、ERC-165 和 `IERC7007`（接口 ID `0x702c55a6`）：\n\n| 函数 / 事件 | 用途 |\n| --- | --- |\n| `addAigcData(tokenId, prompt, aigcData, proof)` | 将提示词及其生成的输出绑定到某个代币 |\n| `verify(prompt, aigcData, proof)` | 仅当输出已最终确定且正确时才返回 `true` |\n| `AigcData(tokenId, prompt, aigcData, proof)` 事件 | 记录所添加的内容 |\n\n`verify` 的行为取决于证明类型：\n\n- **zkML：** 针对 verifier 合约检查 ZK 证明。只有当 `verify` 返回 `true` 时，`addAigcData` 才应成功。\n- **opML：** `proof` 可以为空；只有在挑战期结束且数据为最新时，`verify` 才返回 `true`。`addAigcData` 可以在最终确定之前调用。\n\n`tokenId` 被定义为提示词的哈希，因此同一个提示词无法在同一个合集中被铸造两次。\n\n可选扩展：\n\n- **Enumerable**（`0xfa1a557a`）：`tokenId(prompt)` 和 `prompt(tokenId)`。\n- **Updatable**（`0x3f37dce2`）：`update(prompt, aigcData)` 加上 `Update` 事件，用于挑战成功后发生变化的 opML 结果。\n\n元数据 JSON 新增 `prompt`、`aigc_type`（image、video、audio……）、`aigc_data`（内容的 URI）和 `proof_type`（`validity` 或 `fraud`）。规范建议事先在链上发布对模型的承诺，并在 `verify` 中进行检查。\n\n## 示例代码\n\n读取并验证 AIGC-NFT（ethers v6）：\n\n```ts\nimport { Contract, JsonRpcProvider, keccak256, toUtf8Bytes } from \"ethers\";\n\nconst abi = [\n  \"function supportsInterface(bytes4) view returns (bool)\",\n  \"function verify(bytes prompt, bytes aigcData, bytes proof) view returns (bool)\",\n  \"function tokenURI(uint256) view returns (string)\",\n  \"event AigcData(uint256 indexed tokenId, bytes indexed prompt, bytes indexed aigcData, bytes proof)\",\n];\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst nft = new Contract(process.env.AIGC_NFT!, abi, provider);\n\nconsole.log(\"ERC-7007:\", await nft.supportsInterface(\"0x702c55a6\"));\n\nconst prompt = toUtf8Bytes(\"a lighthouse in a storm, oil painting\");\nconst tokenId = BigInt(keccak256(prompt)); // common implementation choice: id = hash(prompt)\nconsole.log(\"tokenURI:\", await nft.tokenURI(tokenId));\n\n// aigcData and proof come from the generator / prover off-chain\nconst ok = await nft.verify(prompt, process.env.AIGC_DATA!, process.env.PROOF ?? \"0x\");\nconsole.log(\"verified:\", ok);\n```\n\n## 需要注意\n\n- **状态：Final。**\n- `tokenId` 所用的具体哈希由实现决定；请查看合约，不要想当然地认为是对原始提示词字节做 keccak256。\n- 提示词在 mempool 中是可见的，因此有人可能抢跑某次认领。规范要求实现必须使用防抢跑方案，例如 commit-reveal 或时间锁。\n- 在 opML 中，`aigcData` 可能在挑战期内发生变化。索引器和市场应关注 `Update` 事件，在 `verify` 返回 `true` 之前不要把数据视为最终结果。\n- 该标准证明的是输出来自已承诺的模型和提示词。它不涉及生成内容的版权或许可问题。\n"}}}
