L402

HTTP 402 with Lightning Network invoice-based settlement. Sub-cent, sub-second payments.

Macaroon

Overview

L402 (originally "LSAT") pairs the HTTP 402 status code with a Lightning Network invoice. Agents pay the invoice, present the preimage alongside a macaroon (an authenticated token), and the server unlocks the response.

Custena hosts the Lightning node, mints macaroons for your service, and handles invoice generation and preimage verification.

Flow

GET /tools/search HTTP/1.1
Host: seller.example.com
HTTP/1.1 402 Payment Required
WWW-Authenticate: L402 macaroon="AGIAJEem...", invoice="lnbc1p3..."

Agent pays the Lightning invoice, then replays with both:

GET /tools/search HTTP/1.1
Host: seller.example.com
Authorization: L402 AGIAJEem...:preimage_hex

When to use it

  • Very small payments (sub-cent viable)
  • Agents with Lightning-native balances
  • Latency-sensitive tools — invoices settle in under a second

Settlement

  • Custena's hosted Lightning node (Phase 1 — CASP license required for custody in EU, coming Phase 2)
  • Non-custodial path via BOLT12 offers is on the roadmap