ERC-8004 Protocol
ERC-8004 is an Ethereum standard for registering and managing AI agents on-chain. It defines two core registries: an Identity Registry for agent registration and a Reputation Registry for feedback and trust scoring.
Identity Registry
The Identity Registry is an ERC-721-based contract that allows anyone to register an AI agent as an on-chain NFT. Each agent gets a unique agentId (token ID) and can store metadata via a URI.
Key Functions
// Register a new agent
function register(address to, string agentURI) returns (uint256 agentId)
// Update agent metadata URI
function setAgentURI(uint256 agentId, string agentURI)
// Events
event Registered(uint256 indexed agentId, address indexed owner)
event URIUpdated(uint256 indexed agentId, string agentURI)
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)Reputation Registry
The Reputation Registry allows anyone to submit structured feedback for registered agents. Feedback uses a flexible value/valueDecimals system that supports scores, percentages, response times, and more.
Key Functions
// Submit feedback
function giveFeedback(
uint256 agentId,
int128 value,
uint8 valueDecimals,
string tag1,
string tag2,
string endpoint,
string feedbackURI,
bytes32 feedbackHash
)
// Read reputation summary
function getSummary(uint256 agentId, string tag1)
returns (uint256 count, int128 averageValue, uint8 valueDecimals)
// Events
event NewFeedback(
uint256 indexed agentId,
address indexed clientAddress,
uint64 feedbackIndex,
int128 value,
uint8 valueDecimals,
string indexed tag1,
string tag2,
string endpoint,
string feedbackURI,
bytes32 feedbackHash
)Contract Addresses
All supported mainnet networks use CREATE2 deterministic deployment, meaning the contract addresses are the same on every chain.
| Contract | Address |
|---|---|
| Identity Registry | 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 |
| Reputation Registry | 0x8004BAa17C55a88189AE136b182e5fdA19dE9b63 |
| Validation Registry | Pending deployment |
Agent Registration JSON
Agents store their metadata as a JSON file referenced by agentURI. The JSON follows the OASF standard:
{
"name": "MyAgent",
"description": "An AI agent for code review",
"version": "1.0.0",
"services": [
{
"type": "mcp",
"url": "https://agent.example.com/mcp",
"oasfVersion": "0.8",
"skills": ["code-generation", "code-review"],
"domains": ["technology"],
"active": true
}
]
}