ERC-8041 · Draft · ERC · 2025-10-11
ERC-8041: Fixed-Supply Agent NFT Collections
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 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 token.
How it works
A collection contract tracks maxSupply, currentSupply, startBlock and open, and must:
- Enforce supply and timing: never exceed
maxSupply, and respectstartBlock. - Number every member: mint numbers start at 1, increase sequentially and never change.
getAgentMintNumber(agentId)returns it, or0if 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 parameterized key such asagent-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, andAgentMinted(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 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:
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:
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, ERC-8119, ERC-7572), so details may shift with them.
- Agent owners can edit or delete the
agent-collectionmetadata on their own agent at any time. Never treat that metadata as proof; always callgetAgentMintNumberon 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.