Comparisons

x402 vs L402

Both use HTTP 402. L402 pays a Lightning invoice and gives a reusable macaroon; x402 signs a stablecoin payment. Headers, proofs and trade-offs compared.

Both protocols charge for HTTP access with a 402 response, but L402, developed by Lightning Labs, has the client pay a Lightning invoice and then present a macaroon plus the payment preimage as a reusable credential, while x402 has the client sign a stablecoin payment that the server or a facilitator verifies and settles on-chain.

Why is this harder than it sounds?

L402, formerly known as LSAT, and x402 use the same status code and a similar request-pay-retry shape, so the two are easy to blur. The real differences are the rail (Bitcoin's Lightning Network against stablecoins on chains such as Base), what the client ends up holding (a credential it can reuse and narrow, against a one-off payment) and how the server checks it (a hash comparison with no database, against a facilitator settling on-chain). Those choices decide who can pay you and how your server scales.

How do you do it?

  1. Who made it. L402 is developed by Lightning Labs; its specification says it was formerly known as LSAT. x402 was created by Coinbase and is now stewarded by the x402 Foundation at the Linux Foundation.
  2. The challenge. An L402 server replies 402 with WWW-Authenticate: L402 macaroon="…", invoice="…", carrying a freshly minted macaroon and a BOLT 11 Lightning invoice. An x402 server replies 402 with its payment terms in a PAYMENT-REQUIRED header.
  3. Paying and retrying. The L402 client pays the invoice over Lightning, receives the preimage as proof of payment, and retries with Authorization: L402 <macaroon>:<preimage>. The x402 client signs a payment payload and retries with it in PAYMENT-SIGNATURE; there is no separate payment step before the retry.
  4. How the server verifies. In L402 the macaroon commits to the invoice's payment hash, so the server checks that the hash equals sha256 of the preimage with no database lookup, which the spec calls the recommended approach. In x402 the server, or a facilitator through /verify and /settle, checks the signature and submits the payment on-chain before returning PAYMENT-RESPONSE.
  5. What the client keeps. An L402 macaroon is a bearer credential whose caveats can encode service access, capabilities, expiry and volume limits. A holder can attenuate it, for example to read-only, and pass it to another agent. An x402 payment pays for the request it was made for; the PAYMENT-RESPONSE header describes the settlement rather than issuing a reusable access token.
  6. Rails and tooling. L402 uses Lightning invoices, so payers need a Lightning wallet; Lightning Labs' Aperture is a reverse proxy that implements L402 for REST and gRPC services. x402 is stablecoin-first and blockchain-agnostic, with SDKs and facilitators for EVM chains, Solana and others.
  7. When to use which. L402 fits services whose payers already use Lightning, or that want reusable, attenuable access tokens with stateless checks. x402 fits services whose payers hold stablecoins such as USDC and expect to pay per request.

What it does not mean

  • L402 isn't an x402 variant. It is a separate specification from a different organisation, built on Lightning and macaroons.
  • A macaroon isn't an account. It is a bearer credential: anyone holding it, with the preimage, can use it within its caveats.
  • Neither protocol sets a budget for an agent. They describe how to pay a server, not how much a particular agent may spend.

Common questions

Is L402 the same as LSAT?

Yes. The L402 protocol specification says L402 was formerly known as LSAT.

Can an agent reuse an L402 credential?

Yes, within its caveats. The macaroon and preimage can be presented again until a caveat, such as an expiry or a usage limit, stops it, and the holder can narrow it before delegating.

Does x402 work with bitcoin?

x402 is designed to be network agnostic and its schemes are registered per network. Its own site describes stablecoin payments as the primary use case, so check the spec for which networks have schemes today.

Where does Veyra fit?

Veyra implements neither L402 nor x402, and it doesn't pay over Lightning. It is a permission layer for an agent paying from a wallet you already own: the agent calls create_payment on Veyra's MCP endpoint, Veyra applies per-payment, daily, auto-approve and ask limits and a recipient allowlist, and the payment goes out in USDC on Base, signed by you or, on paid plans, from a capped allowance. Use it for payees that accept a direct USDC transfer.

Veyra's spend policy for one agent endpoint: per-transaction limit, daily limit, auto-approve limit, ask-up-to limit and recipient allowlist
What this looks like in Veyra: one spend policy per agent endpoint, with a per-payment cap, a daily cap, an auto-approve band, an ask band and a recipient allowlist, all checked on the server. Try the free policy generator →

Sources

Terms on this page

This page explains how agent payments and the related technology work. It is not financial, investment, legal or tax advice. Protocols and provider features change; check the linked official sources before relying on a detail.