Ask402

x402 vs L402: what is the difference?

Short answer

Both use HTTP status 402 to charge for a request. L402, from Lightning Labs, pays in bitcoin over the Lightning Network and gives the buyer a reusable token called a macaroon. x402 pays in tokens on many blockchains, usually USDC, and each payment is a one-time signed transfer. L402 is older. x402 has broader network and tooling support.

Side by side

x402L402
Developed byCoinbase, now the x402 FoundationLightning Labs
Pays withTokens on many blockchains, usually USDCBitcoin, over the Lightning Network only
Price is sent inPAYMENT-REQUIRED headerWWW-Authenticate: L402 header, with a Lightning invoice
Proof of paymentA signed transfer authorizationThe invoice's preimage, sent with a macaroon
What the buyer ends up withA receipt for one requestA token that can be reused for later requests
Price is inA dollar stablecoin, typicallySatoshis
After a failed paymentAnother 402401 for a bad credential. 402 only for the first challenge

How L402 works

  1. The server replies 402 with WWW-Authenticate: L402 macaroon="...", invoice="...".
  2. The client pays the Lightning invoice. Paying reveals a secret called the preimage.
  3. The client repeats the request with Authorization: L402 <macaroon>:<preimage>.

The macaroon is a token tied to that invoice. The server can check it without looking anything up, and it can carry limits such as an expiry or a number of uses. So one payment can buy a credential that works for many requests.

L402 was earlier known as LSAT, and some servers still send that name.

The practical differences

The money. L402 means holding bitcoin and running or using a Lightning wallet. x402 usually means holding a dollar stablecoin. For pricing an API in dollars, a stablecoin avoids exchange-rate movement between quote and payment.

Pay per request or pay for access. An x402 exact payment covers one request. An L402 macaroon is closer to a paid pass: buy once, use it until it runs out. x402 has other schemes for metered and batched use, but its common case is one payment per call.

Reach. x402 has official SDKs in three languages, many facilitators, and catalogs of services. L402 has a smaller, Bitcoin-focused ecosystem.

They now overlap

x402's repository includes a specification for the exact scheme on Bitcoin Lightning, where the proof of payment is also the invoice preimage. So a Lightning payment can be made inside x402's format. MPP lists Lightning as a payment method too.

Which should I use?

  • Your buyers hold bitcoin and use Lightning: L402 is built for exactly that.
  • You price in dollars and want the widest set of agent wallets: x402.
  • You want a reusable access token as the product: L402's macaroons do this natively.

To tell which one an endpoint speaks, paste it into the 402 checker. It recognizes x402, MPP and L402 replies.

Sources

Facts checked against these sources on . Protocols change, so the official specification wins if it disagrees with this page. Read this page as Markdown.

Who writes this. Ask402 is published by Havok Holdings LLC, which also runs Agent402, one of the x402 services covered here. Agent402 is labelled wherever it appears. Everything else is described from each project’s own documentation, and nobody pays to be listed.