---
eip: 8041
label: ERC-8041
title: Fixed-Supply Agent NFT Collections
status: Draft
type: Standards Track
category: ERC
created: 2025-10-11
requires: 7572, 8004, 8119
official: https://eips.ethereum.org/EIPS/eip-8041
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8041.md
canonical: https://eips.huatuo.xyz/eip-8041/
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]
---

# ERC-8041: Fixed-Supply Agent NFT Collections

> Create fixed-supply collections of ERC-8004 Agent NFTs with mint number tracking

**TL;DR:** 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.

## What problem does it solve?

[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.

ERC-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.

## How it works

A collection contract tracks `maxSupply`, `currentSupply`, `startBlock` and `open`, and must:

- **Enforce supply and timing**: never exceed `maxSupply`, and respect `startBlock`.
- **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.
- **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.
- **Emit events**: `CollectionUpdated(maxSupply, startBlock, open)` at creation and on every change, and `AgentMinted(agentId, mintNumber, owner)` for every addition.

Access 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()`.

In the reference implementation, owners register an agent in ERC-8004 first and then add it to the collection ("bring your own agent").

## Sample code

Verifying membership from an app (ethers v6). Use the metadata only to discover the collection, then confirm with the collection contract:

```ts
import { Contract, JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);

const collection = new Contract(
  process.env.COLLECTION_ADDRESS!,
  [
    "function getAgentMintNumber(uint256 agentId) view returns (uint256)",
    "function getCollectionSupply() view returns (uint256)",
    "function contractURI() view returns (string)",
  ],
  provider,
);

async function describe(agentId: bigint) {
  const n: bigint = await collection.getAgentMintNumber(agentId);
  if (n === 0n) return "not in this collection";       // 0 is definitive
  const supply: bigint = await collection.getCollectionSupply();
  return `agent #${n} (currently ${supply} minted)`;
}
```

Core interface:

```solidity
interface IERC8041Collection {
    event CollectionUpdated(uint256 maxSupply, uint256 startBlock, bool open);
    event AgentMinted(uint256 indexed agentId, uint256 mintNumber, address indexed owner);

    function getAgentMintNumber(uint256 agentId) external view returns (uint256 mintNumber);
    function getCollectionSupply() external view returns (uint256 currentSupply);
}
```

## Things to know

- **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.
- 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.
- Labeled collection keys are unbounded, so finding every collection an agent belongs to requires indexing its metadata keys.
- 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.
- 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.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8041
