Get the FREE Ultimate OpenClaw Setup Guide →

erc-8004

npx machina-cli add skill tenequm/claude-plugins/erc-8004 --openclaw
Files (1)
SKILL.md
10.7 KB

ERC-8004: Trustless Agents

ERC-8004 is a Draft EIP for discovering, choosing, and interacting with AI agents across organizational boundaries without pre-existing trust. It defines three on-chain registries deployed as per-chain singletons on any EVM chain.

Authors: Marco De Rossi (MetaMask), Davide Crapis (EF), Jordan Ellis (Google), Erik Reppel (Coinbase)

Full spec: references/spec.md

When to Use This Skill

  • Registering AI agents on-chain (ERC-721 identity)
  • Building or querying agent reputation/feedback systems
  • Searching and discovering agents by capabilities, trust models, or endpoints
  • Working with the Agent0 TypeScript SDK (agent0-sdk)
  • Implementing ERC-8004 smart contract integrations
  • Setting up agent wallets, MCP/A2A endpoints, or OASF taxonomies

Core Architecture

Three lightweight registries, each deployed as a UUPS-upgradeable singleton:

RegistryPurposeContract
IdentityERC-721 NFTs for agent identities + registration filesIdentityRegistryUpgradeable
ReputationSigned fixed-point feedback signals + off-chain detail filesReputationRegistryUpgradeable
ValidationThird-party validator attestations (stake, zkML, TEE)ValidationRegistryUpgradeable

Agent identity = agentRegistry (string eip155:{chainId}:{contractAddress}) + agentId (ERC-721 tokenId).

Each agent's agentURI points to a JSON registration file (IPFS or HTTPS) advertising name, description, endpoints (MCP, A2A, ENS, DID, wallet), OASF skills/domains, trust models, and x402 support.

See: references/contracts.md for full contract interfaces and addresses.

Quick Start with Agent0 SDK (TypeScript)

npm install agent0-sdk

Register an Agent

import { SDK } from 'agent0-sdk';

const sdk = new SDK({
  chainId: 84532,  // Base Sepolia
  rpcUrl: process.env.RPC_URL,
  privateKey: process.env.PRIVATE_KEY,
  ipfs: 'pinata',
  pinataJwt: process.env.PINATA_JWT,
});

const agent = sdk.createAgent(
  'MyAgent',
  'An AI agent that analyzes crypto markets',
  'https://example.com/agent-image.png'
);

// Configure endpoints and capabilities
await agent.setMCP('https://mcp.example.com', '2025-06-18', true);  // auto-fetches tools
await agent.setA2A('https://example.com/.well-known/agent-card.json', '0.3.0', true);
agent.setENS('myagent.eth');
agent.setActive(true);
agent.setX402Support(true);
agent.setTrust(true, false, false);  // reputation only

// Add OASF taxonomy
agent.addSkill('natural_language_processing/natural_language_generation/summarization', true);
agent.addDomain('finance_and_business/investment_services', true);

// Register on-chain (mints NFT + uploads to IPFS)
const tx = await agent.registerIPFS();
const { result } = await tx.waitConfirmed();
console.log(`Registered: ${result.agentId}`);  // e.g. "84532:42"

Search for Agents

const sdk = new SDK({ chainId: 84532, rpcUrl: process.env.RPC_URL });

// Search by capabilities
const agents = await sdk.searchAgents({
  hasMCP: true,
  active: true,
  x402support: true,
  mcpTools: ['financial_analyzer'],
  supportedTrust: ['reputation'],
});

// Get a specific agent
const agent = await sdk.getAgent('84532:42');

// Semantic search
const results = await sdk.searchAgents(
  { keyword: 'crypto market analysis' },
  { sort: ['semanticScore:desc'] }
);

Give Feedback

// Prepare optional off-chain feedback file
const feedbackFile = await sdk.prepareFeedbackFile({
  text: 'Accurate market analysis',
  capability: 'tools',
  name: 'financial_analyzer',
  proofOfPayment: { txHash: '0x...', chainId: '8453', fromAddress: '0x...', toAddress: '0x...' },
});

