x402 Foundation · XRPL native · Multi-chain gateway

AI Agents Pay for APIs.
XRPL Settles in Seconds.

BitBooth is the production x402 gateway making the XRP Ledger the default settlement rail for AI agents. Native USDC and RLUSD support, sub-cent fees, 3 to 5 second finality. Solana, Base, and XRPL EVM rails included.

x402 payment flow
3-5s
XRPL Finality
2,777+
Tests Passing
98.81%
Code Coverage
4 chains
XRPL · XRPL EVM · Solana · Base

Four steps. One round-trip.

The x402 protocol turns API access into a simple HTTP exchange. No accounts, no API keys, no billing portals.

STEP 01

Request

Agent sends a standard HTTP request to a paid API endpoint.

STEP 02

Challenge

Server responds HTTP 402 with payment requirements: amount, asset, network.

STEP 03

Pay

Agent transfers USDC or RLUSD on XRPL. Settlement confirmed in 3 to 5 seconds for under a cent.

STEP 04

Access

Server verifies the on-chain payment and returns the requested resource.

See the protocol in action

Pick a chain. The demo settles a real testnet payment (XRPL + Solana) with a real on-chain hash. Then watch replay protection reject a duplicate settlement.

SERVER
AGENT

Built on the x402 V2 Specification

Launched by the x402 Foundation (Coinbase + Linux Foundation) on April 2, 2026. Backed by Stripe, Cloudflare, AWS, Google, and Microsoft.

HTTP/1.1 402 Payment Required
{
  "x402Version": 2,
  "accepts": [
    {
      "scheme": "exact",
      "network": "xrpl:0",                // XRPL mainnet
      "maxAmountRequired": "5000",        // 0.005 USDC (6 decimals)
      "resource": "https://api.bitbooth.dev/api/wallet-intel",
      "description": "Wallet Intelligence - risk & activity analysis",
      "mimeType": "application/json",
      "asset": {
        "currency": "USD",
        "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De"  // Circle XRPL USDC
      },
      "payTo": "<server XRPL r-address>",
      "extra": {
        "alsoAccepted": ["RLUSD", "XRP"],
        "name": "USDC",
        "decimals": 6
      }
    }
  ],
  "error": "X-PAYMENT header is required"
}
PAYMENT-SIGNATURE header (Base64-decoded)
{
  "x402Version": 2,
  "scheme": "exact",
  "network": "xrpl:0",
  "payload": {
    "txHash": "E3FE6EA3D48F0C2BA7AE3D5C9A77F4F8FCD9C9F1A2C3B5D7E8F9A0B1C2D3E4F5A",
    "account": "<agent XRPL r-address>",
    "sequence": 8412905
  },
  "resource": "https://api.bitbooth.dev/api/wallet-intel",
  "accepted": {
    "scheme": "exact",
    "network": "xrpl:0",
    "maxAmountRequired": "5000",
    "asset": { "currency": "USD", "issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De" },
    "payTo": "<server XRPL r-address>"
  }
}
PAYMENT-RESPONSE header (Base64-decoded)
{
  "x402Version": 2,
  "scheme": "exact",
  "network": "xrpl:0",
  "success": true,
  "payer": "<agent XRPL r-address>",
  "transaction": "E3FE6EA3D48F0C2BA7AE3D5C9A77F4F8FCD9C9F1A2C3B5D7E8F9A0B1C2D3E4F5A",
  "settlement": {
    "ledgerIndex": 86420915,
    "validated": true,
    "deliveredAmount": { "currency": "USD", "value": "0.005" },
    "feeDrops": "12",
    "closeTime": "3.4s"
  }
}

CAIP-2 Network IDs

Multi-chain by design. XRPL mainnet: xrpl:0 · XRPL EVM Sidechain, Solana, and Base also wired. Agent picks the rail it already holds.

Base64-Encoded Headers

Payment payloads and settlement proofs are transmitted as Base64-encoded JSON in the PAYMENT-SIGNATURE and PAYMENT-RESPONSE headers.

Zod Validation

Every boundary is validated at runtime with Zod schemas. HTTP inputs, adapter responses, config from environment. External APIs lie.

Production-ready from day one

Spec Compliant

Full x402 V2 implementation. CAIP-2 network identifiers, Base64-encoded headers, exact payment scheme. Compatible with any x402 client or server.

Battle Tested

2,777+ tests passing at 98.81% code coverage. Replay protection with sequence tracking on XRPL and nonce tracking on EVM, rate limiting, and idempotent settlement via DynamoDB TTLs.

Open Source

MIT licensed. Native XRPL adapter built on xrpl.js, multi-chain router covering XRPL, XRPL EVM, Solana, and Base. Serverless on AWS Lambda. Fork it, extend it, deploy your own x402 gateway.