Orbit: Machine payments and money
L402 and the Lightning Network
An HTTP 402 authentication scheme from Lightning Labs in which a server returns a Lightning invoice plus a bearer token, and the client proves payment by presenting the token with the invoice preimage.
- Steward
- Lightning Labs (lightninglabs/L402 repository); proposed to the Lightning bLIP process as bLIP-0026, still an open pull request
- Status
- Live (Lightning Labs); bLIP-0026 PR open
- Latest version
- bLIP-0026 draft protocol version 0 (PR head rewrite); Lightning Labs repository text at commit 592203a (2026-03-20) ()
- Primary source
- L402 specification repository (external link)
What it is
is an earlier payment design on Lightning. A client requests a paid resource, and the server answers 402 Payment Required with a WWW-Authenticate: L402 challenge that carries a credential and a Lightning invoice. The client pays the invoice, which reveals the , and then sends Authorization: L402 <credential>:<preimage>. Because the credential commits to the invoice’s payment hash, the server can check the preimage against that hash without a database lookup. Source [1, 2]
The credential is a bearer token, so it can be reused for later requests or handed to another agent or wallet. Lightning Labs’ builder’s guide now describes L402 as built with a focus on agentic commerce. Source [3]
From LSAT to L402
The protocol began as (“Lightning Service Authentication Token”). The repository’s first commit is dated 2020-02-06, and its 2020 README describes LSAT as macaroon-based authentication and paid APIs for Lightning Labs services. A documentation rewrite merged on 2023-04-20 replaced “LSAT” with “L402” throughout the specification. Source [4] Both the repository and bLIP-0026 keep a backwards-compatibility rule: servers and clients should accept LSAT wherever L402 appears. Source [1, 2]
Two specification texts
The original Lightning Labs specification, which is also the repository text today, fixes the credential as a . The challenge reads L402 macaroon="...", invoice="...", and caveats on the macaroon narrow what the token may access (target services, capabilities, and constraints such as expiry). Source [1]
, as rewritten by Olaoluwa Osuntokun on 2026-02-25, makes L402 token-format agnostic. The challenge becomes L402 version="0", token="...", invoice="...", any token that commits to the is allowed, and macaroons become the RECOMMENDED format rather than a requirement. Source [2, 5] The bLIP is pull request #26 in lightning/blips, and it was still open and unmerged on 2026-10-11. Source [5]
Lightning Labs aligned its repository with that rewrite on 2026-03-11, when pull request #19 merged (its commits are dated 2026-03-10). It returned to the macaroon= header format on 2026-03-20, saying the header changes would be proposed again later. Source [4, 5, 6] In short: macaroons are optional in the bLIP-0026 draft (2026-02-25) and required in the Lightning Labs repository text (2026-03-20).
Rail and limits
rides on the Lightning Network, Bitcoin’s payment-channel network, so payments are in bitcoin (sats). Payment must happen over Lightning: when a reviewer on the bLIP thread raised this limit, Osuntokun replied on 2026-03-11 that a card-accepting variant might be possible but does not fit the vision being pursued. Source [5] Neither spec text defines a refund or dispute process; the is the proof of payment. Source [1, 2]
Status
is live as a deployed protocol through Lightning Labs’ Aperture reverse proxy, whose latest release as of 2026-11-14, v0.6.0, came out on 2026-11-05, the first since v0.5.0 of 2026-03-25. Source [7, 8] It adds metered pricing, in which one Lightning payment buys a bundle that later requests draw down through a price server, and invoices minted from a Wavelength wallet, so a seller can run Aperture without its own lnd node. Source [8] The lightninglabs/L402 repository was last pushed on 2026-06-09. Source [4] The bLIP-0026 header reads “Active” with a created date of 2023-06-06, but the pull request that carries it is not merged. Source [2, 5]
How it relates to the eight
Two of the eight, x402 and MPP, now specify Lightning as a payment method without ’s token layer. The x402 exact has an lnbtc binding that reuses the idea of a as proof of payment but carries it in x402’s own payment header with no . Source [9] No x402 SDK implemented that binding as of 2026-10-19. Source [10] The MPP specs repository includes Lightning charge and session method drafts authored by Lightspark, which do not mention L402 or macaroons. Source [11] Neither spec claims descent from L402, so the two are best read as parallel designs rather than one descending from the other. In practice the designs meet in Aperture. Lightning Labs says it has implemented MPP’s beside L402 since v0.5.0, whose release notes already describe one 402 that advertises both challenges. It says v0.6.0 brought the implementation up to the spec: a service configured for both answers an unpaid request with one 402 that carries an L402 challenge and a Payment challenge and either. Source [8, 12] The MPP repositories do not list Aperture, so its MPP support is Lightning Labs’ claim. Source [8]
Status history
- 2020-02-06: first commit of the specification repository (repository created 2020-02-07). Source [4]
- 2023-04-20: documentation rewrite renames LSAT to L402 in the specification. Source [4]
- 2023-06-06: bLIP-0026 “L402: The Lightning HTTP 402 Protocol” created (PR #26 opened 2023-06-07). Source [2, 5]
- 2023-07-05: Aperture
v0.2-betarelease. Source [7] - 2026-02-25: bLIP-0026 rewritten with a token-agnostic
token=parameter andversion="0". Source [2, 5] - 2026-03-11: Lightning Labs repository aligned with the bLIP rewrite and adds an agent-oriented spec (
agent-spec.md), through pull request #19, whose commits are dated 2026-03-10. Source [4, 6] - 2026-03-11: Lightning Labs says development will continue in its standalone L402 repository. Source [5]
- 2026-03-20: repository returns to the
macaroon=header format; agent spec kept. Source [4] - 2026-03-25: Aperture
v0.5.0release, which also serves MPP’s beside L402, by Lightning Labs’ account. Source [7, 12] - 2026-11-05: Aperture
v0.6.0release: metered pricing, Wavelength-backed invoices and, by Lightning Labs’ account, an MPP implementation brought up to the spec. Source [8]
Relations at a glance
| Protocol | Relation | Note |
|---|---|---|
| x402 | Competes with | Both are HTTP 402 payment schemes for APIs and agents. The x402 exact scheme on lnbtc reuses the preimage-as-proof idea without a macaroon; no source claims that x402 descends from L402. |
| Stripe MPP (Machine Payments Protocol) | Competes with | MPP also uses the HTTP 402 challenge pattern, and its specs repository defines Lightning charge and session methods (Lightspark authors) that do not use L402 tokens. |
| Stripe MPP (Machine Payments Protocol) | Compatible with | Lightning Labs' Aperture proxy serves both. By its release notes it has offered MPP's Payment scheme beside L402 since v0.5.0 (2026-03-25), with one 402 that can carry both challenges, and v0.6.0 (2026-11-05) brought that implementation up to the spec. The MPP repositories do not list Aperture. |
Sources
- L402 specification repository (external link)
- bLIP-0026: L402: The Lightning HTTP 402 Protocol (PR head text) (external link)
- L402: Lightning HTTP 402 Protocol (Builder's Guide) (external link)
- lightninglabs/L402 commit history (external link)
- blip-0026: L402 - Lightning HTTP 402 Protocol (pull request #26) (external link)
- docs: align L402 spec with bLIP-0026, add agent and macaroon specs (L402 PR #19) (external link)
- Aperture: L402 reverse proxy (external link)
- Aperture v0.6.0 release notes (external link)
- Scheme: exact on Lightning (lnbtc) (external link)
- x402 docs: SDK features and parity (external link)
- MPP Lightning charge and session method drafts (draft-lightning-charge-00, draft-lightning-session-00) (external link)
- Aperture v0.5.0 release notes (external link)
- bLIP-0026: L402 (pull request #26 head, open and unmerged) (external link)