Lattice-based cryptography shield protecting a key after a quantum attack breaks an elliptic curve

By Isai Alexei · Author & Copywriter · Edited by Stefan Sanetrik · Founder & Author

Lattice-Based Cryptography for Smart Contracts: What Post-Quantum Signatures Cost in Bytes and Gas

Ethereum, post-quantum, secp256k1

How Shor’s Algorithm Targets secp256k1 Signatures

Shor’s algorithm solves the elliptic curve discrete logarithm problem (ECDLP) in polynomial time, while the best classical attacks need exponential time.
A secp256k1 public key equals the private key times a generator point, and a quantum computer reverses that multiplication. Whoever recovers the private key can move every coin it controls.

Hash functions like SHA-256 face only Grover’s quadratic speedup, so they keep 128 bits of quantum security. The weakness sits in the signature layer, and swapping the curve for a lattice problem removes it.

Grid of five Bitcoin and Ethereum account types showing when the public key is exposed and whether an at-rest or on-spend quantum attack applies.
Figure 1. Where the key is visible decides whether an attacker has a deadline

Quantum Resource Estimates for Breaking 256-Bit Curves

In 2017, Microsoft Research’s Roetteler, Naehrig, Svore and Lauter calculated that Shor’s algorithm against a 256-bit prime-field elliptic curve needs 2,330 logical qubits.

Google Quantum AI’s whitepaper of March 30, 2026 (Babbush et al., later published in PRX Quantum) brings that down for secp256k1: one circuit needs at most 1,200 logical qubits and 90 million Toffoli gates, another at most 1,450 logical qubits and 70 million Toffoli gates.

On superconducting hardware with a 0.1% physical error rate, both fit in fewer than 500,000 physical qubits. No machine of that size exists yet, and Google did not publish the circuits.

imeline: a primed quantum machine breaks a Bitcoin key 9 to 12 minutes after it appears, an unprimed one in 18 to 23, against a 10-minute average block.
Figure 2. Attack times from Babbush et al. (2026) against Bitcoin’s block interval.

Which Bitcoin and Ethereum Keys Are Exposed

BIP-360, drafted by Hunter Beast, Ethan Heilman and Isabel Foxen Duke, proposes Pay-to-Merkle-Root (P2MR), a SegWit version 2 output type with bc1z addresses. It removes the Taproot key-path spend, so the output commits to a Merkle root of scripts and publishes no public key.

The BIP entered the repository as a draft in February 2026, and a merge there does not signal that it will activate. It specifies no signature algorithm; ML-DSA, SLH-DSA and Falcon are the candidates.

P2MR protects against long-exposure attacks only: a spend still reveals a key in the mempool until post-quantum signatures sign the script leaves. So Bitcoin’s choice comes down to lattice-based ML-DSA or Falcon against hash-based SLH-DSA for those leaves.

In Ethereum, exposure sits in externally owned accounts. Twelve-second slots leave an on-spend attacker far less time than Bitcoin’s ten-minute blocks, so the whitepaper treats at-rest attacks on exposed keys as the main threat.

The Ethereum Foundation formed a dedicated post-quantum team in January 2026, and the roadmap on Ethereum targets core layer-1 infrastructure around 2029, including hash-based leanXMSS signatures for validators in place of BLS.

Lattice-Based Signatures: ML-DSA and Falcon

NIST published FIPS 204 (ML-DSA) on August 13, 2024, as its primary digital signature standard, derived from CRYSTALS-Dilithium.

FN-DSA, based on Falcon, carries the designation FIPS 206 and was still a draft in NIST’s latest public material. ML-DSA rests on module-LWE and module-SIS, Falcon on SIS over NTRU lattices.

No known quantum algorithm solves these problems in polynomial time, and Shor’s algorithm does not apply to them. That makes both schemes the main post-quantum signature candidates for blockchains.

Lattice signatures run 10 to 37 times larger than ECDSA’s 65 bytes, and hash-based SLH-DSA about 120 times larger.

SchemeFamilySignaturePublic keySignature calldata gas
ECDSA (secp256k1)Elliptic curve65 bytesRecovered from the signature1,040
Falcon-512Lattice666 bytes897 bytes10,656
ML-DSA-44Lattice2,420 bytes1,312 bytes38,720
SLH-DSA-128sHash-based7,856 bytes32 bytes125,696
Calldata gas counts the signature only, at 16 gas per non-zero byte.

Gas Cost of Post-Quantum Verification on the EVM

The open-source ETHFALCON and ETHDILITHIUM implementations from ZKNox measure it for NIST-compliant verifiers and for EVM-tuned variants; ETHDilithium replaces the SHAKE256 expansion with a Keccak-based one.

Log-scale chart of verification gas: draft precompiles sit below the 100,000-gas VERIFY budget, Solidity verifiers at 1.5 to 8.1 million sit far above.
Figure 3. Gas to verify one signature

EIP-7885 adds number-theoretic transform (NTT) precompiles and, on a modified Ethereum client, cut ETHFALCON verification by 73.4%. EIP-8051 has the lowest ML-DSA-44 price in the chart, but its precompile takes a pre-expanded 20,512-byte public key, and at 16 gas per byte that key alone costs about 328,000 gas in calldata. EIP-8355 takes the standard 1,312-byte key and covers ML-DSA-44, ML-DSA-65 and ML-DSA-87. 

Migration Paths for Ethereum Accounts

ERC-4337 smart accounts accept custom verification logic, so a wallet can verify Falcon or ML-DSA signatures inside a contract at the Solidity costs above. The whitepaper adds a caution: externally owned accounts remain the entry point to Ethereum, so account abstraction mitigates the exposure without closing it.

EIP-8141 introduces frame transactions with a VERIFY frame and a 100,000-gas validation budget for the public mempool. Every pure Solidity verifier in the chart exceeds that budget, and so does the NTT-assisted ETHFALCON, so full precompiles become a prerequisite for mempool propagation.

EIP-7932 adds a signature-algorithm registry and a sigrecover precompile with a 3,000-gas base cost.

Keep the signature check behind its own address

Teams that deploy wallets before the precompiles ship can isolate the check in a modular verifier contract. A later switch to a precompile then changes one address instead of wallet logic.