{"eip":8041,"title":"Fixed-Supply Agent NFT Collections","description":"Create fixed-supply collections of ERC-8004 Agent NFTs with mint number tracking","authors":["Prem Makeig (@nxt3d)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2025-10-11","requires":[7572,8004,8119],"discussionsTo":"https://ethereum-magicians.org/t/erc-8041-fixed-supply-agent-nft-collections/25656","repo":"ERCs","label":"ERC-8041","officialUrl":"https://eips.ethereum.org/EIPS/eip-8041","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8041.md","url":"https://eips.huatuo.xyz/eip-8041/","tldr":{"en":"A draft standard for limited-edition collections of ERC-8004 agent identities: a collection contract caps supply, gives each agent a permanent mint number (#5 of 100), and tags the agent's on-chain metadata with the collection.","ja":"ERC-8004 エージェント ID の限定版コレクション向けのドラフト段階の標準。コレクションコントラクトが供給量に上限を設け、各エージェントに恒久的なミント番号（100 個中の 5 番など）を付与し、エージェントのオンチェーンメタデータにコレクションのタグを付ける。","ko":"한정판 ERC-8004 에이전트 신원 컬렉션을 위한 초안 단계의 표준. 컬렉션 컨트랙트가 공급량을 제한하고, 각 에이전트에 영구적인 민트 번호(100개 중 5번)를 부여하며, 에이전트의 온체인 메타데이터에 컬렉션 태그를 붙인다.","zh":"一个处于草案阶段的标准，用于限量版的 ERC-8004 智能体身份合集：合集合约限制供应量，为每个智能体赋予永久的铸造编号（100 个中的第 5 个），并在智能体的链上元数据中标记所属合集。"},"tags":["ai-agents","nft","collections","metadata","erc-8004"],"explainers":{"en":{"lang":"en","tldr":"A draft standard for limited-edition collections of ERC-8004 agent identities: a collection contract caps supply, gives each agent a permanent mint number (#5 of 100), and tags the agent's on-chain metadata with the collection.","tags":["ai-agents","nft","collections","metadata","erc-8004"],"related":[8004,8119,7572,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8041/","markdown":"## What problem does it solve?\n\n[ERC-8004](/eip-8004/) defines a registry where AI agents get an on-chain identity as an NFT. Anyone can register, and there is no supply limit. That suits open registration, but many projects want something closer to an NFT drop: \"Genesis 100\", \"Season 1\", a curated team of agents, or a release that only opens at a given block, with provable numbering.\n\nERC-8041 adds that layer without a new registry. A separate **collection contract** enforces the limit and records each agent's position, while the agent itself stays a normal ERC-8004 / [ERC-721](/eip-721/) token.\n\n## How it works\n\nA collection contract tracks `maxSupply`, `currentSupply`, `startBlock` and `open`, and must:\n\n- **Enforce supply and timing**: never exceed `maxSupply`, and respect `startBlock`.\n- **Number every member**: mint numbers start at 1, increase sequentially and never change. `getAgentMintNumber(agentId)` returns it, or `0` if the agent is not in this collection. `getCollectionSupply()` returns the current count.\n- **Tag the agent**: write metadata to the agent's ERC-8004 on-chain metadata under a key naming the collection. The default key is `agent-collection`; additional collections use an [ERC-8119](/eip-8119/) parameterized key such as `agent-collection:dev-team`. The suggested value is the collection address (20 bytes), a 1-byte length, then the mint number bytes.\n- **Emit events**: `CollectionUpdated(maxSupply, startBlock, open)` at creation and on every change, and `AgentMinted(agentId, mintNumber, owner)` for every addition.\n\nAccess control, pricing, pausing and batch minting are left to the implementer. Collections should expose collection-level info (name, image, links) through [ERC-7572](/eip-7572/) `contractURI()`.\n\nIn the reference implementation, owners register an agent in ERC-8004 first and then add it to the collection (\"bring your own agent\").\n\n## Sample code\n\nVerifying membership from an app (ethers v6). Use the metadata only to discover the collection, then confirm with the collection contract:\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nconst collection = new Contract(\n  process.env.COLLECTION_ADDRESS!,\n  [\n    \"function getAgentMintNumber(uint256 agentId) view returns (uint256)\",\n    \"function getCollectionSupply() view returns (uint256)\",\n    \"function contractURI() view returns (string)\",\n  ],\n  provider,\n);\n\nasync function describe(agentId: bigint) {\n  const n: bigint = await collection.getAgentMintNumber(agentId);\n  if (n === 0n) return \"not in this collection\";       // 0 is definitive\n  const supply: bigint = await collection.getCollectionSupply();\n  return `agent #${n} (currently ${supply} minted)`;\n}\n```\n\nCore interface:\n\n```solidity\ninterface IERC8041Collection {\n    event CollectionUpdated(uint256 maxSupply, uint256 startBlock, bool open);\n    event AgentMinted(uint256 indexed agentId, uint256 mintNumber, address indexed owner);\n\n    function getAgentMintNumber(uint256 agentId) external view returns (uint256 mintNumber);\n    function getCollectionSupply() external view returns (uint256 currentSupply);\n}\n```\n\n## Things to know\n\n- **Status: Draft**, and it builds on other Draft proposals ([ERC-8004](/eip-8004/), [ERC-8119](/eip-8119/), [ERC-7572](/eip-7572/)), so details may shift with them.\n- Agent owners can edit or delete the `agent-collection` metadata on their own agent at any time. Never treat that metadata as proof; always call `getAgentMintNumber` on the collection contract.\n- Labeled collection keys are unbounded, so finding every collection an agent belongs to requires indexing its metadata keys.\n- The metadata layout is a SHOULD, and the reference implementation encodes the mint number as a full 32-byte ABI value rather than a compact form. Decode using the length byte rather than assuming a size.\n- How a collection contract obtains permission to write metadata to someone else's agent depends on the ERC-8004 registry's rules; check them before deploying.\n"},"ja":{"lang":"ja","tldr":"ERC-8004 エージェント ID の限定版コレクション向けのドラフト段階の標準。コレクションコントラクトが供給量に上限を設け、各エージェントに恒久的なミント番号（100 個中の 5 番など）を付与し、エージェントのオンチェーンメタデータにコレクションのタグを付ける。","tags":["ai-agents","nft","collections","metadata","erc-8004"],"related":[8004,8119,7572,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8041/","markdown":"## 何を解決するのか\n\n[ERC-8004](/eip-8004/) は、AI エージェントが NFT としてオンチェーン ID を得るレジストリを定義しています。誰でも登録でき、供給量に上限はありません。オープンな登録には向いていますが、多くのプロジェクトは NFT のドロップに近いものを求めています。「Genesis 100」や「Season 1」、厳選されたエージェントのチーム、特定のブロックで初めて開くリリースなどで、番号付けを証明できることも求められます。\n\nERC-8041 は、新しいレジストリを作らずにこの層を追加します。別個の**コレクションコントラクト**が上限を強制して各エージェントの順位を記録し、エージェント自体は通常の ERC-8004 / [ERC-721](/eip-721/) トークンのままです。\n\n## 仕組み\n\nコレクションコントラクトは `maxSupply`、`currentSupply`、`startBlock`、`open` を管理し、次のことを満たさなければなりません。\n\n- **供給量とタイミングの強制**: `maxSupply` を超えないこと、`startBlock` を守ること。\n- **全メンバーへの番号付け**: ミント番号は 1 から始まり、順番に増え、変更されません。`getAgentMintNumber(agentId)` はその番号を返し、エージェントがこのコレクションに属さない場合は `0` を返します。`getCollectionSupply()` は現在の数を返します。\n- **エージェントへのタグ付け**: コレクションを示すキーで、エージェントの ERC-8004 オンチェーンメタデータにメタデータを書き込みます。デフォルトのキーは `agent-collection` で、追加のコレクションには `agent-collection:dev-team` のような [ERC-8119](/eip-8119/) のパラメータ付きキーを使います。推奨される値は、コレクションのアドレス（20 バイト）、1 バイトの長さ、そしてミント番号のバイト列です。\n- **イベントの発行**: 作成時と変更のたびに `CollectionUpdated(maxSupply, startBlock, open)` を、追加のたびに `AgentMinted(agentId, mintNumber, owner)` を発行します。\n\nアクセス制御、価格設定、一時停止、バッチミントは実装者に委ねられています。コレクションは、コレクション単位の情報（名前、画像、リンク）を [ERC-7572](/eip-7572/) の `contractURI()` で公開すべきです。\n\nリファレンス実装では、オーナーはまず ERC-8004 にエージェントを登録し、それからコレクションに追加します（「bring your own agent」）。\n\n## サンプルコード\n\nアプリからメンバーシップを検証する例（ethers v6）。メタデータはコレクションを見つけるためだけに使い、確認はコレクションコントラクトで行います。\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nconst collection = new Contract(\n  process.env.COLLECTION_ADDRESS!,\n  [\n    \"function getAgentMintNumber(uint256 agentId) view returns (uint256)\",\n    \"function getCollectionSupply() view returns (uint256)\",\n    \"function contractURI() view returns (string)\",\n  ],\n  provider,\n);\n\nasync function describe(agentId: bigint) {\n  const n: bigint = await collection.getAgentMintNumber(agentId);\n  if (n === 0n) return \"not in this collection\";       // 0 is definitive\n  const supply: bigint = await collection.getCollectionSupply();\n  return `agent #${n} (currently ${supply} minted)`;\n}\n```\n\nコアインターフェース:\n\n```solidity\ninterface IERC8041Collection {\n    event CollectionUpdated(uint256 maxSupply, uint256 startBlock, bool open);\n    event AgentMinted(uint256 indexed agentId, uint256 mintNumber, address indexed owner);\n\n    function getAgentMintNumber(uint256 agentId) external view returns (uint256 mintNumber);\n    function getCollectionSupply() external view returns (uint256 currentSupply);\n}\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft** であり、ほかの Draft 提案（[ERC-8004](/eip-8004/)、[ERC-8119](/eip-8119/)、[ERC-7572](/eip-7572/)）の上に成り立っているため、それらに合わせて詳細が変わる可能性があります。\n- エージェントのオーナーは、自分のエージェントの `agent-collection` メタデータをいつでも編集・削除できます。このメタデータを証明として扱ってはいけません。必ずコレクションコントラクトの `getAgentMintNumber` を呼び出してください。\n- ラベル付きのコレクションキーには上限がないため、エージェントが属するすべてのコレクションを見つけるには、そのメタデータキーをインデックス化する必要があります。\n- メタデータのレイアウトは SHOULD であり、リファレンス実装はミント番号をコンパクトな形式ではなく、32 バイトの ABI 値としてそのままエンコードしています。サイズを決め打ちせず、長さのバイトを使ってデコードしてください。\n- コレクションコントラクトが他人のエージェントにメタデータを書き込む権限をどう得るかは、ERC-8004 レジストリのルールによります。デプロイ前に確認してください。\n"},"ko":{"lang":"ko","tldr":"한정판 ERC-8004 에이전트 신원 컬렉션을 위한 초안 단계의 표준. 컬렉션 컨트랙트가 공급량을 제한하고, 각 에이전트에 영구적인 민트 번호(100개 중 5번)를 부여하며, 에이전트의 온체인 메타데이터에 컬렉션 태그를 붙인다.","tags":["ai-agents","nft","collections","metadata","erc-8004"],"related":[8004,8119,7572,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8041/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-8004](/eip-8004/)는 AI 에이전트가 NFT로서 온체인 신원을 얻는 레지스트리를 정의합니다. 누구나 등록할 수 있고 공급량 제한은 없습니다. 개방형 등록에는 적합하지만, 많은 프로젝트는 NFT 드롭에 더 가까운 것을 원합니다. \"Genesis 100\", \"Season 1\", 엄선된 에이전트 팀, 특정 블록에서만 열리는 릴리스처럼 번호를 증명할 수 있어야 하는 경우입니다.\n\nERC-8041은 새 레지스트리 없이 이 계층을 추가합니다. 별도의 **컬렉션 컨트랙트**가 제한을 강제하고 각 에이전트의 순번을 기록하며, 에이전트 자체는 일반적인 ERC-8004 / [ERC-721](/eip-721/) 토큰으로 남습니다.\n\n## 어떻게 동작하나요?\n\n컬렉션 컨트랙트는 `maxSupply`, `currentSupply`, `startBlock`, `open`을 관리하며 다음을 지켜야 합니다.\n\n- **공급량과 시점 강제**: `maxSupply`를 절대 넘지 않고 `startBlock`을 따릅니다.\n- **모든 멤버에게 번호 부여**: 민트 번호는 1부터 시작해 순차적으로 늘어나며 절대 바뀌지 않습니다. `getAgentMintNumber(agentId)`는 그 번호를 반환하고, 에이전트가 이 컬렉션에 없으면 `0`을 반환합니다. `getCollectionSupply()`는 현재 개수를 반환합니다.\n- **에이전트 태깅**: 컬렉션을 가리키는 키로 에이전트의 ERC-8004 온체인 메타데이터에 메타데이터를 기록합니다. 기본 키는 `agent-collection`이며, 추가 컬렉션은 `agent-collection:dev-team` 같은 [ERC-8119](/eip-8119/) 파라미터형 키를 사용합니다. 권장 값은 컬렉션 주소(20바이트), 1바이트 길이, 그리고 민트 번호 바이트입니다.\n- **이벤트 발생**: 생성 시와 변경될 때마다 `CollectionUpdated(maxSupply, startBlock, open)`을, 추가될 때마다 `AgentMinted(agentId, mintNumber, owner)`를 발생시킵니다.\n\n접근 제어, 가격 책정, 일시 중지, 배치 민팅은 구현자에게 맡깁니다. 컬렉션은 컬렉션 수준의 정보(이름, 이미지, 링크)를 [ERC-7572](/eip-7572/)의 `contractURI()`로 제공해야 합니다.\n\n레퍼런스 구현에서는 소유자가 먼저 ERC-8004에 에이전트를 등록한 다음 컬렉션에 추가합니다(\"bring your own agent\").\n\n## 샘플 코드\n\n앱에서 멤버십을 검증하는 예시(ethers v6)입니다. 메타데이터는 컬렉션을 찾는 데만 쓰고, 확인은 컬렉션 컨트랙트로 하세요.\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nconst collection = new Contract(\n  process.env.COLLECTION_ADDRESS!,\n  [\n    \"function getAgentMintNumber(uint256 agentId) view returns (uint256)\",\n    \"function getCollectionSupply() view returns (uint256)\",\n    \"function contractURI() view returns (string)\",\n  ],\n  provider,\n);\n\nasync function describe(agentId: bigint) {\n  const n: bigint = await collection.getAgentMintNumber(agentId);\n  if (n === 0n) return \"not in this collection\";       // 0 is definitive\n  const supply: bigint = await collection.getCollectionSupply();\n  return `agent #${n} (currently ${supply} minted)`;\n}\n```\n\n핵심 인터페이스:\n\n```solidity\ninterface IERC8041Collection {\n    event CollectionUpdated(uint256 maxSupply, uint256 startBlock, bool open);\n    event AgentMinted(uint256 indexed agentId, uint256 mintNumber, address indexed owner);\n\n    function getAgentMintNumber(uint256 agentId) external view returns (uint256 mintNumber);\n    function getCollectionSupply() external view returns (uint256 currentSupply);\n}\n```\n\n## 알아둘 점\n\n- **상태: Draft**이며 다른 Draft 제안([ERC-8004](/eip-8004/), [ERC-8119](/eip-8119/), [ERC-7572](/eip-7572/))을 기반으로 하므로, 그 제안들에 따라 세부 사항이 바뀔 수 있습니다.\n- 에이전트 소유자는 자기 에이전트의 `agent-collection` 메타데이터를 언제든 수정하거나 삭제할 수 있습니다. 이 메타데이터를 증거로 취급하지 말고, 항상 컬렉션 컨트랙트의 `getAgentMintNumber`를 호출하세요.\n- 라벨이 붙은 컬렉션 키는 개수 제한이 없으므로, 에이전트가 속한 모든 컬렉션을 찾으려면 해당 메타데이터 키를 인덱싱해야 합니다.\n- 메타데이터 레이아웃은 SHOULD이며, 레퍼런스 구현은 민트 번호를 간결한 형태가 아니라 전체 32바이트 ABI 값으로 인코딩합니다. 크기를 가정하지 말고 길이 바이트를 사용해 디코딩하세요.\n- 컬렉션 컨트랙트가 다른 사람의 에이전트에 메타데이터를 쓸 권한을 어떻게 얻는지는 ERC-8004 레지스트리의 규칙에 달려 있습니다. 배포 전에 확인하세요.\n"},"zh":{"lang":"zh","tldr":"一个处于草案阶段的标准，用于限量版的 ERC-8004 智能体身份合集：合集合约限制供应量，为每个智能体赋予永久的铸造编号（100 个中的第 5 个），并在智能体的链上元数据中标记所属合集。","tags":["ai-agents","nft","collections","metadata","erc-8004"],"related":[8004,8119,7572,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8041/","markdown":"## 它解决什么问题？\n\n[ERC-8004](/eip-8004/) 定义了一个注册表，AI 智能体在其中以 NFT 的形式获得链上身份。任何人都可以注册，且没有供应上限。这适合开放注册，但许多项目想要更接近 NFT 发售的形式：\"Genesis 100\"、\"Season 1\"、精心挑选的智能体团队，或是只在特定区块才开放的发布，并且编号可证明。\n\nERC-8041 无需新的注册表就能增加这一层。单独的**合集合约**负责强制执行上限并记录每个智能体的位置，而智能体本身仍是普通的 ERC-8004 / [ERC-721](/eip-721/) 代币。\n\n## 它如何运作\n\n合集合约记录 `maxSupply`、`currentSupply`、`startBlock` 和 `open`，并且必须：\n\n- **强制执行供应量和时间**：绝不超过 `maxSupply`，并遵守 `startBlock`。\n- **为每个成员编号**：铸造编号从 1 开始，依次递增，且永不改变。`getAgentMintNumber(agentId)` 返回该编号，如果该智能体不在此合集中则返回 `0`。`getCollectionSupply()` 返回当前数量。\n- **标记智能体**：在智能体的 ERC-8004 链上元数据中，以一个指明合集的键写入元数据。默认键为 `agent-collection`；其他合集使用 [ERC-8119](/eip-8119/) 的参数化键，例如 `agent-collection:dev-team`。建议的值依次为合集地址（20 字节）、1 字节的长度，以及铸造编号的字节。\n- **触发事件**：创建时以及每次变更时触发 `CollectionUpdated(maxSupply, startBlock, open)`，每次添加时触发 `AgentMinted(agentId, mintNumber, owner)`。\n\n访问控制、定价、暂停和批量铸造由实现者自行决定。合集应通过 [ERC-7572](/eip-7572/) 的 `contractURI()` 提供合集级别的信息（名称、图片、链接）。\n\n在参考实现中，所有者先在 ERC-8004 中注册智能体，再把它加入合集（\"自带智能体\"）。\n\n## 示例代码\n\n在应用中验证成员资格（ethers v6）。元数据只用于发现合集，然后再向合集合约确认：\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\n\nconst collection = new Contract(\n  process.env.COLLECTION_ADDRESS!,\n  [\n    \"function getAgentMintNumber(uint256 agentId) view returns (uint256)\",\n    \"function getCollectionSupply() view returns (uint256)\",\n    \"function contractURI() view returns (string)\",\n  ],\n  provider,\n);\n\nasync function describe(agentId: bigint) {\n  const n: bigint = await collection.getAgentMintNumber(agentId);\n  if (n === 0n) return \"not in this collection\";       // 0 is definitive\n  const supply: bigint = await collection.getCollectionSupply();\n  return `agent #${n} (currently ${supply} minted)`;\n}\n```\n\n核心接口：\n\n```solidity\ninterface IERC8041Collection {\n    event CollectionUpdated(uint256 maxSupply, uint256 startBlock, bool open);\n    event AgentMinted(uint256 indexed agentId, uint256 mintNumber, address indexed owner);\n\n    function getAgentMintNumber(uint256 agentId) external view returns (uint256 mintNumber);\n    function getCollectionSupply() external view returns (uint256 currentSupply);\n}\n```\n\n## 需要注意\n\n- **状态：Draft**，并且建立在其他 Draft 提案（[ERC-8004](/eip-8004/)、[ERC-8119](/eip-8119/)、[ERC-7572](/eip-7572/)）之上，因此细节可能随它们而变化。\n- 智能体所有者可以随时编辑或删除自己智能体上的 `agent-collection` 元数据。绝不要把该元数据当作证明；务必调用合集合约的 `getAgentMintNumber`。\n- 带标签的合集键数量没有上限，因此要找出某个智能体所属的全部合集，需要对其元数据键建立索引。\n- 元数据布局只是 SHOULD 级别的要求，而参考实现把铸造编号编码为完整的 32 字节 ABI 值，而不是紧凑形式。请根据长度字节解码，不要假定固定大小。\n- 合集合约如何获得向他人智能体写入元数据的权限，取决于 ERC-8004 注册表的规则；部署前请先查看这些规则。\n"}}}
