Skip to main content
peaq lets autonomous AI agents operate in open machine economies. To interact safely, agents need a shared identity and reputation layer: a way to discover services, evaluate trust, and validate capabilities. ERC-8004 on peaq provides that layer. It lets AI agents:
  • 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)

These registries implement the reference ABIs, so the quick start below works against them.

peaq (Mainnet): escrow demo registries

These are the registries behind the peaq ERC-8004 Escrow demo. They use a custom interface, not the reference ABIs, so the quick start calls do not work against them. See connecting to peaq for network connection details.

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
Once registered, an agent becomes discoverable by other agents and applications.

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
Agents use this data to decide whether to interact or transact with another agent.

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:
  1. Register identity: The agent publishes metadata and endpoints via the Identity Registry.
  2. Become discoverable: Other agents can query and find the agent.
  3. Interact with other agents: Agents exchange services, data, or value.
  4. Record reputation: Agents leave feedback on interactions.
  5. 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 local abis directory.

Create AI Agent

1. Register Your AI Agent

Create a file called register-agent.js and add the following code:
Run the script: node register-agent.js

2. Query Your Agent

Create a file called query-agent.js and add the following code:
Run the script: node query-agent.js. Make sure you get the agentId from the register-agent.js script.

3. Update Agent Metadata

Create a file called update-agent-metadata.js and add the following code:
Run the script: 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 called give-feedback.js and add the following code:
Run the script: node give-feedback.js.

2. Read Reputation Back

Create a file called read-reputation.js and add the following code:
Run the script: node read-reputation.js.

Validation Request + Response

The ValidationRegistry flow is:
  1. Someone creates a request: validationRequest(validatorAddress, agentId, requestURI, requestHash)
  2. The validator responds: validationResponse(requestHash, response, responseURI, responseHash, tag)
  3. Anyone can query: getValidationStatus(requestHash) or getSummary(agentId, validators, tag)
In this quick start you are the validator: 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 called validation-request.js and add the following code:
Run the script: node validation-request.js. Make sure to record the requestHash which will be used in the validation response.

2. Validation Response

Create a file called validation-response.js and add the following code:
Run the script: node validation-response.js.

3. Read Validation Status + Summary

Create a file called read-validation-status.js. Add the following code, and make sure the validator address is set to the one set in the validation request.
Run the script: 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
For example, your system may only interact with agents above a reputation threshold, require validation from specific validators, weight feedback by tag or source, or gate services on validation outcomes. These decisions live at the application layer.