ERC-8122 Minimal AI Agent Registry (Minimal Agent Registry)
Draft · NFTs & multi-token · created 2025-12-17
A lightweight registry standard that registers AI agents as ERC-6909 token IDs and stores metadata on-chain via ERC-8048, enabling ownership transfer and discovery.
Why it is needed
Existing off-chain agent protocols handle communication between agents but do not handle discovery of agents. ERC-8004 provides an agent registry standard, but since it uses a single singleton registry per chain, it is difficult to create purpose-curated collections, such as a collection of white-hat hacking agents or a collection of DeFi stablecoin strategy agents, or collections with a fixed supply. There is also no standard allowing anyone to easily deploy their own registry, and storing metadata in external storage leaves it vulnerable to censorship, deletion, or tampering.
What to implement
event Registered(uint256 indexed agentId, address indexed owner, string service_type, string service, address agent_account);: An event emitted when a new agent is registered, recording the agent ID, owner, and service information.function register(address owner, string calldata service_type, string calldata service, address agent_account) external returns (uint256 agentId);: Registers a new agent by directly specifying standard metadata fields.function register(address owner, MetadataEntry[] calldata metadata) external returns (uint256 agentId);: Registers a new agent by passing an arbitrary array of key-value metadata.function registerBatch(address[] calldata owners, MetadataEntry[][] calldata metadata) external returns (uint256[] memory agentIds);: Batch-registers multiple agents by passing multiple owners and metadata at once.function ownerOf(uint256 agentId) external view returns (address);: Returns the current owner address for a given agentId.function setContractMetadata(string calldata key, bytes calldata value) external;: Sets metadata for the registry contract itself.
In depth
Identifier structure
Each agent is globally uniquely identified by two values: agentRegistry and agentId. agentRegistry is an ERC-7930 interoperable address that encodes chain type, chain reference, and contract address in a single binary format, pointing to the registry contract without needing a separate namespace or chainId field. agentId is a uint256 token ID assigned by the registry according to its own implementation. The combination of these two values distinguishes an agent on any chain in any registry.
Agent ID text format
When displaying an agent ID as text, it must follow the ERC-8127 format [alias.]agentId@registry, a human-readable token identifier format. registry is an ERC-7930 interoperable address written in lowercase hexadecimal, and agentId is a decimal token ID. alias is optional and may use the value of the agent's name metadata field. Examples include agent.12345@0x0001...045 with an alias, and 12345@0x0001...045 without one.
Ownership model and transfer restrictions
The registry must maintain a mapping of agentId to owner address and must return the current owner via the ownerOf(uint256 agentId) function. Querying a nonexistent agentId must revert. To enforce single ownership, the amount parameter of transfer and transferFrom must be exactly 1; the transfer must revert if it is not 1. When a transfer occurs, the _owners mapping must be updated to the new owner.
Contract-level metadata
Registries are encouraged to implement ERC-8049 for their own information, and if used, must expose the setContractMetadata function. Access control is implementation-specific. The name, description, and image keys are recommended to be set, while the symbol, banner_image, featured_image, and external_link keys may optionally be set. Implementations may define additional keys as needed.
Agent metadata keys
All agent metadata is stored on-chain via the key-value store interface of ERC-8048. Registries must implement ERC-8048 and expose the setMetadata function, which must revert if the caller is not the owner, an approved spender, or an operator for the given agentId. For interoperability, the name, ens_name, image, description, service_type, service, and agent_account keys are recommended. All metadata values are stored as bytes and, unless a type is specified, must be the UTF-8 encoding of a string.
URI substitution, IPFS, and additional services
URI fields in metadata such as image and service may contain an {id} placeholder, which clients must resolve by substituting the token ID. For example, if the service URI is https://api.example.com/agents/{id} and the token ID is 12345, it resolves to https://api.example.com/agents/12345. URIs may use the IPFS protocol, in which case the ipfs://<CID> format is recommended. Additional services can be stored using the parameterized storage keys of ERC-8119, numbered like service_type:1, service:1.
Registration process and events
A new agent is minted by calling one of the registration functions defined in the interface. Upon registration, the registry assigns a new unique agentId, sets the passed-in owner in the _owners mapping, and that owner receives a balance of 1 for that agentId. This process emits an ERC-6909 Transfer event (from address(0) to owner), an ERC-8048 MetadataSet event for each metadata entry, and a Registered event. If any of service_type, service, or agent_account are not set, they must be set to default values when the events are emitted.
Proposal status
This ERC is currently in Draft status, a proposal that may still change or be discontinued.