Is L402 quantum-safe?
Partly. The L402 credential rests on hashes and would survive a quantum computer that breaks elliptic curves. The Lightning payment under it would not. Here is what holds, what breaks, and what we changed at Lampo.
No quantum computer can do this today, and nobody knows when one will. This page is about what depends on what, not about dates.
| Part | Rests on | If secp256k1 is broken |
|---|---|---|
| Macaroon (the credential) | HMAC-SHA256 | Holds |
| Proof of payment (preimage) | SHA-256 | Holds |
| HTTPS to lampo.run | X25519 + ML-KEM key exchange | Recorded traffic stays sealed |
| Invoices and node identities | secp256k1 signatures | Forgeable |
| Funds in public channels | secp256k1 keys, announced in gossip | Exposed |
| Privacy of Lightning traffic | secp256k1 key agreement | Readable later |
| Agent wallet connections (NWC) | secp256k1 app key | Forgeable |
| Lampo's receipts | BIP-340, plus a daily SLH-DSA anchor | Anchors hold |
What already holds
- The macaroon. Aperture, Lightning Labs' L402 proxy, signs macaroons with a chain of HMAC-SHA256 under a secret root key. No elliptic curves are involved. Quantum algorithms speed up attacks on hashes and symmetric keys only modestly (Grover's algorithm gives a square-root speedup), so 256-bit values keep a wide margin.
- The proof of payment. The server hashes your preimage with SHA-256 and compares it with the payment hash inside the macaroon. Recovering a preimage from its hash is a hash problem, not a curve problem.
- The connection to lampo.run. HTTPS on lampo.run negotiates
X25519MLKEM768, a hybrid of classic X25519 and ML-KEM (FIPS 203). We checked it with Go and with Node 22.22, which the pi402 extension runs on; current Chrome and Firefox offer it by default too. This matters because your credential travels in theAuthorizationheader: someone who records traffic today and breaks the key exchange later could read it and spend what is left of your bundle. With ML-KEM in the exchange, the recording stays sealed. The certificate is still ECDSA, which matters only for live impersonation once a quantum computer exists, not for recordings.
What breaks
- Node identities and invoices. BOLT 11 invoices and node announcements are signed with secp256k1 keys whose public halves are public. Break the key and you can sign as that node.
- Channel funds. A public channel announces both of its funding keys to the whole network, together with a pointer to the funding output. Those funds would be exposed for as long as the channel stays open. Private channels don't announce them.
- Privacy of past payments. Connections between nodes (BOLT 8) and payment onions (BOLT 4) are encrypted with keys agreed over secp256k1. Traffic recorded today, including routes and amounts, could be read later.
- Wallet connections for agents. A Nostr Wallet Connect app is authorized by a secp256k1 key, and its public key is in every request it sends. Derive the private key and you can send payment requests as that app, up to whatever the wallet allows it.
- Signed records and identities. BIP-340 signatures: Nostr notes, and the receipts Lampo signs for every request.
What we changed at Lampo
- Post-quantum anchors. Starting with the anchor for 5 December 2026, the daily Merkle root of our receipts is also signed with SLH-DSA-SHA2-128s (FIPS 205), a hash-based signature. Our post-quantum key is bound to our current key by a record that both keys signed, timestamped with OpenTimestamps in Bitcoin block 978,882. A binding like this only counts if it predates the break, so it had to be made now. Details are in section 5 of the receipt spec; the binding is at /receipts/anchors/pq-key.json.
- Hybrid TLS. Caddy, the web server in front of our API, turns on
X25519MLKEM768by default. We didn't have to change anything; we checked that it is on. - Limits for agent wallets. nwc-guard, our open-source NWC proxy, caps each payment and the rolling spend, and asks the owner before paying a new payee. A forged request still has to pass those checks.
What you can do today
- Keep bundles small. An L402 credential is worth what is left in it.
- Use a current TLS stack. Go 1.24 or later, OpenSSL 3.5 or later, and Node builds that ship it (we tested 22.22) offer
X25519MLKEM768by default. - Put limits on agent wallets: a cap per payment, a daily budget and a list of allowed payees. They help today against bugs and prompt injection, and later against forged requests.
- If you sell over L402, check that your server negotiates
X25519MLKEM768, for example withopenssl s_client -groups X25519MLKEM768from OpenSSL 3.5. If you sign anything that must stay verifiable for years, bind and timestamp a post-quantum key now. - Coins and channels need protocol changes, such as BIP 360 (P2MR outputs). An application can't fix them on its own.
Questions or corrections? Join the discussion on Stacker News or write to contact@lampo.run.
See models and prices
See models and prices