Post-quantum stealth payments after Glamsterdam: measured ERC-8441 costs and a one-slot registry commitment

Post-quantum stealth payments after Glamsterdam: measured ERC-8441 costs and a one-slot registry commitment

TL;DR

  • I measured the full ERC-8441 flow (ERC-5564 schemeId 3: register, announce, pay, scan, sweep) on Sepolia, on Ethereum mainnet under pre-Glamsterdam pricing, and on an anvil fork of mainnet, against the same canonical announcer and registry.
  • Mainnet does not run EIP-8037 yet. Sepolia has run it since Glamsterdam activated on 6 October. Under it, a scheme 3 registration costs 4.7x more (964,761 on mainnet today to 4,563,569 gas on Sepolia), and the first payment to a fresh stealth EOA costs 9.7x more (21,000 to 204,600). Today’s Sepolia numbers, and the 4.89M gas projection for the same four steps on mainnet after the fork, remain a preview until that run is repeated on post-Glamsterdam mainnet.
  • Under Glamsterdam, the per-payment post-quantum premium is exactly the ML-KEM ciphertext at the calldata floor: 64 x 1088 = 69,632 gas. The larger per-payment cost is now creating the one-time account, and that cost does not depend on the scheme.
  • A proposal with measurements: store keccak256(meta-address) in one slot and carry the 1250 bytes in a log. This costs 159,647 gas under Glamsterdam, 28.6x less than registerKeys, and 77,763 gas today.
  • A question for the EF PQ effort: should the planned PQ key registry also carry a commitment to an account’s KEM key?

Setup

Contracts: the announcer 0x5564…5564 and the registry 0x6538…6538. Both are deployed on mainnet. The announcer runtime is byte-identical on mainnet and Sepolia. The registry differs only in 35 bytes: the chain id and the cached EIP-712 domain separator.

  • Sepolia (Glamsterdam): four real transactions on 4 December 2026, listed in the comparison table.
  • Mainnet today (pre-Glamsterdam): the same scheme 3 flow, also on 4 December 2026, in blocks 26,557,666 to 26,557,690. The receiver scan of the announce log recovered the one-time key in 18.5 ms.
Step gasUsed Transaction
registerKeys(3, meta), 1250 B 964,761 0x7ef94d32…
announce(3, …) with native-token metadata 70,400 0xecb6761d…
Payment of 0.001 ETH to the fresh stealth EOA 21,000 0x15301aaa…
Sweep from that EOA to an existing account 21,000 0x50c29fe8…
Total 1,077,161

The total is 54 gas under the 1,077,215 measured on the earlier mainnet fork, from zero bytes in the random key and ciphertext.

  • Mainnet fork, for the rest of the comparison: anvil 1.9.0 forked from mainnet block 26,557,484, with fresh accounts. Three checks show that this block, and the live run above, run pre-Glamsterdam rules:
    • the latest header has no block access list;
    • eth_estimateGas on live mainnet returns 21,000 for a transfer to a fresh address, against 204,600 on Sepolia;
    • a read-only eth_estimateGas of registerKeys(3, …) on live mainnet agrees with the fork measurement, within the estimator’s margin.
  • Same rules as Sepolia, locally: anvil with chain id 11155111 and the canonical runtime bytecode. This setup reproduces the live Sepolia announce, payment and sweep exactly. It reproduces registerKeys to within 60 gas (4,563,509 against 4,563,569), which is five calldata zero bytes at 12 gas each.

Glamsterdam’s mainnet date is not final. The EF announcement schedules Hoodi for 15 December. On the 3 December ACDE call, developers pencilled in 26 January 2027 for mainnet, contingent on Hoodi.

Mainnet today vs Glamsterdam

Step Mainnet today Glamsterdam Ratio
registerKeys(3, meta), 1250 B, first write 964,761 (tx) 4,563,569 (tx) 4.73x
registerKeys(1, meta), 66 B, first write 115,310 461,090 4.00x
announce(3, …) with native-token metadata 70,400 (tx) 105,368 (tx) 1.49x
announce(1, …) with native-token metadata 29,145 35,736 1.23x
First payment to the fresh stealth EOA 21,000 (tx) 204,600 (tx) 9.74x
Sweep to an existing account 21,000 (tx) 21,000 (tx) 1.00x
Per payment, scheme 3 (announce + fund + sweep) 112,400 330,968 2.94x

Every figure is gasUsed from a transaction receipt. In the mainnet column, the scheme 3 register, announce, payment and sweep are the live mainnet transactions in the table above. The other mainnet rows are from the fork of block 26,557,484. In the Glamsterdam column, rows with a link are live Sepolia transactions, and the rest come from the local setup with Sepolia rules. The Glamsterdam mainnet total of about 4.89M gas (4,894,537 for those four steps) is still a projection, to be measured again after the fork. Scheme 3 figures vary by up to a few hundred gas between runs, with the number of zero bytes in the random key and ciphertext (30 gas per zero byte at the EIP-7623 floor). The ERC’s Cost section reports 964,737, and the mainnet scheme 1 and 34-byte announcement figures match the ERC exactly (115,310 and 28,313).

Where the gas goes

Registration. ERC-6538 stores the meta-address as bytes: 40 data slots plus a length slot, so 41 new slots for 1250 bytes. EIP-8037 prices a new slot at 64 x CPSB = 97,920 state gas. Forty-one new slots cost 4,014,720 gas, which is 88% of the Sepolia transaction. Today a new slot costs 20,000 gas plus cold access, and storage already dominates; EIP-8037 multiplies it.