// Submit feedback (value=85 out of 100)
const tx = await sdk.giveFeedback('84532:42', 85, 'starred', '', '', feedbackFile);
await tx.waitConfirmed();

// Read reputation summary
const summary = await sdk.getReputationSummary('84532:42');
console.log(`Average: ${summary.averageValue}, Count: ${summary.count}`);

See: references/sdk-typescript.md for full SDK API reference.

Registration File Format

Every agent's agentURI resolves to this JSON structure:

{
  "type": "https://eips.ethereum.org/EIPS/eip-8004#registration-v1",
  "name": "MyAgent",
  "description": "What it does, pricing, interaction methods",
  "image": "https://example.com/agent.png",
  "services": [
    { "name": "MCP", "endpoint": "https://mcp.example.com", "version": "2025-06-18", "mcpTools": ["tool1"] },
    { "name": "A2A", "endpoint": "https://example.com/.well-known/agent-card.json", "version": "0.3.0" },
    { "name": "OASF", "endpoint": "https://github.com/agntcy/oasf/", "version": "v0.8.0",
      "skills": ["natural_language_processing/summarization"],
      "domains": ["finance_and_business/investment_services"] },
    { "name": "ENS", "endpoint": "myagent.eth", "version": "v1" },
    { "name": "agentWallet", "endpoint": "eip155:8453:0x..." }
  ],
  "registrations": [
    { "agentId": 42, "agentRegistry": "eip155:84532:0x8004A818BFB912233c491871b3d84c89A494BD9e" }
  ],
  "supportedTrust": ["reputation", "crypto-economic", "tee-attestation"],
  "active": true,
  "x402Support": true
}

The registrations field creates a bidirectional cryptographic link: the NFT points to this file, and this file points back to the NFT. This enables endpoint domain verification via /.well-known/agent-registration.json.

See: references/registration.md for best practices (Four Golden Rules) and complete field reference.

Contract Addresses

All registries deploy to deterministic vanity addresses via CREATE2 (SAFE Singleton Factory):

Mainnet (Ethereum, Base, Polygon, Arbitrum, Optimism, etc.)

RegistryAddress
Identity0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
Reputation0x8004BAa17C55a88189AE136b182e5fdA19dE9b63
Validation0x8004Cb1BF31DAf7788923b405b754f57acEB4272

Testnet (Sepolia, Base Sepolia, etc.)

RegistryAddress
Identity0x8004A818BFB912233c491871b3d84c89A494BD9e
Reputation0x8004B663056A597Dffe9eCcC1965A193B7388713
Validation0x8004Cb1BF31DAf7788923b405b754f57acEB4272

Same proxy addresses on: Ethereum, Base, Arbitrum, Avalanche, Celo, Gnosis, Linea, Mantle, MegaETH, Optimism, Polygon, Scroll, Taiko, Monad, BSC + testnets.

Reputation System

Feedback uses signed fixed-point numbers: value (int128) + valueDecimals (uint8, 0-18).

tag1MeasuresExamplevaluevalueDecimals
starredQuality 0-10087/100870
reachableEndpoint up (binary)true10
uptimeUptime %99.77%99772
successRateSuccess %89%890
responseTimeLatency ms560ms5600

Anti-Sybil: getSummary() requires a non-empty clientAddresses array (caller must supply trusted reviewer list). Self-feedback is rejected (agent owner/operators cannot submit feedback on their own agent).

See: references/reputation.md for full feedback system, off-chain file format, and aggregation details.

OASF Taxonomy (v0.8.0)

Open Agentic Schema Framework provides standardized skills (136) and domains (204) for agent classification.

Top-level skill categories: natural_language_processing, images_computer_vision, audio, analytical_skills, multi_modal, agent_orchestration, advanced_reasoning_planning, data_engineering, security_privacy, evaluation_monitoring, devops_mlops, governance_compliance, tool_interaction, retrieval_augmented_generation, tabular_text

Top-level domain categories: technology, finance_and_business, healthcare, legal, education, life_science, agriculture, energy, environmental_science, government, manufacturing, transportation, and more.

