erc8004
Type-safe Rust SDK for the ERC-8004 Trustless Agents standard — on-chain identity, reputation, and validation registries for AI agents.
ERC-8004 enables discovery, reputation, and validation of AI agents across organizational boundaries without pre-existing trust. This SDK provides ergonomic, alloy-native bindings for all three registries, with 30 pre-configured network deployments (CREATE2 deterministic addresses) and full off-chain type support (registration files, service endpoints, feedback).
See Security before using in production.
Quick Start
Query an Agent (Read-Only)
use ;
use ;
let provider = new
.connect_http;
let client = new
.with_network;
// Identity Registry — ERC-721 agent identity
let identity = client.identity?;
let owner = identity.owner_of.await?;
let uri = identity.token_uri.await?;
let wallet = identity.get_agent_wallet.await?;
Register an Agent (Write)
use ;
use ;
let signer: PrivateKeySigner = var?.parse?;
let wallet = from;
let provider = new
.wallet
.connect_http;
let client = new
.with_network;
let agent_id = client.identity?
.register_with_uri
.await?;
Build a Registration File (Offline)
use ;
let mut reg = new;
reg.services.push;
reg.x402_support = true;
let json = reg.to_json?;
Architecture
| Module | Description |
|---|---|
Erc8004 |
Top-level client — generic over P: Provider, builder pattern for network / address configuration |
Identity |
Identity Registry (ERC-721) — register agents, manage URIs, wallets, metadata, EIP-712 signatures |
Reputation |
Reputation Registry — submit / revoke feedback, read aggregated summaries, list clients |
Validation |
Validation Registry — request / respond to validation, query status and summaries |
Network |
30 pre-configured deployments (16 mainnet + 14 testnet) with CREATE2 deterministic addresses |
types |
Off-chain JSON types — RegistrationFile, ServiceEndpoint, Feedback, ReputationSummary |
contracts |
Inline Solidity bindings (sol! macro) — alloy-recommended, preserves full type information |
Supported Networks
Contracts are deployed via CREATE2, so all mainnets share the same addresses and all testnets share the same addresses.
| Network | Type | Chain ID |
|---|---|---|
| Ethereum | mainnet | 1 |
| Base | mainnet | 8453 |
| Polygon | mainnet | 137 |
| Arbitrum One | mainnet | 42161 |
| Celo | mainnet | 42220 |
| Gnosis | mainnet | 100 |
| Scroll | mainnet | 534352 |
| Taiko (Alethia) | mainnet | 167000 |
| Monad | mainnet | 143 |
| BNB Smart Chain | mainnet | 56 |
| Abstract | mainnet | 2741 |
| Avalanche C-Chain | mainnet | 43114 |
| Linea | mainnet | 59144 |
| Mantle | mainnet | 5000 |
| MegaETH | mainnet | 4326 |
| Optimism | mainnet | 10 |
| Ethereum Sepolia | testnet | 11155111 |
| Base Sepolia | testnet | 84532 |
| Polygon Amoy | testnet | 80002 |
| Arbitrum Sepolia | testnet | 421614 |
| Celo Alfajores | testnet | 44787 |
| Scroll Sepolia | testnet | 534351 |
| Monad Testnet | testnet | 10143 |
| BNB Smart Chain Testnet | testnet | 97 |
| Abstract Testnet | testnet | 11124 |
| Avalanche Fuji | testnet | 43113 |
| Linea Sepolia | testnet | 59141 |
| Mantle Sepolia | testnet | 5003 |
| MegaETH Testnet | testnet | 6342 |
| Optimism Sepolia | testnet | 11155420 |
Design
- Zero
async_trait— pure RPITIT, no trait-object overhead - Inline Solidity bindings —
sol!macro preserves struct names, enums, and visibility; no JSON ABI files - Provider-generic — works with any alloy transport (HTTP, WebSocket, IPC) and any signer configuration
- Strict linting —
pedantic+nursery+correctness(deny), seeclippy.toml - Lightweight instances — each
Identity/Reputation/Validationcall creates a zero-alloc contract handle
Examples
| Example | Description |
|---|---|
query_agent |
Read agent identity from Ethereum mainnet |
register_agent |
Register a new agent on Base Sepolia testnet |
reputation_summary |
Query aggregated reputation and feedback entries |
registration_file |
Build and serialize an off-chain registration file |
multi_network |
Query the same registry across multiple chains |
Event Dataset
All on-chain events (identity registrations, reputation updates, etc.) are continuously archived to a public HuggingFace dataset:
qntx/erc8004-events — refreshed every 15 minutes via automated sync.
The dataset covers all 16 mainnet chains and stores raw eth_getLogs output in Parquet format, organized by chain ID:
<chain_id>/
identity.parquet # IdentityRegistry events
reputation.parquet # ReputationRegistry events
cursor.json # Sync cursor (last synced block)
Load with Python
# All identity events on Ethereum mainnet
=
# Load Base reputation events
=
Parquet Schema
| Column | Type | Description |
|---|---|---|
block_number |
uint64 |
Block in which the event was emitted |
tx_hash |
string |
Transaction hash (0x-prefixed) |
log_index |
uint32 |
Log index within the transaction |
address |
string |
Contract address that emitted the event |
topic0 |
string |
Event signature hash |
topic1 |
string |
First indexed parameter (if any) |
topic2 |
string |
Second indexed parameter (if any) |
topic3 |
string |
Third indexed parameter (if any) |
data |
string |
ABI-encoded non-indexed parameters |
Local Sync
You can also run the sync tool locally to build your own copy of the dataset:
# Sync all mainnet chains
# Sync a specific chain
Security
See SECURITY.md for disclaimers, supported versions, and vulnerability reporting.
Acknowledgments
- ERC-8004 Specification — Trustless Agents standard
- erc-8004/erc-8004-contracts — official Solidity contracts
- alloy — Rust Ethereum toolkit
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project shall be dual-licensed as above, without any additional terms or conditions.