# Ed4l02 — XRPL x402 Payment Infrastructure > Ed4l02 is an open-source payment infrastructure built on the XRP Ledger (XRPL). > It implements the x402 protocol: any HTTP API endpoint can be monetised with a single line of middleware. > Payments settle on-chain in seconds. No bank, no OAuth, no subscription required. > Designed for AI agents, autonomous systems, and human users alike. ## What is Ed4l02? Ed4l02 is a full-stack payment layer for the machine economy: - **x402 middleware** (`@hliosone/ed4l02-x402`): Express.js middleware that payment-gates any API route. One line of code. - **Facilitator**: A settlement server that verifies XRPL transactions and releases access to protected resources. - **Merchant portal**: Revenue dashboard, transaction history, ISO 20022 / CAMT.053 export, XRP↔RLUSD swap. - **Marketplace**: A public registry of pay-per-use API endpoints, browsable by AI agents and humans. - **Identity layer**: On-chain KYC credentials (XLS-70) issued via Edel-ID, verified without third-party calls. - **VAT-aware payments**: Automatic HT/TVA/TTC breakdown for FR (20%) and CH (8.1%) jurisdictions, stored on-chain. ## How it works 1. A client (human or AI agent) calls a protected API endpoint. 2. The server responds `HTTP 402 Payment Required` with payment details (destination wallet, amount in drops, network). 3. The client signs an XRPL Payment transaction and replays the request with the signed blob as a header. 4. The facilitator verifies the transaction on-chain and settles. The resource is released. This is the x402 protocol — permissionless, cryptographically verifiable, instant finality. ## npm package ``` npm install @hliosone/ed4l02-x402 ``` ### Usage (one line) ```js import { xrpl402Express } from "@hliosone/ed4l02-x402"; app.get("/api/data", xrpl402Express({ facilitatorUrl: "https://facilitator.edel-id.ch", network: "mainnet", asset: "XRP", amount: "1000000", // 1 XRP in drops payTo: "r...", // merchant XRPL address }), handler); ``` ## Live endpoints - Facilitator API: https://facilitator.edel-id.ch - Marketplace: https://ed4l02.vercel.app/marketplace - Merchant portal: https://ed4l02.vercel.app/merchant - User / identity: https://ed4l02.vercel.app/user ## Source code - Package: https://github.com/hliosone/ed4l02-x402 - Platform: https://github.com/hliosone/ed4l02 ## Key concepts for AI agents - **Payment address**: an XRPL classic address (starts with `r`) - **Amount**: expressed in drops (1 XRP = 1,000,000 drops) - **Network**: `testnet` or `mainnet` - **Credential types**: `EDEL_KYC_OVER_18`, `EDEL_TVA_FR`, `EDEL_TVA_CH` (XLS-70 on-chain credentials) - **Settlement**: final when transaction appears in a validated ledger (`tesSUCCESS`) - **No wallet needed server-side**: the facilitator only verifies, never holds funds ## For AI agents: how to pay an x402 endpoint 1. `GET /endpoint` → receive `402` with `X-Payment-Required` header (JSON with `accepts` array) 2. Parse `accepts[0]`: extract `network`, `amount` (drops), `pay_to` (destination address) 3. Sign an XRPL `Payment` transaction: `Account=your_address`, `Destination=pay_to`, `Amount=amount` 4. Encode as `PaymentPayload`: `{ scheme: "xrpl-v1", network, tx_blob, from_address }` 5. Base64-encode the JSON and set header `X-Payment-Signature: ` 6. Replay the original request with that header → receive `200` with resource ## Contact / team Built at Paris Blockchain Week 2026 hackathon. Repository: https://github.com/hliosone/ed4l02