ERC-8004 On-Chain Agent Identity
ERC-8004 is a token standard on Arc testnet that gives each deployed agent a unique, verifiable on-chain identity. When your agent includes its ERC-8004 identity headers in an x402 request, API providers can:- Grant reputation-based discounts to agents with a strong payment history
- Enforce per-agent rate limits independent of IP address or API key
- Whitelist high-trust agents for access to restricted tiers
- Build trust graphs across multi-agent workflows
8004:<chainId>:<tokenId>. For Arc testnet, that looks like 8004:5042002:1042.
Agents without an ERC-8004 identity can still call x402 endpoints — they are treated as anonymous callers. However, providers may apply stricter rate limits or decline to offer discounts to unidentified agents. Registering an on-chain identity is strongly recommended for production agents.
Required Request Headers
Every authenticated agent request must include three headers. These are sent alongside the standard HTTP request to any x402-protected endpoint:string
required
The agent’s ERC-8004 identity string in
8004:<chainId>:<tokenId> format. Identifies which on-chain agent is making the request.string
required
An EIP-712 signed timestamp that proves the request was authorized by the wallet controlling the agent’s ERC-8004 token. Prevents replay attacks.
string
required
A Circle Nanopayment authorization proof signed by the agent’s Circle Smart Contract Account (SCA) wallet. This is what triggers USDC settlement on Arc testnet.
Getting an Agent Identity and Wallet
Before an agent can sign payment proofs, it needs a tokenId and a Circle SCA wallet. Deploy an agent through the FlareHQ API to provision both:tokenId and the Circle SCA wallet address your agent will use to sign payment proofs. Store the wallet’s private key securely — it is used to generate both the X-Agent-Signature and the X-402-Payment-Proof on every request.
For a complete walkthrough of deploying and configuring agents, see Deploying Agents.
Calling a Marketplace Listing as an Agent
The FlareHQ SDK handles header construction, EIP-712 signing, and Circle Nanopayment proof generation automatically when you pass anagentId:
- Resolve the listing price and
payToaddress from the Marketplace - Sign a Circle Nanopayment authorization using the agent wallet
- Sign the EIP-712 timestamp payload for
X-Agent-Signature - Attach all three required headers and submit the request to
POST /api/x402/pay - Return the upstream API response in
result.data
Batch Execution
When an agent needs to call multiple listings in a single workflow, you can execute them concurrently usingPromise.all. Each call is independently settled — there is no batched payment transaction:
Direct REST Call (Without the SDK)
If you are building an agent runtime outside of Node.js, you can construct the payment headers manually and submit directly to the REST endpoint:X-Agent-Signature (EIP-712 signed current timestamp) and paymentProof (Circle Nanopayment authorization) values. The FlareHQ SDK handles this automatically — use it unless your runtime has a specific constraint.
Summary
All three headers are required for fully authenticated, reputation-tracked agent requests. The FlareHQ SDK assembles and signs all three automatically when
agentId and agentPrivateKey are configured.
