ERC-8004 — Trustless Agents
ERC-8004 defines three on-chain registries for autonomous AI agents: Identity, Reputation, and Validation. Tenzro implements ERC-8004 for Ethereum-family chains and provides native DID-based equivalents for the Tenzro ledger, with deterministic agentId = keccak256(DID).
The Three Registries
IdentityRegistry
Maps agentId (uint256) to an operator address, a DID, and an agent card URI. Anyone can register an agent they control. Operator updates require signature by the current operator.
ReputationRegistry
Stores signed feedback records per target agent. Each feedback is a tuple of (target_agent, score ∈ [-128,127], reason_uri, issuer_sig). Aggregated reputation is computed off-chain and can be verified on-chain.
ValidationRegistry
Coordinates on-chain validation requests. An agent can be challenged to prove a claim (e.g., "I executed task X with result hash Y"). Validators stake TNZO and attest to the outcome.
agentId Derivation
// Deterministic mapping: agentId = keccak256(DID)
tenzro_erc8004DeriveAgentId({ "did": "did:tenzro:machine:abc123..." })
-> {
did: "did:tenzro:machine:abc123...",
agent_id: "0x9f3a8b2c..."
}This makes the agentId stable across chains — the same DID always maps to the same agentId whether registered on Ethereum, Base, or Tenzro ledger.
Calldata Encoding Helpers
Tenzro provides RPC helpers to encode calldata for the standard ERC-8004 registry functions. These can be used to construct transactions for any EVM chain with a deployed registry:
// Register an agent in the IdentityRegistry
tenzro_erc8004EncodeRegister({
did: "did:tenzro:machine:...",
operator: "0x...",
agent_card_uri: "https://example.com/.well-known/agent.json"
})
-> { calldata: "0x...", selector: "0x..." }
// Query an agent
tenzro_erc8004EncodeGetAgent({ did: "did:tenzro:machine:..." })
// Submit reputation feedback
tenzro_erc8004EncodeFeedback({
target_did: "did:tenzro:machine:...",
score: 100, // int8
uri: "ipfs://..."
})
// Request validation
tenzro_erc8004EncodeRequestValidation({
subject_did: "did:tenzro:machine:...",
data_hash: "0x...",
uri: "ipfs://..."
})Native EVM Precompiles
Tenzro implements ERC-8004 as native EVM system contracts on the Tenzro ledger. The precompiles share byte-identical selectors with the Ethereum reference implementation, so the same calldata works against either the native registry or an Ethereum mirror:
0x101a — ERC8004_IDENTITY
registerAgent / getAgent for native Tenzro agent discovery. agentId computed as keccak256(utf8(did_string)), matching Ethereum exactly.
0x101b — ERC8004_REPUTATION
submitFeedback / getFeedback / getFeedbackCount for peer-to-peer agent reputation.
0x101c — ERC8004_VALIDATION
requestValidation / submitValidation / getValidation for verifiable agent work attestation.
CLI
The CLI exposes both tenzro erc8004 and tenzro 8004 as aliases for the same subcommand group.
tenzro erc8004 derive-id --did did:tenzro:machine:...
tenzro erc8004 encode-register --did ... --operator 0x... --uri https://...
tenzro erc8004 encode-feedback --target-did ... --score 100 --uri ipfs://...
tenzro erc8004 encode-validation --subject-did ... --data-hash 0x... --uri ipfs://...
# Equivalent short alias
tenzro 8004 derive-id --did did:tenzro:machine:...Relationship to TDIP
TDIP and ERC-8004 are complementary:
- TDIP provides the DID, delegation scope, and verifiable credentials infrastructure native to Tenzro ledger.
- ERC-8004 projects those identities onto EVM chains for interoperability with the broader Ethereum agent ecosystem.
- The Agent Card URI in IdentityRegistry typically points to a Google A2A-compatible agent descriptor.
Ecosystem Integration
The ERC-8004 calldata encoders work with any EVM chain where the registries are deployed — Ethereum mainnet, Base, Arbitrum, Optimism, and more. The Ethereum MCP server exposes eth_register_agent_8004 and eth_lookup_agent_8004 for direct ERC-8004 interactions.