ERC-8441: Hybrid post-quantum stealth address scheme

Hi all,

We’d like feedback on a draft ERC that adds a post-quantum scheme to ERC-5564 stealth addresses.

Draft: ERCs/ERCS/erc-8441.md at hybrid-pq-stealth · namnc/ERCs · GitHub
Reference implementation, test vectors and gas harness: GitHub - namnc/pq-stealth-scheme3-public: pq-stealth-scheme3-public · GitHub

Summary

ERC-5564 defines stealth addresses and a schemeId namespace, and specifies one scheme, schemeId 1, on secp256k1. This draft specifies schemeId 3. Its payment secret combines an ML-KEM-768 encapsulation with a secp256k1 ECDH secret, so an adversary who later builds a quantum computer still cannot tell from the public announcement log who was paid, as long as ML-KEM-768 holds.

Spending does not change. Each stealth address is an ordinary secp256k1 EOA. The scheme uses the deployed ERC-5564 announcer and ERC-6538 registry as they are, with no protocol change and no new contract.

Why now

Announcements are public and permanent. Under schemeId 1, anyone who can compute discrete logarithms can take each registered viewing key and work out who every past payment went to. A quantum computer built later can do this to announcements published today, so the protection has to be in place before such a computer exists. Theft is different: it needs the quantum computer while the funds are still there, and spending can migrate separately.

Design at a glance

  • Keys. A 128-byte seed gives a spending key, an ECDH viewing key and an ML-KEM-768 seed (d, z). The meta-address is spending_pk || viewing_pk_ec || ek, 1 250 bytes, registered once with ERC-6538. The 96-byte tracking key viewing_ec || d || z can be handed to a scanning service, which can find payments but not spend them.
  • Payment secret. ss = SHA3-256(DS || ss_ec || ss_pq || epk || ct || viewing_pk_ec || ek). Hashing both shared secrets and both ciphertexts keeps it IND-CCA if either component is, without relying on anything specific to ML-KEM.
  • Announcement. ephemeralPubKey = epk || ct (1 121 bytes) and metadata is the view tag, optionally followed by ERC-5564’s token metadata. So ERC-5564’s metadata layout and its method signatures apply unchanged.
  • Offset and view tag. Both come from separate domain-separated SHA-256 digests of ss. The view tag is derived after the KEM, because a tag computed from the ECDH secret alone would let a quantum adversary rule out most candidate recipients.
  • Sender randomness comes from a CSPRNG, and encapsulation is plain ML-KEM.Encaps(ek), so FIPS-validated ML-KEM libraries work.

Cost (Prague, measured on a local node against the canonical contracts)

announcement registration, once per recipient
schemeId 1 (classical) 28 313 gas 115 310 gas
schemeId 3 69 330 gas (2.45x) 964 737 gas
schemeId 3, with ERC-5564 token metadata 70 550 gas

A whole schemeId 3 payment (announce, fund and spend) costs 111 330 gas. The schemeId 3 announcement sits on the EIP-7623 calldata floor, so its cost is set by calldata size alone. Scanning costs one ECDH, one ML-KEM-768 decapsulation and one hash per announcement, with no cheaper prefilter.

What it does not do

It protects the link between an announcement and its recipient, and nothing else. Spending stays classical. Once a quantum computer exists, a stealth address is exposed as soon as a spend reveals its public key. The registered spending key also falls, so anyone holding a payment’s ss, a delegated scanner included, can spend it. Funds need a separate migration before then. Funding transfers, sweeps, timing and amounts can still link payments, as in any stealth-address scheme.

Where we’d most like feedback

  1. ct in ephemeralPubKey. It keeps ERC-5564’s metadata and method signatures intact, but
    tools that assume a 33-byte ephemeral key need to dispatch on schemeId. Is that acceptable?
  2. The meta-address length. At 1 250 bytes it does not fit ERC-5564’s n / 2n rule. This
    is the one remaining departure from ERC-5564.
  3. KEM anonymity. The scheme needs ML-KEM-768 ciphertexts not to reveal their recipient
    (ANO-CCA). The published proofs cover round-3 Kyber, and CRYPTREC’s ML-KEM evaluation states the arguments carry over to ML-KEM. We state it as an assumption. Is anyone aware of a proof for ML-KEM as standardised?
  4. The combiner. It hashes all six inputs instead of following X-Wing, and it is not an
    SP 800-56C approved combiner. Does anyone need NIST approval here?
  5. Downgrade. A recipient registered under both schemeId 1 and 3 can still be paid without
    post-quantum protection by a wallet that only knows schemeId 1. The draft makes senders
    that implement schemeId 3 prefer it, and advises recipients to register only schemeId 3.
  6. Scanning cost. Every announcement needs a decapsulation before the view tag can be
    checked. How much does that matter for wallets and scanning services?

By Nam (@namnc), Pierre (@dmpierre), kassandra.eth (@kassandraoftroy)

5 Likes

Hey thanks for this @namncc, really solid work, and great to see PQ DKSAP land as a concrete ERC after so many years of several of us exploring it with PoCs, mine included (R1DO wallet).

The direction I’d most like to see explored is moving closer to a Bitcoin silent-payments style (BIP-352-like), so we don’t lean exclusively on a dedicated registry or announcer.

