Skip to main content

Crate erc8004

Crate erc8004 

Source
Expand description

§ERC-8004: Trustless Agents Rust SDK

A type-safe, ergonomic Rust SDK for interacting with ERC-8004 on-chain registries.

ERC-8004 enables discovery, reputation, and validation for AI agents across organizational boundaries without pre-existing trust.

§Quick Start

use alloy::providers::ProviderBuilder;
use erc8004::{Erc8004, Network};

// 1. Create an alloy provider (any transport works: HTTP, WS, IPC)
let provider = ProviderBuilder::new()
    .connect_http("https://eth.llamarpc.com".parse()?);

// 2. Wrap it with the ERC-8004 client
let client = Erc8004::new(provider)
    .with_network(Network::EthereumMainnet);

// 3. Interact with the registries
let version = client.identity()?.get_version().await?;
println!("Contract version: {version}");

§Architecture

The SDK is designed around the alloy provider abstraction:

  • Erc8004 — The top-level client, generic over P: Provider. Accepts any alloy provider the user has already configured.
  • Identity — Identity Registry (ERC-721) operations: register agents, manage URIs, wallets, and metadata.
  • Reputation — Reputation Registry operations: submit/revoke feedback, read summaries.
  • Validation — Validation Registry operations: request/respond to validation, query status.
  • Network — Pre-configured network addresses for known deployments.
  • types — Off-chain JSON types (registration files, feedback, etc.).

Re-exports§

pub use client::Erc8004;
pub use error::Error;
pub use error::Result;
pub use networks::Network;

Modules§

client
The top-level Erc8004 client for interacting with ERC-8004 registries.
contracts
Contract bindings generated via inline Solidity interfaces.
error
Typed error definitions for the ERC-8004 SDK.
identity
Identity Registry operations.
networks
Pre-configured network definitions with known contract addresses.
reputation
Reputation Registry operations.
types
Core domain types for the ERC-8004 SDK.
validation
Validation Registry operations.