Xrpl.X402.AspNetCore
1.0.0
dotnet add package Xrpl.X402.AspNetCore --version 1.0.0
NuGet\Install-Package Xrpl.X402.AspNetCore -Version 1.0.0
<PackageReference Include="Xrpl.X402.AspNetCore" Version="1.0.0" />
<PackageVersion Include="Xrpl.X402.AspNetCore" Version="1.0.0" />
<PackageReference Include="Xrpl.X402.AspNetCore" />
paket add Xrpl.X402.AspNetCore --version 1.0.0
#r "nuget: Xrpl.X402.AspNetCore, 1.0.0"
#:package Xrpl.X402.AspNetCore@1.0.0
#addin nuget:?package=Xrpl.X402.AspNetCore&version=1.0.0
#tool nuget:?package=Xrpl.X402.AspNetCore&version=1.0.0
Xrpl.X402.AspNetCore
Server-side of x402 (HTTP-402) agentic payments for the XRP Ledger. Protect an ASP.NET Core endpoint so it requires an XRPL payment (XRP or RLUSD/IOU) before serving โ the t54 "XRPL exact scheme".
Pairs with the client package Xrpl.X402. Builds on the Xrpl SDK.
๐ Full documentation โ end-to-end flow (price โ pay โ receipt) with XRP and RLUSD/IOU examples: x402 Agentic Payments Guide ยท API reference.
What it adds
| Type | Role |
|---|---|
RequirePayment(...) endpoint filter |
Returns 402 + PAYMENT-REQUIRED when no payment is presented; with a valid PAYMENT-SIGNATURE it verifies + settles, sets PAYMENT-RESPONSE, and runs your handler. |
IX402Facilitator |
Abstraction that verifies a signed payment and settles it on-ledger. |
LedgerSettlingFacilitator(IXrplClient) |
Settles locally against your own connected node (SubmitRequestAndWait, waits for tesSUCCESS). |
T54Facilitator(HttpClient, baseUrl) |
Delegates verify + settle to an external t54 facilitator (POST /verify, /settle). Verified live against the t54 testnet facilitator. |
Usage
using Xrpl.X402.AspNetCore;
using Xrpl.X402.Wire;
IXrplClient xrpl = /* your connected IXrplClient */;
IX402Facilitator facilitator = new LedgerSettlingFacilitator(xrpl);
// or: IX402Facilitator facilitator = new T54Facilitator(new HttpClient());
app.MapGet("/paid", () => "premium content")
.RequirePayment(facilitator, ctx => new PaymentRequirement
{
Scheme = "exact",
Network = "xrpl:1",
Asset = "XRP",
PayTo = "rYourMerchantAddress...",
Amount = "1000000", // 1 XRP in drops
MaxTimeoutSeconds = 600,
Extra =
{
["invoiceId"] = JsonSerializer.SerializeToElement("inv-123"),
["sourceTag"] = JsonSerializer.SerializeToElement(804681468) // t54 enforces SourceTag
}
});
Without a PAYMENT-SIGNATURE the endpoint returns 402 + the PAYMENT-REQUIRED challenge. With a valid signature, the facilitator verifies the destination, settles the transaction, sets PAYMENT-RESPONSE, and your handler runs. Implement IX402Facilitator for any other facilitator.
See the Xrpl.X402 README for the full wire format, client usage, security model, and t54 interop notes.
License
Apache-2.0. Part of XrplCSharp.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 103 | 6/24/2026 |