Skip to main content

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 Testnet

The 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
When this file exists, the build pipeline automatically exposes two endpoints:
  • GET /_aixyz/erc-8004.json
These serve the full agent registration file, merging defaults from aixyz.config.ts (name, description, image, services).

Register an Agent

Use aixyz erc-8004 register to register your agent on the IdentityRegistry:
The command walks you through an interactive flow:
  1. Creates app/erc-8004.ts if it doesn’t exist — prompts you to select supported trust mechanisms
  2. Asks for your agent’s deployment URL (e.g., https://my-agent.vercel.app)
  3. Derives the on-chain URI as <url>/_aixyz/erc-8004.json and asks you to confirm
  4. Selects chain and wallet, then signs and broadcasts the transaction
  5. Writes the registration back into the registrations array in app/erc-8004.ts
After registration, your app/erc-8004.ts will contain the on-chain reference:
app/erc-8004.ts

Update Agent URI

After redeploying to a new URL, update the on-chain URI with aixyz erc-8004 update:
The command reads existing registrations from 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
The chain and registry address are derived automatically from the selected registration’s agentRegistry field.

Programmatic Usage

Use the @aixyz/erc-8004 package to interact with the registry from code:
The package provides:
  • 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.