Documentation Index
Fetch the complete documentation index at: https://docs.peaq.xyz/llms.txt
Use this file to discover all available pages before exploring further.
This page is the real-life example of the ERC-8004 agent lifecycle described in the introduction.
This flow lets a buyer machine (Unitree) and a seller machine (Drone) register identities on peaq, create and accept a service claim on peaq, fund the claim from Base (USDT locked in a Base escrow), and then release payment on Base while peaq is kept in sync via LayerZero messages.
Actors & Contracts
Actors
| Actor | Role |
|---|
| Unitree (Buyer) | Purchases a service |
| Drone (Seller) | Provides the service |
| peaq Chain | Identity + claim + state tracking |
| Base Chain | Holds USDT escrow and pays seller |
| LayerZero | Transports cross-chain messages |
Key Components
peaq
- Identity / registration —
register(agent-card.json) → creates machine/agent identity (agent_id)
- ClaimRegistry — creates/accepts claims, locks stakes, tracks status
- PaymentReceiver — receives LayerZero messages (
lzReceive) and updates peaq state
- TransactionRegistry — records funding/release events (auditability)
Base
- BaseEscrow — locks USDT, releases USDT to seller, emits cross-chain messages
Phase 1 — Identity registration on peaq
Goal: Both parties become on-chain actors on peaq.
- Unitree → peaq:
register("unitree-agent-card.json")
peaq → Unitree: agent_id
- Drone → peaq:
register("drone-agent-card.json")
peaq → Drone: agent_id
Result: Both buyer and seller have peaq identities and can participate in claims.
Phase 2 — Create & accept claim on peaq
Goal: Create a service purchase intent on peaq and have the seller accept it with stake.
Buyer (Unitree)
- Ensure buyer has USDC on peaq for stake (mint if needed).
- Approve staking:
approve(ClaimRegistry, stake).
- Ensure buyer has USDT on Base (mint if needed).
- Create the claim on peaq:
create_purchase_claim(seller=Drone, service_id, amount, deadline)
peaq → Unitree: claim_id
- Share
claim_id to Drone (off-chain / manual in this diagram).
Seller (Drone)
- Fetch details:
get_claim(claim_id).
- Verify claim + seller address (local checks).
- Ensure seller has USDC on peaq for stake (mint if needed).
- Approve staking:
approve(ClaimRegistry, stake).
- Accept claim:
accept_claim(claim_id)
peaq: locks seller stake
peaq → Drone: status Accepted.
Result: Claim exists and is accepted; both sides can poll status on peaq.
Phase 3 — Cross-chain funding (Base → peaq)
Goal: Lock funds in Base escrow and mark the claim as Funded on peaq via LayerZero.
- Unitree → peaq:
get_claim(claim_id) (to confirm deadline).
- Unitree → Base:
approve(BaseEscrow, USDT amount).
- Unitree → Base:
BaseEscrow.deposit(claim_id, amount, seller, deadline)
BaseEscrow: locks USDT.
- Base → LayerZero: sends cross-chain “funded” message.
- LayerZero → peaq: delivers to PaymentReceiver.
- peaq.PaymentReceiver:
lzReceive()
- updates TransactionRegistry
- updates claim status → Funded.
Result: Funds are escrowed on Base; peaq reflects “Funded”.
Phase 4 — Release payment on Base + finalize on peaq
Goal: Seller performs the service off-chain; buyer releases escrowed payment; peaq finalizes status and returns stakes.
- Drone: Performs the real-world service (off-chain).
- Unitree → Base:
BaseEscrow.release(claim_id)
BaseEscrow: transfers USDT to Drone
Base → Drone: USDT received.
- Base → LayerZero: sends “completed” message.
- LayerZero → peaq: delivers completion to PaymentReceiver.
- peaq.PaymentReceiver:
- updates TransactionRegistry
- updates claim status → Completed
- returns stakes to buyer & seller.
Result: Payment settled on Base; peaq records completion and settles stakes.
State machine (peaq claim status)
Created → Accepted → Funded → Completed
What to poll / verify
- Buyer & Seller poll on peaq:
get_claim(claim_id) to read status + deadline.
- Funding truth lives on Base: USDT is locked/released by BaseEscrow.
- peaq is the coordination ledger: identity, claim lifecycle, audit trail, stake settlement.
- LayerZero is the sync bridge: delivers funding + completion events to peaq.
Outcome
A single claim ties together:
- Identity + staking + lifecycle on peaq
- USDT custody + payout on Base
- Cross-chain state synchronization via LayerZero
Transaction is complete when Base pays out and peaq marks Completed and returns stakes.
Contract addresses
peaq
| Contract | Address |
|---|
| Identity Registry | 0x2154317da929098A033ac1ef869d6A8bB771A0e3 |
| Claim Registry | 0x48E33cF40D427004313760F1E514A7488e8DF0Cc |
| Transaction Registry | 0xe2C58c1A0d18E87F0cD0f658E2f2806c3458C374 |
| Mock USDC | 0x0Ad7E419358a462649d2D53b5C2B25cDf85Ca009 |
LayerZero (peaq)
| Contract | Address |
|---|
| Payment Receiver | 0x49850c56cf8AAF27Ee20f78753D6A4f7C73EBB81 |
| peaq LZ Endpoint | 0x6F475642a6e85809B1c36Fa62763669b1b48DD5B |
Base
| Contract | Address |
|---|
| Base Escrow | 0x76C73B6a1A145b9D578c474efeBA83191dF5DCC3 |
| Base USDT | 0x280BEeeD2EAb5F661d664C26B2A808cEdf70be2d |
| Base LZ Endpoint | 0x1a44076050125825900e736c501f859c50fE728c |