Skip to main content

x402 Facilitator

A Facilitator is the infrastructure layer that sits between resource servers and blockchain networks, handling the complexity of verifying payment signatures and executing on-chain settlements. Paratro provides a production-grade Facilitator fully compatible with the x402 protocol.

Why Use a Facilitator

Building direct blockchain integrations for every payment is complex, error-prone, and expensive to maintain. A facilitator abstracts this away:
  • Multi-chain settlement — verify and settle payments across EVM chains and Solana through a single API
  • Scheme-agnostic — handles ERC-3009, Permit2, and SPL Token transfers without your server needing to know the details
  • Replay protection — built-in nonce tracking and idempotency to prevent double-settlement
  • Gas management — automated gas station accounts handle transaction fees, so your server never touches private keys
  • MPC security — settlement transactions are signed using threshold MPC, eliminating single-key risks

How It Works

The following diagram shows the complete payment flow — from the initial request through verification, MPC signing, and on-chain settlement:
1

Client requests a paid resource

The client calls a protected API endpoint. The server responds with HTTP 402 Payment Required, including payment requirements (amount, token, network, recipient).
2

Client creates payment authorization

The client constructs and signs a payment authorization (ERC-3009 transferWithAuthorization or Permit2 signature) and re-sends the request with the signed payload in the X-PAYMENT header.
3

Server verifies via Facilitator

The resource server forwards the payment payload to the Facilitator’s /verify endpoint. The Facilitator validates the signature, checks amounts, time windows, and nonce uniqueness — all off-chain, no gas consumed.
4

Server fulfills the request

After successful verification, the server performs the requested work (API call, AI inference, data access, etc.).
5

Server settles via Facilitator

The server calls /settle with the same payment payload. The Facilitator locks the authorization atomically, dispatches it to the MPC Engine for threshold signing (no single private key), then submits the signed transaction to the blockchain.
6

Funds arrive on-chain

The blockchain confirms the transaction. USDC is transferred from the payer to the merchant’s registered wallet address. The Facilitator returns the transaction hash and the server responds to the client with the resource and a payment receipt.

Facilitator Endpoints

All endpoints require JWT authentication. See Authentication for details.
EndpointMethodDescription
/x402/verifyPOSTValidate a signed payment payload off-chain
/x402/settlePOSTExecute on-chain settlement for a verified payment
/x402/settle/:tx_idGETQuery settlement transaction status

Protocol Compatibility

Paratro’s Facilitator supports both V1 and V2 x402 payload formats:
VersionFormatDescription
V1paymentPayload + paymentRequirements (separate fields)Original x402 format
V2paymentPayload.accepted (embedded requirements)Current SDK format with CAIP-2 network identifiers
Set x402Version to 1 or 2 in the request body.

Supported Payment Schemes

SchemeToken SupportChainsDescription
ERC-3009USDCAll EVMNative transferWithAuthorization — no approval step needed
Permit2 (exact)Any ERC-20All EVMUniswap Permit2 for exact amount transfers
Permit2 (upto)Any ERC-20BasePermit2 with flexible settlement amount up to authorized max
SPL TokenUSDCSolanaSolana TransferChecked instruction
The payload type is auto-detected from field names, or explicitly set via accepted.extra.assetTransferMethod.

Verification Flow

When you call /x402/verify, the Facilitator performs these checks:
  1. Resolves the network identifier to a supported chain configuration
  2. Identifies the payload type (ERC-3009, Permit2, or Solana)
  3. Verifies the asset address matches the chain’s USDC contract
  4. Validates the recipient address belongs to a registered merchant account
  5. Checks the time window (validAfter <= now <= validBefore - buffer)
  6. Recovers the signer from the EIP-712 signature via ecrecover
  7. Confirms the recovered signer matches the declared from address
  8. Verifies the authorized amount meets the required minimum
All checks are performed off-chain — no gas is consumed during verification.

Settlement Flow

When you call /x402/settle, the Facilitator:
  1. Re-verifies the signature (same checks as verify)
  2. Atomically locks the authorization to prevent double-settlement
  3. Locates a gas station account to fund the transaction
  4. Encodes the settlement calldata for the appropriate contract method
  5. Dispatches the transaction to the MPC engine for threshold signing
  6. Broadcasts the signed transaction to the blockchain
  7. Returns the on-chain transaction hash and settlement status
For upto scheme, settlement uses the x402UptoPermit2Proxy contract, which accepts a separate amount parameter allowing the merchant to settle less than the maximum authorized amount.

Quick Integration

Any application built with @coinbase/x402 can point to Paratro’s Facilitator:
import { createPaywallMiddleware } from "@coinbase/x402";

const paywall = createPaywallMiddleware({
  facilitatorUrl: "https://api.paratro.com/api/v1",
  // ... other config
});
The verify and settle request/response formats are fully compatible with the x402 specification.

Authentication

Learn how to authenticate with the Facilitator API using JWT tokens.

Supported Networks

See all supported chains, tokens, and contract addresses.

Pricing

View pricing tiers and settlement fee structure.

API Reference

Full API documentation with request/response examples.