Use slash-separated paths: agent.addSkill('natural_language_processing/natural_language_generation/summarization', true).

Key Concepts

TermMeaning
agentRegistryeip155:{chainId}:{contractAddress} - globally unique registry identifier
agentIdERC-721 tokenId - numeric on-chain identifier (format in SDK: "chainId:tokenId")
agentURIURI (IPFS/HTTPS) pointing to agent registration file
agentWalletReserved on-chain metadata key for verified payment address (EIP-712/ERC-1271)
feedbackIndex1-indexed counter of feedback a clientAddress has given to an agentId
supportedTrustArray: "reputation", "crypto-economic", "tee-attestation"
x402SupportBoolean flag for Coinbase x402 HTTP payment protocol support
OASFOpen Agentic Schema Framework - standardized agent skills/domains taxonomy
MCPModel Context Protocol - tools, prompts, resources, completions
A2AAgent2Agent - authentication, skills via AgentCards, task orchestration

Reference Index

ReferenceContent
spec.mdComplete ERC-8004 specification (EIP text)
contracts.mdSmart contract interfaces, storage layout, deployment
sdk-typescript.mdAgent0 TypeScript SDK full API
registration.mdRegistration file format, Four Golden Rules, domain verification
reputation.mdFeedback system, off-chain files, value encoding, aggregation
search-discovery.mdAgent search, subgraph queries, multi-chain discovery
oasf-taxonomy.mdComplete OASF v0.8.0 taxonomy: all 136 skills and 204 domains with slugs

Official Resources

Source

git clone https://github.com/tenequm/claude-plugins/blob/main/erc-8004/SKILL.mdView on GitHub

Overview

ERC-8004 defines three on-chain registries on EVM chains to discover, register, and validate AI agents without pre-existing trust. It provides Identity (ERC-721 identities), Reputation, and Validation registries, with agent identity represented as an NFT and a JSON registration file hosted off-chain. The standard integrates with the Agent0 SDK for streamlined registration, search, and management of agent endpoints, trust models, and capabilities.

How This Skill Works

The system runs three UUPS-upgradeable registries per chain: Identity for agent identities (ERC-721) and registration files, Reputation for signed feedback and off-chain details, and Validation for third-party attestations. An agent identity is composed of agentRegistry (eip155:{chainId}:{contractAddress}) and agentId (ERC-721 tokenId), with agentURI pointing to a JSON file describing name, endpoints, OASF skills, and trust data. On-chain minting of identities and registrations enables cross-organizational discovery and interaction via the registries and the Agent0 SDK.

When to Use It

  • Registering AI agents on-chain (ERC-721 identity).
  • Building or querying agent reputation and feedback systems.
  • Searching and discovering agents by capabilities, trust models, or endpoints.
  • Integrating with the Agent0 SDK for TypeScript apps.
  • Implementing ERC-8004 integrations and deploying identity/reputation/validation flows.

Quick Start

  1. Step 1: npm install agent0-sdk
  2. Step 2: Create an SDK instance with chainId, rpcUrl, privateKey, and IPFS settings
  3. Step 3: Create an agent, configure endpoints and capabilities, then call registerIPFS()

Best Practices

  • Host agentURI registration files reliably (IPFS/HTTPS) and pin important data.
  • Use the per-chain singleton registries with proper access control and upgrade paths (UUPS).
  • Validate reputation signals with cryptographic signatures and monitor off-chain details.
  • Model agent identity as NFT (ERC-721) and maintain a stable agentURI for updates.
  • Test end-to-end workflows on a testnet (e.g., Sepolia) before mainnet deployment.

Example Use Cases

  • Create a cross-organization marketplace of AI agents with on-chain identities and reputations.
  • Register a crypto market analysis agent on-chain and publish its registration file to IPFS.
  • Discover agents by capabilities, trust models, or endpoints across departments.
  • Use the Agent0 SDK to register, configure MCP/A2A endpoints, and query agents on-chain.
  • Integrate ERC-8004 in a dApp to manage agent onboarding, discovery, and trust workflows.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers