What is ERC-8004?
ERC-8004 is an open standard for AI agent identity and trust. It gives your agent:- A portable identity — Your agent exists as an NFT on Ethereum/L2s. It’s yours, not tied to any platform.
- Discoverable endpoints — Other agents and applications can find your MCP server, A2A endpoint, wallet, and more.
- Composable reputation — Feedback from clients builds a track record that follows your agent everywhere.
The Three Registries
This guide focuses on the Identity Registry — registering your agent so it can be discovered.
Quick Start
For example agent cards and ready-to-run scripts, check out PinataCloud/erc8004. For an interactive experience, try the wizard:Prerequisites
- Pinata account — Sign up at pinata.cloud, create an API key and a gateway
- Native tokens for gas — Get free testnet tokens from faucets (links in table below)
- Wallet private key — The wallet that will own your agent NFT
Supported Networks
ERC-8004 is deployed on multiple chains with consistent addresses:All mainnets share the same address:
0x8004A169FB4a3325136EB29fA0ceB6D2e539a432All testnets share the same address: 0x8004A818BFB912233c491871b3d84c89A494BD9eUsing the Scripts
Clone the repo and install dependencies:Available Scripts
Network Selection
By default, scripts use Ethereum Sepolia. To use a different network:Registration Flow
Registration has four steps:- Register on-chain (without URI) → Get your
agentId - Build agent card with
registrations[]containing your newagentId - Upload to IPFS via Pinata
- Set agent URI on-chain to point to your IPFS content
Code Example
Agent Card Schema
Trust Models
ThesupportedTrust array declares how clients can verify your agent:
Most agents use
["reputation"].
Example Agent Card
Endpoint Verification
Agents can prove they control their advertised endpoints by serving a.well-known file.
How it works:
- Agent lists an HTTPS endpoint in their card
- Verifier fetches
https://{domain}/.well-known/agent-registration.json - File must contain a
registrations[]entry matching the agent
/.well-known/agent-registration.json on your domain:
Verification isn’t needed if your agent URI and endpoint share the same domain — domain control is already demonstrated.
Payment Wallet
ERC-8004 stores the agent’s payment wallet on-chain (not in the agent card). The wallet address must sign an EIP-712 message proving consent.Updating an Agent
To update metadata, re-upload the agent card and callsetAgentURI:
Verifying Agents
Theverify script fetches agent cards from IPFS via your Pinata gateway and validates them against the ERC-8004 spec:
To verify agents you didn’t register, set up Gateway Access Controls and add a gateway key to your
.env or pass it via CLI: --gateway-key your_token