Accept HTTP 402 payments over the Lightning Network. Register a wallet, get a merchant ID — your server handles the rest.
Lightning requires invoices to exist before payment. This facilitator bridges that gap transparently within the x402 protocol.
HTTP request with no payment — the middleware intercepts it.
The resource server calls POST /invoice — the facilitator looks up the NWC secret from Redis and creates the invoice on demand.
Response includes the BOLT11 invoice and paymentHash in PaymentRequirements.extra.
Any Lightning wallet pays the invoice. The payment preimage serves as cryptographic proof.
POST /verify checks sha256(preimage) == paymentHash — instant, no network call. POST /settle confirms via NWC.
Payment confirmed. The protected content is served.
Standard x402 facilitator interface, extended with Lightning-specific endpoints for invoice management.
merchantId. Credentials stay server-side.sha256(preimage) == paymentHash — instant cryptographic verification, no network call.settled_at via NWC lookup_invoice.A minimal surface area — no accounts, no API keys, no complex configuration.
Works with any NWC-compatible wallet. Grant make_invoice and lookup_invoice only — the facilitator can never move funds.
Your NWC string is stored in Redis behind an opaque UUID. Clients only ever see the merchantId — never your credentials.
Merchant registry and invoice store backed by persistent Redis. Invoices self-expire via TTL — no cron jobs, no cleanup logic.
One facilitator, any number of merchants. Each wallet registers independently and receives an isolated identity.
The verify step is pure cryptography — no Lightning node call. Settlement confirms via NWC only after verification passes.
Built on the open x402 spec. Compatible with any x402 client or resource server — not locked to this facilitator.
Register your Lightning wallet and add one middleware call to your server.
Hit /demo/resource — it returns a real HTTP 402 with a BOLT11 invoice.
Pay it with any Lightning wallet to receive the resource.