XRPL x402 Facilitator
The XRPL x402 Facilitator enables x402 payments over XRPL using payer-signed Payment transactions.
The XRPL x402 Facilitator enables x402 payments over the XRP Ledger. It implements the x402 exact scheme using a payer-signed XRPL Payment transaction blob. The public service and documentation are available at xrpl-x402.t54.ai.
This facilitator is part of T54's broader XRPL AI infrastructure. It lets resource servers accept machine payments over XRPL while preserving the payment verification and settlement boundaries expected by the x402 protocol. It also creates a concrete rail for Trustline-governed agent payment workflows when paired with X402 Secure.
Payment Flow
The flow follows the x402 HTTP pattern.
- A buyer client requests a protected resource.
- The resource server returns
402 Payment Requiredwith payment requirements and an invoice identifier. - The buyer builds and signs an XRPL
Paymenttransaction matching the requirements. - The buyer retries with a
PAYMENT-SIGNATUREheader containing the signed transaction payload. - The resource server asks the facilitator to verify the payload.
- The facilitator checks the transaction invariants and invoice binding.
- The facilitator settles by submitting the signed transaction to XRPL.
- The server returns the resource and a
PAYMENT-RESPONSEreference.
XRPL-Specific Design
The signed transaction must match the quoted requirements. For XRP payments, the amount is denominated in drops. For issued tokens such as RLUSD, the payment uses an IOU amount with currency and issuer metadata. The facilitator enforces exact destination and amount matching.
Invoice binding is critical. The invoice identifier can be embedded in XRPL transaction memos or represented through InvoiceID. This prevents a signed transaction from being reused against a different payment requirement and gives later review a clearer link between the quoted resource and the settled payment.
The facilitator also rejects unsupported or risky payment features unless explicitly supported by policy. Examples include path payments, partial payments, and high-fee transactions outside configured bounds.
X402 Secure And Trustline Integration
The XRPL x402 Facilitator can integrate with X402 Secure in enforce mode. In that mode, the facilitator can require X402 Secure evidence, send normalized XRPL payment context to X402 Secure, and block settlement when the Trustline-backed decision is deny or review.
The responsibility boundary is important.
| Component | Responsibility |
|---|---|
| XRPL x402 Facilitator | XRPL payment verification, invoice binding, settlement, facilitator-issued control tokens. |
| X402 Secure | x402 extension semantics, rail-specific evidence binding, and enforcement-ready decision orchestration. |
| Trustline | Evidence assessment, risk decisioning, and receipt records. |
This lets XRPL payments participate in the same Trustline-governed risk model as other agentic payment rails. The facilitator verifies the rail-specific payment; X402 Secure and Trustline determine whether the agent-mediated payment should be accepted under the relevant policy.
Developer Surfaces
The facilitator repository includes Python service code, demo scripts, a browser demo, and a TypeScript package for resource servers and buyer clients. The TypeScript SDK can be used to protect Express routes or implement buyer-side x402 fetch behavior.
npm install x402-xrpl
import express from "express"; import { requirePayment } from "x402-xrpl/express"; const app = express(); app.use( requirePayment({ path: "/ai-news", price: "1000", payToAddress: "r...", network: "xrpl:1", asset: "XRP", facilitatorUrl: "https://xrpl-x402.t54.ai", resource: "demo:ai-news", description: "AI news feed", }), );
The developer experience is still evolving, but the architectural goal is stable: make XRPL a usable rail for agentic machine payments while preserving exact payment verification and Trustline-compatible risk controls.