Skip to main content
The x402 protocol turns the 402 Payment Required status code into a payment flow: a server returns payment requirements, the client pays on-chain and retries, and the payment itself is the credential. No API keys, no billing accounts. On Canton, x402 uses the exact scheme with the transfer-factory settlement method (a CIP-56 Token Standard transfer). The client signs a TransferFactory_Transfer naming the merchant as receiver but does not submit it; the facilitator relays the signed transfer and pays the traffic fee, and because the merchant holds a standing TransferPreapproval it settles directly to the merchant in one transaction. No escrow, no lock step, no facilitator custody. Canton Coin and any CIP-56 registry token (e.g. USDCx) share this flow, differing only by the instrument (extra.instrumentId).
Source of truth: the normative payload structure and verification rules live in the merged x402 spec, scheme_exact_canton.md. This page is the FTP usage guide.

The flow

The facilitator is the sole submitter: it relays the payer-signed transfer and pays only the sequencer traffic. It signs nothing on the payer’s behalf and never holds custody. The funds move from the payer’s own holdings, and the merchant’s TransferPreapproval is what makes the transfer resolve directly.

The exact scheme

PaymentRequirements

  • amount: integer string of atomic units (1 CC = 10^10 units), so "10000000000" = 1 CC. Compared by value.
  • feePayer: the facilitator party (the relayer). Clients MUST NOT alter it.
  • instrumentId: the token, authoritative over asset (a display symbol). CC is { admin: "<DSO-party>", id: "Amulet" }; a registry token is { admin: "<registrar>", id: "<instrument-id>" }.
  • executeBeforeSeconds: relative deadline (seconds from request time) for the transfer’s absolute executeBefore.
  • memo (optional): a client-stamped tag; not validated by the facilitator.
feePayer, synchronizerId, and instrumentId.admin are deployment values. Get feePayer and synchronizerId from GET /supported; get the DSO party from your Canton Scan API.

The facilitator

A facilitator bridges x402 and the Canton ledger. It relays the payer-signed TransferFactory_Transfer - submitting the transaction, paying the traffic fee, and resolving the transfer’s execution context from the registry as disclosed contracts. It exposes two endpoints the resource server calls:
  • POST /verify - validates the signed transfer against PaymentRequirements (no ledger write)
  • POST /settle - relays the signed transfer and returns the ledger updateId
GET /supported returns its party id, method, and networks:
Because /supported advertises synchronizerId, a 402 extra MAY omit it. transfer-factory runs through the standard CIP-56 :TransferInstruction interface, so there is no custom DAR for merchants to install.

Replay protection

Replay protection is native and on-ledger. The payer-signed transfer names specific input holdings; once it executes those holdings are consumed, so resubmitting the same payload references already-spent holdings and the ledger rejects it. A facilitator MUST relay the signed transfer to settle; it MUST NOT treat a previously observed updateId as settlement, since reading a completed update is replayable and moves no funds.

Error codes

Next steps

Merchant integration

Charge CC or a CIP-56 token on your Express or Next.js API.

Agent integration

Pay x402-gated endpoints from an agent or backend.