x402 vs L402, and what Lightning got right first

RoundhouseReviewed .md
In short

L402 is a Lightning Network scheme that uses HTTP 402 with macaroon credentials and Lightning invoices. x402 uses 402 with stablecoin authorisations settled on public chains. L402 is cheaper and faster per payment but requires channel liquidity and a Bitcoin-denominated price, which is why stablecoin schemes took the agent market.

Contents
  1. What is L402?
  2. What did L402 get right?
  3. What did it get wrong for this buyer?
  4. Does privacy favour L402?
  5. Could the two converge?
  6. Frequently asked questions
  7. Where to check this yourself

What is L402?#

L402 pairs HTTP 402 with the Lightning Network. A server answers 402 with a Lightning invoice and a macaroon, a bearer credential that can carry caveats. The client pays the invoice, presents the preimage as proof alongside the macaroon, and the server honours it.

It predates x402 by years and it works. The question worth asking is not which is better in the abstract but which parts of each design were forced by the settlement layer underneath.

L402x402
SettlementLightning channelsOn-chain stablecoin transfer
DenominationBitcoin, in satoshisDollars, in stablecoin units
Cost per paymentEffectively zeroGas, cents or less on a cheap chain
LatencySub-secondA block, seconds
Buyer prerequisiteA funded channel with routable liquidityA stablecoin balance
CredentialA macaroon, reusable with caveatsNone, each payment stands alone
Public recordNone, payments are privateEvery settlement is public

What did L402 get right?#

Two things x402 does less well.

Payment cost. A Lightning payment costs effectively nothing. x402 pays gas on every settlement, which is small on a cheap chain and is not zero. For genuinely tiny amounts, a millionth of a dollar, Lightning is the only one of the two that makes arithmetic sense.

The reusable credential. A macaroon with caveats is a capability, not a receipt. It can encode a quota, an expiry and a scope, so a buyer can pay once and make many calls under one credential. x402's model is one payment per request, and sellers wanting the same effect have to build it themselves by minting a key after payment.

What did it get wrong for this buyer?#

Two things, and both are about the buyer rather than the technology.

Bitcoin is not a unit of account. A price in satoshis is a price that moves. A seller has to reprice continuously, a buyer cannot budget, and an invoice quoted now is worth something different when it is paid. Dollar-denominated stablecoins removed this, and it is most of why agent commerce settled on them.

Channel liquidity is operational work. To pay over Lightning, a buyer needs a channel with routable capacity in the right direction. That is a thing to set up, fund, rebalance and monitor. An agent that needs to pay a stranger in the next two seconds, having never transacted before, cannot do any of it.

Note

This is the pattern worth taking from the comparison. L402 is better at the payment and worse at the first payment. A protocol serving buyers with ongoing relationships optimises the former; one serving buyers who arrived a moment ago has to optimise the latter.

Does privacy favour L402?#

Yes, and it is a real trade rather than a point against x402.

Lightning payments are not public. Nobody can see what you bought, from whom or how often. x402 settlements are on a public chain, so a buyer's entire payment history is visible to anyone who looks, forever.

For a buyer that is a cost. For everyone else it is the feature that makes the ecosystem legible: it is why an index of settlements is possible at all, why a buyer can screen a seller before paying it, and why claims about activity can be checked rather than believed. A private payment network is more comfortable for its participants and impossible to audit from outside.

Sellers should know that their revenue is visible. Buyers should know that their spending is.

Could the two converge?#

Partially, and some of it already has.

Stablecoins on Lightning-adjacent systems and dollar-denominated channels address the unit-of-account problem. Deferred and session-based x402 schemes address the per-payment cost, by batching many calls into one settlement, which is the same trick Lightning plays at the channel level.

What does not converge is the public record. A protocol that settles on a public chain can be measured by third parties; one that settles in private channels cannot. That is a design consequence, not a maturity gap.

Frequently asked questions#

Is L402 dead?#

No. It is live in Bitcoin-native infrastructure, particularly around Lightning service providers and paid APIs in that ecosystem. It has far less adoption among AI agents, where dollar pricing and no setup matter more.

Can one server offer both?#

Yes, since both are 402 responses. The bodies differ, so a client has to recognise which it got. Few do both, so in practice you are choosing a buyer population.

Which is faster?#

Lightning, by a clear margin: sub-second against a block confirmation. For an interactive agent call this is noticeable, though x402 sellers commonly serve on verification and settle after, which hides most of it.

Does x402 have anything like macaroons?#

Not in the protocol. The common pattern is to mint an API key after a payment, which Roundhouse does at GET /v0/test/x402. That gives the reusable-credential effect without putting it in the payment standard.

Which should I build on in 2026?#

If your buyers are AI agents, x402, because that is where the clients, the facilitators and the catalogues are. If your buyers are Bitcoin-native infrastructure, L402 is already there and dollar pricing matters less to them.

Where to check this yourself#

The public-record difference is the one you can verify directly. Everything x402 settles is in /transactions and summarised per chain at /stats, with the window each figure covers stated. There is no equivalent view of Lightning activity, which is exactly the trade the two protocols make.

Reading this as an agent?

Every page here has a markdown twin at the same URL plus .md. Same words, no navigation, no markup to strip. And the settlement record this article describes is a live index you can query rather than a claim you have to take on trust.

  • GET https://roundhouseai.io/resources/x402-vs-l402-lightning.mdthis page, as markdown
  • GET https://roundhouseai.io/llms.txtevery surface on roundhouseai.io
  • GET https://api.roundhouseai.io/v0the index: endpoints and schema
  • GET https://api.roundhouseai.io/v0/test/x402$0.01 over x402, and it mints your own key with no account

/docs/api has the limits and the SQL surface. /v0/account, /v0/endpoints and the capability layer answer without a key.

Read next