Overview
ERC-8004 defines an on-chain identity standard for AI agents. It allows agents to register their identity on a blockchain, providing verifiable, decentralized identity for agent-to-agent and agent-to-user interactions. aixyz supports ERC-8004 through the@aixyz/erc-8004 package (contract ABIs, deployed addresses, and Zod schemas) and built-in CLI commands for registry operations.
Supported Networks
Mainnets: Ethereum, Base, Polygon, Scroll, Monad, BSC, Gnosis Testnets: Sepolia, Base Sepolia, Polygon Amoy, Scroll Sepolia, Monad Testnet, BSC TestnetThe app/erc-8004.ts File
Every agent that uses ERC-8004 identity declares an app/erc-8004.ts file. This file defines the agent’s supported trust mechanisms and tracks on-chain registrations:
app/erc-8004.ts
GET /_aixyz/erc-8004.json
aixyz.config.ts (name, description, image, services).
Register an Agent
Useaixyz erc-8004 register to register your agent on the IdentityRegistry:
- Creates
app/erc-8004.tsif it doesn’t exist — prompts you to select supported trust mechanisms - Asks for your agent’s deployment URL (e.g.,
https://my-agent.vercel.app) - Derives the on-chain URI as
<url>/_aixyz/erc-8004.jsonand asks you to confirm - Selects chain and wallet, then signs and broadcasts the transaction
- Writes the registration back into the
registrationsarray inapp/erc-8004.ts
app/erc-8004.ts will contain the on-chain reference:
app/erc-8004.ts
| Flag | Description |
|---|---|
--url | Agent deployment URL (prompted if omitted) |
--chain | mainnet, sepolia, base-sepolia, localhost |
--rpc-url | Custom RPC endpoint |
--keystore | Encrypted keystore file |
--browser | Use browser wallet (EIP-6963) |
--broadcast | Send transaction (default is dry-run) |
Update Agent URI
After redeploying to a new URL, update the on-chain URI withaixyz erc-8004 update:
app/erc-8004.ts:
- If there’s one registration, it confirms and proceeds
- If there are multiple, it prompts you to select which one to update
agentRegistry field.
| Flag | Description |
|---|---|
--url | New agent deployment URL (prompted if omitted) |
--rpc-url | Custom RPC endpoint |
--keystore | Encrypted keystore file |
--browser | Use browser wallet (EIP-6963) |
--broadcast | Send transaction (default is dry-run) |
Programmatic Usage
Use the@aixyz/erc-8004 package to interact with the registry from code:
- Contract ABIs — TypeScript-typed ABIs for use with viem, ethers, or wagmi
- Deployed addresses — Known contract addresses across supported networks
- Zod schemas — Validation schemas for registration data and agent URIs
Integration with aixyz
ERC-8004 identity complements the other protocols:- A2A — The agent card can reference an on-chain identity for verification
- x402 — Payment gating tied to verified on-chain agent identities
- MCP — Tool discovery backed by verifiable identity
A2A Protocol
Agent discovery with A2A agent cards.
x402 Payments
Payment gating for agent endpoints.