If the per-payment ciphertext and fingerprint can be isolated well enough that they don’t stand out as a stealth payment, the anonymity set grows from the handful of people using one announcer to the broader on-chain traffic, which is a much larger crowd to hide in. For me that is where the real privacy-set upside lives, and cutting the registry and announcer dependence is how we get there.

And while PQ spending is out of scope here, that is exactly where frame transactions (EIP-8141) make it a genuine delight to explore. The account can own its own validation, so a PQ-authorizing spend composes naturally on top of this discovery layer. For it to be practical at scale we should help push the ML-DSA verification precompile (EIP-8355) and signature aggregation (EIP-8288) toward SFI, since inline ML-DSA verification is far too heavy today and those are what bring the spend down to a realistic gas budget. Really looking forward to digging into that.

Thanks again for pushing this forward, and happy to compare notes or share what I learned!!!

1 Like

Strong proposal, and the right priority. Announcement privacy is the part of ERC 5564 that harvest now decrypt later attacks hit first. Three notes on your open questions.

The combiner. Hashing both shared secrets with both ciphertexts and both public keys is the conservative choice. If FIPS validated wallets matter, the same inputs can likely be arranged as the two step KDF of SP 800 56C, with ss_ec and ss_pq as the shared secret and the remaining values as fixed info, which is the hybrid pattern SP 800 227 describes. That would give an approvable construction without weakening the security argument.

Scanning cost. One ECDH, one ML KEM 768 decapsulation and one hash per announcement comes to roughly one to two minutes per million announcements on a single core, and the work parallelises fully. That looks acceptable for scanning services, and wallets can delegate with the tracking key as you describe.

Spending migration. Stateful hash based signatures already verify on chain through the SHA 256 precompile for about 200,000 gas per LMS W4 signature. We measured that while building the Quantum Bridge Shield ERC, so a post quantum spending path through account abstraction is within reach today.

For anyone building in this space, Quantova Inc has open sourced QCore, its post quantum signing stack, ready to use with ML DSA 65 under FIPS 204 and SLH DSA under FIPS 205. The Qstamp SDK family builds on it for salted SHA3 256 fingerprints of records and AI outputs that can be verified without revealing their contents. QMask is live and generates post quantum keys for accounts on the Quantova network, where every account, block and validator vote is signed with ML DSA 65, channels use ML KEM 768, and the explorer shows live throughput and finality of about 0.2 seconds. The packages are on npm under quantovainc, the source is on GitHub, and the documentation is on quantova . org and qstamp . org

Happy to compare notes on ML KEM integration and test vectors.

Thanks for your comment and sorry for the late reply,

In this ERC I want to focus on the practical and minimal upgrade of the ECDH ciphertext to ML-KEM.

I agree that further improvements to SAP is necessary, such as separation of announcement and actual payment but that requires non-trivial design (than what I have put in https://ethresear.ch/t/pq-anonymity-for-stealth-address-protocol/26094#p-62656-a-stealthier-sap-17). That said, I think it is more suitable to make it a separate ERC (e.g. decoupling stealth payment and stealth announcement, or how to not even require the announcer).

Another aspect to improve for SAP is definitely how to make payment more abstract than it is currently. A potential venue, as you mentioned, is via 8141, but it is not yet ready. Same for 8288 or 8355. When they are ready, I think we will have a clearer picture to best leverage them for SAP.

Thanks for your suggestions, and sorry for the late reply,

Indeed, the combiner is a conservative choice, but I think it is reasonable given the not so clear situation about this. We can make an update (or another ERC) later to change the combiner.

Changing the combiner later would change both the view tag and the derived stealth address for the same inputs. That seems like a compatibility break rather than an ordinary update.

Should the ERC explicitly freeze the cryptographic suite under schemeId 3 and require a new scheme ID for any replacement? Otherwise an updated scanner could silently miss payments generated by an older sender. Historical announcements would still need the original derivation rules.

Thanks, I assume a new schemeId (as how 1 to 3) is necessary for such an update indeed.

1 Like

ERC-8441 is now merged as Draft: Hybrid post-quantum stealth address scheme | Ethereum Improvement Proposals

Recap: it defines ERC-5564 schemeId 3. The shared secret combines an ML-KEM-768
encapsulation with a secp256k1 ECDH secret, so the announcement layer is post-quantum.
Spending stays ordinary secp256k1 ECDSA, so spending is not post-quantum. No protocol change.

  • Meta-address: 1250 bytes, registered once via ERC-6538
  • Announcement: 1122 bytes (epk || ct in ephemeralPubKey, 1-byte view tag in metadata)
  • Gas on Prague, measured: 69,330 per announcement against 28,313 for a classical one (2.45x); 964,737 for first-time registration

Reference implementation (Rust): GitHub - namnc/pq-stealth-scheme3-public: pq-stealth-scheme3-public · GitHub
Test vectors: ERCs/assets/erc-8441/vectors at master · ethereum/ERCs · GitHub
(generated independently of the Rust code)

Feedback especially welcome on:

  1. the hybrid combiner and its domain separation
  2. the wire layout: ct in ephemeralPubKey, view tag as the first byte of metadata
  3. whether wallets and indexers can handle 1122-byte announcements and 1250-byte registry entries
  4. independent implementations: please run yours against the vectors and report any mismatch

Thanks to the ERC editors for the review.