# x402 vs L402, and what Lightning got right first

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.

Published: 2026-10-14
Last reviewed: 2026-10-14
Publisher: Roundhouse AI Ltd.
Source: https://roundhouseai.io/resources/x402-vs-l402-lightning

---

## 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.

| | L402 | x402 |
| --- | --- | --- |
| Settlement | Lightning channels | On-chain stablecoin transfer |
| Denomination | Bitcoin, in satoshis | Dollars, in stablecoin units |
| Cost per payment | Effectively zero | Gas, cents or less on a cheap chain |
| Latency | Sub-second | A block, seconds |
| Buyer prerequisite | A funded channel with routable liquidity | A stablecoin balance |
| Credential | A macaroon, reusable with caveats | None, each payment stands alone |
| Public record | None, payments are private | Every 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](https://roundhouseai.io/resources/what-is-a-settlement-in-agent-payments) 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](https://roundhouseai.io/transactions) and summarised per chain at [/stats](https://roundhouseai.io/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.

---

Roundhouse indexes x402 settlements and ERC-8004 identities into one public record.

- Every article: https://roundhouseai.io/resources.md
- Every surface on this site: https://roundhouseai.io/llms.txt
- The index, endpoints and schema: https://api.roundhouseai.io/v0
- A key of your own, $0.01 over x402, no account: https://api.roundhouseai.io/v0/test/x402
- Limits and the SQL surface: https://roundhouseai.io/docs/api
