Skip to main content

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

  1. Pinata account — Sign up at pinata.cloud, create an API key and a gateway
  2. Native tokens for gas — Get free testnet tokens from faucets (links in table below)
  3. 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: 0x8004A818BFB912233c491871b3d84c89A494BD9e

Using 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:
  1. Register on-chain (without URI) → Get your agentId
  2. Build agent card with registrations[] containing your new agentId
  3. Upload to IPFS via Pinata
  4. Set agent URI on-chain to point to your IPFS content

Code Example

Agent Card Schema

Trust Models

The supportedTrust 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:
  1. Agent lists an HTTPS endpoint in their card
  2. Verifier fetches https://{domain}/.well-known/agent-registration.json
  3. File must contain a registrations[] entry matching the agent
Create /.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.
Read the payment wallet:
Or use the script:

Updating an Agent

To update metadata, re-upload the agent card and call setAgentURI:
Or use the script:

Verifying Agents

The verify 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

Resources