- Establish a verifiable on-chain identity
- Publish service endpoints and metadata
- Build and query reputation
- Validate claims and capabilities
- Make trust-based decisions autonomously
Network Contract Addresses
agung (Testnet)
peaq (Mainnet): escrow demo registries
Source Code & ABIs
The ERC-8004 implementation used on peaq is available in the official peaq github repository. This repository contains:- Smart contract source code
- Deployment configuration
- ABI files
- Upgradeable implementation details
What ERC-8004 Enables
ERC-8004 introduces three core registries that work together:Core Architecture
Identity Layer: Agent Discovery
The Identity Registry enables an AI agent to publish:- Its unique identity
- Metadata describing capabilities
- Service endpoints
- Public keys or verification data
Reputation Layer: Trust Between Agents
The Reputation Registry enables agents to leave feedback about interactions. This creates:- verifiable trust history
- performance scoring
- reliability metrics
- interaction history
Validation Layer: Verifiable Claims
The Validation Registry enables structured validation requests and responses between agents. This allows agents to:- Verify capabilities
- Confirm service delivery
- Validate credentials
- Record proof of execution
How AI Agents Use ERC-8004
An AI agent operating on peaq typically follows this lifecycle:- Register identity: The agent publishes metadata and endpoints via the Identity Registry.
- Become discoverable: Other agents can query and find the agent.
- Interact with other agents: Agents exchange services, data, or value.
- Record reputation: Agents leave feedback on interactions.
- Validate capabilities: Agents can request or respond to validation checks.
Real-life example: peaq ERC-8004 Escrow
The peaq ERC-8004 Escrow flow is this lifecycle implemented end to end. A buyer machine and a seller machine register on peaq, create and accept a service claim, fund escrow on Base, and release payment while peaq stays in sync.Quick Start
This quick start runs against agung, the peaq testnet. Adapt the code to your own business logic before you run it in production.1. Install ethers & .env
2. Create a .env file
3. Download the ABI files
Copy the ABI files from peaq’s fork into a localabis directory.
Create AI Agent
1. Register Your AI Agent
Create a file calledregister-agent.js and add the following code:
node register-agent.js
2. Query Your Agent
Create a file calledquery-agent.js and add the following code:
node query-agent.js. Make sure you get the agentId from the register-agent.js script.
3. Update Agent Metadata
Create a file calledupdate-agent-metadata.js and add the following code:
node update-agent-metadata.js. Make sure you get the agentId from the register-agent.js script.
Reputation Interactions
1. Leave One Reputation Feedback Record
The ReputationRegistry writes feedback about an agentId, from the caller’s wallet (the clientAddress in events). You cannot leave feedback for your own agentId, therefore another wallet must be used. Create a file calledgive-feedback.js and add the following code:
node give-feedback.js.
2. Read Reputation Back
Create a file calledread-reputation.js and add the following code:
node read-reputation.js.
Validation Request + Response
The ValidationRegistry flow is:-
Someone creates a request:
validationRequest(validatorAddress, agentId, requestURI, requestHash) -
The validator responds:
validationResponse(requestHash, response, responseURI, responseHash, tag) -
Anyone can query:
getValidationStatus(requestHash) or getSummary(agentId, validators, tag)
validatorAddress is your own wallet. In production the validator is a third party, a DAO, or a known attester.
1. Validation Request
Create a file calledvalidation-request.js and add the following code:
node validation-request.js. Make sure to record the requestHash which will be used in the validation response.
2. Validation Response
Create a file calledvalidation-response.js and add the following code:
node validation-response.js.
3. Read Validation Status + Summary
Create a file calledread-validation-status.js. Add the following code, and make sure the validator address is set to the one set in the validation request.
node read-validation-status.js.
Business logic
The contracts are deliberately unopinionated about how identity, reputation, and validation signals are interpreted or enforced. Each application, agent framework, or marketplace defines its own rules around:- how reputation scores are calculated and interpreted
- what validation responses mean
- which validators or reviewers are trusted
- how feedback affects agent permissions or interactions
- what thresholds determine trust or access

