Skip to main content
Six commands cover the ERC-8004 lifecycle: register a new agent identity, query its registered payment wallet, fetch metadata by key, read or write reputation. ERC-8004 sits separately from x402, payments are independent, but a registered identity gives counterparties a place to look up an agent’s wallet, attestations, and feedback before transacting with it. All agent commands operate on Polygon mainnet only, regardless of the wallet’s default chain.

How it works

Identity lifecycle
1OperatorCLIpolygon-agent agent register —name …
2IdentityRegistryMints an agentId, emits Registered event
3CounterpartyCLIpolygon-agent agent reputation —agent-id …
4ReputationRegistryCLIReturns score and tag breakdown
5CounterpartyReputationRegistrypolygon-agent agent feedback —value 95 —broadcast
The smart wallet pays gas for register and feedback. Read commands (reputation, reviews, wallet, metadata) do not need broadcast.

Contracts

RegistryAddress
IdentityRegistry0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
ReputationRegistry0x8004BAa17C55a88189AE136b182e5fdA19dE9b63
For the full standard, see ERC-8004 on Polygon.

Commands

agent register

polygon-agent agent register \
  --name "my-agent" \
  --agent-uri https://agent.example.com/card.json \
  --metadata "category=data,version=1.0"
Mints an ERC-721 identity in the IdentityRegistry. After broadcast, retrieve the assigned agentId from the Registered event in the transaction’s Logs tab on Polygonscan.
FlagDefaultPurpose
--walletmainWallet that pays gas
--namenoneAgent name
--agent-uri (or --uri)noneURI pointing to an Agent Card
--metadatanoneKey=value pairs, comma-separated
--broadcastfalseExecute the transaction

agent wallet

polygon-agent agent wallet --agent-id 42
Returns the payment wallet registered for the agent.

agent metadata

polygon-agent agent metadata --agent-id 42 --key category
Reads one metadata value by key.

agent reputation

polygon-agent agent reputation --agent-id 42
polygon-agent agent reputation --agent-id 42 --tag1 reliability
Aggregated reputation score for the agent. Optional --tag1 and --tag2 filter by category.

agent reviews

polygon-agent agent reviews --agent-id 42
polygon-agent agent reviews --agent-id 42 --tag1 quality --include-revoked
Enumerates all feedback entries. --include-revoked shows entries that have been revoked by their authors.

agent feedback

polygon-agent agent feedback \
  --agent-id 42 \
  --value 95 \
  --tag1 reliability \
  --endpoint "https://api.example.com/v1" \
  --broadcast
Submits a feedback score. Useful for counterparties evaluating an agent after a completed interaction. Submitter is the calling smart wallet.
FlagDefaultPurpose
--walletmainWallet that pays gas
--agent-idrequiredTarget agent
--valuerequiredFeedback score
--tag1 / --tag2noneCategory tags
--endpointnoneEndpoint reviewed
--feedback-urinoneURI to off-chain detail
--broadcastfalseExecute the transaction

Worked example

# Register a new agent
polygon-agent agent register \
  --name "data-aggregator" \
  --agent-uri https://example.com/agent.json \
  --metadata "category=data,sla=99.9"
# ⚡ Dry run

polygon-agent agent register \
  --name "data-aggregator" \
  --agent-uri https://example.com/agent.json \
  --broadcast
# Registered: tx 0xabc... → https://polygonscan.com/tx/0xabc...
# Note: open the Logs tab on Polygonscan, find the Registered event,
# and copy agentId (used for all subsequent agent commands).

# Query reputation before transacting
polygon-agent agent reputation --agent-id 142
# Score: 87 (32 reviews)

Implementation

ERC-8004 on Polygon

Standard, contracts, and integration concepts.

CLI overview

Topology and safety model.

Agentic Payments

Conceptual overview of agentic flows on Polygon.

Setup and wallets

Wallet needs gas to register and submit feedback.