Announcement. Under Glamsterdam, every announce I measured sits exactly at the calldata floor: 15,000 + 64 x calldata_bytes. The 15,000 is EIP-2780’s base plus cold recipient access, and 64 per byte is EIP-7976. For example, 1412 bytes gives 105,368 and 324 bytes gives 35,736. The scheme 3 calldata exceeds scheme 1 by exactly the 1088-byte ciphertext, so the per-payment premium is 64 x 1088 = 69,632 gas. Today’s scheme 3 announcements sit on the EIP-7623 floor (21,000 + 10 x tokens), and scheme 1 pays the standard rate, as the ERC notes. So the ERC’s ratio of 2.45x (view tag only) becomes 3.07x under Glamsterdam (103,320 against 33,688), and 2.49x with token metadata becomes 2.95x.

Funding. A value transfer that creates an account pays 120 x CPSB = 183,600 state gas on top of 21,000. That applies to any never-used stealth address under any scheme. Per payment under Glamsterdam, the PQ ciphertext is 21% of the scheme 3 total (69,632 of 330,968). Today it is 37% (41,255 of 112,400).

Proposal: a one-slot commitment to the meta-address

The 4.56M is a storage bill for 1184 bytes of ek that only senders read. Senders can verify the bytes against a hash instead of reading them from state.

// Sketch, not audited. Same keying as ERC-6538.
interface IERC6538Commitments {
    event StealthMetaAddressCommitted(
        address indexed registrant, uint256 indexed schemeId,
        bytes32 indexed commitment, bytes stealthMetaAddress);

    // Stores keccak256(stealthMetaAddress) in one slot and emits the bytes in the log.
    function commitKeys(uint256 schemeId, bytes calldata stealthMetaAddress) external;

    // Stores only the hash; the bytes are published elsewhere.
    function commitHash(uint256 schemeId, bytes32 commitment) external;

    function commitmentOf(address registrant, uint256 schemeId) external view returns (bytes32);
}

The sender reads commitmentOf(R, 3) and obtains the 1250 bytes from any source: the log, the recipient’s wallet server, an ENS record, IPFS, or a payment request. It accepts them only if keccak256(bytes) matches and the ML-KEM ek check of ERC-8441 passes. The source then needs no trust. Keccak also matches the EF’s recommendation of one hash family for PQ-era Ethereum.

Measured as first writes by fresh registrants (the commitment row round-trips through the log in the test):

Option Mainnet today Glamsterdam
registerKeys(3, 1250 B) as today 964,761 4,563,569
Meta-address as contract code (SSTORE2 style) 323,629 2,142,263
32-byte hash through the existing registerKeys (no new contract) 69,795 239,735
commitKeys: hash in one slot, bytes in the log 77,763 159,647
commitHash: hash only 46,649 128,581
Deploying the commitment contract, once 203,351 1,281,103

Trade-offs:

  • Log retention. Logs are not permanent storage under history expiry (EIP-4444), so a recipient may have to re-publish. The bytes stay content-addressed, and re-committing costs one slot.
  • No new contract. The existing registry can hold a 32-byte commitment under a separately agreed schemeId, which keeps ERC-8441’s no-new-contract property at 239,735 gas. It needs a convention so that 32 bytes are never read as a truncated meta-address.
  • Code storage. Storing the bytes as code only roughly halves the cost, because EIP-8037 prices code at CPSB per byte.

Spending stays on secp256k1

Scheme 3 protects discovery, not spend authority. That was deliberate, and I still think it was the right first step. Making a one-time output PQ-spendable later means the account gets code: an EIP-8141 VERIFY frame with a hash-based signature, or a delegation. I measured a self-sponsored EIP-7702 delegation by a funded fresh stealth EOA:

  • 36,800 gas today;
  • 58,006 gas under Glamsterdam.

Under EIP-8037, each such output costs at least 204,600 to exist plus the delegation, before any PQ verification gas. Recovery of funds after a break is a separate problem, covered in Quantum Recoverability, Formally Verified in Lean and in my earlier post on ERC-8441 outputs.

The question

PQAI 0 moves user accounts to hash-based signatures. The protocol priorities put a post-quantum public-key registry in I and leanSPHINCS transactions in J. Hash-based cryptography gives signatures, but no practical key exchange. So private receive still needs a lattice KEM key of 1184 bytes per recipient, and through ERC-6538 that key costs 4.56M gas under EIP-8037.

Is the I* key registry scoped to signing keys only, or could it hold a 32-byte commitment to an account’s KEM encapsulation key (for example, keyed like ERC-6538 by address and schemeId)? If it could, stealth discovery would not need a second, state-heavy, application-level registry, and the commitment design above could be dropped in favour of it. If not, I would value guidance on which of the rows above wallets should standardise on.

Smaller open questions:

  1. Is ML-KEM-768 inside a hybrid with ECDH an acceptable assumption for the privacy layer, given the preference for hash-based assumptions in PQAI 0? A lattice break degrades scheme 3 to today’s ECDH, not below.
  2. With 183,600 gas of state per fresh account, should private receive keep using one account per payment, or move toward notes, as discussed in native UTXOs?

Context and links

This is research code, not audited, from one Sepolia run, one mainnet run under pre-Glamsterdam pricing, and local forks. The post-Glamsterdam mainnet total of about 4.89M gas stays a projection, to be rerun after the fork. The measurement scripts are at gist.github.com/siriusthemaster/832b39f8d582d12e127fc776ff47efaa. Corrections to my reading of EIP-8037 or EIP-2780 are very welcome.

Sirius