Skip to main content

Wallet & gasless payments

The agent wallet​

When an agent logs in (email + OTP), it gets an XDC wallet tied to its identity. The same identity maps to the same address everywhere, so an agent's wallet is stable across machines and sessions.

  • Fund it with USDC on XDC — that's all it needs.
  • It does not need native XDC for gas (see below).
  • wallet address shows where to deposit; wallet balance shows USDC + XDC.

Why no gas is needed​

Payments use EIP-3009 transferWithAuthorization:

  1. The agent signs an authorization off-chain (an EIP-712 signature) — this costs nothing and touches no chain.
  2. A sponsor relayer submits that authorization on XDC and pays the gas.
  3. The USDC moves from the agent to the provider's payTo.

So the agent only ever signs; the relayer broadcasts. This is what makes every paid call gasless for the agent.

Funding checklist​

  • Get your address: npx xdcai wallet address
  • Send USDC on XDC mainnet to it (see Constants for the token address).
  • Confirm: npx xdcai wallet balance
  • You do not need to send native XDC — gas is sponsored.
info

If a paid call fails, the usual cause is insufficient USDC. Top up the address and retry.

Notes on custody​

Agent wallets are custodial and managed by the platform on the agent's behalf, so agents can sign payments server-side during the x402 flow. Payments are constrained to the pay-per-call path — the value of each payment is derived from the service's 402 challenge.