r402-xrpl
XRP Ledger support for the x402 payment protocol, part of the
r402 workspace.
Highlights
- Exact scheme — the buyer signs an XRPL
Paymenttransaction; the facilitator submits the signed blob. The payer pays the network fee (areFeesSponsored: false). - CAIP-2 networks —
xrpl:0(mainnet),xrpl:1(testnet),xrpl:2(devnet). - XRP and RLUSD — native drops or issued-currency decimal values.
price_tagcopiesareFeesSponsored: false(andissuerfor IOU). - Sequence or ticket —
extra.assetTransferMethodselects accountSequenceor a pre-createdTicketSequence. - In-process facilitator — verify and settle against JSON-RPC HTTP
(overridable). Duplicate settle is blocked by
SettlementCachekeyed by transaction hash (TTL floor 120s).supported().signers["xrpl:*"]is empty.
Cargo Features
| Feature | Surface |
|---|---|
client |
Buyer-side Payment signing. |
server |
Server-side PriceTag generation. |
facilitator |
On-chain verify and settle (JSON-RPC). |
telemetry |
tracing instrumentation. |
full |
All of the above. |
Quick Start (server price tag)
use ;
let tag = price_tag;
Documentation
- Crate docs: https://docs.rs/r402-xrpl
- Project README:
../../README.md
License
Dual-licensed under MIT and Apache-2.0.