PQAI #1: Keccak-256 — The Hash Foundation of Ethereum in the Post-Quantum, Post-AI Era

ETH
Keccak-256PoseidonPost-Quantum CryptographyEthereum FoundationSNARKhash functionszkVMcryptanalysis
1 hour agoSource: blockweeks.com
PQAI #1: Keccak-256 — The Hash Foundation of Ethereum in the Post-Quantum, Post-AI Era


The original article is from the Ethereum Foundation blog, author: Kev Wedderburn

Compiled by Express Knight @Odaily Planet Daily

PQAI #1: Keccak-256, the hash cornerstone of Ethereum in the post-quantum, post-AI eraThis decision is the product of years of work, with many researchers and engineers inside and outside the EF contributing ideas, proof breakthroughs, and feedback, which made today's step possible—including the authors of Binius, the authors of WHIR, Angus Gruen, and Lev Soukhanov for his contributions to GKR work, Benedikt Bünz, Ron Rothblum, and William Wang for their contributions to Flock, Justin Thaler and Quang Dao for their contributions to sumcheck innovations, as well as the various zkEVM teams that shaped the current version of leanVM, and many others in the cryptography community. This list is longer than this post itself.

Special thanks to everyone within the EF who contributed to this article: Alex Hicks, Antonio Sanso, Benedikt Wagner, Cody Gunton, Derek Sorensen, Dmitry Khovratovich, Emile, George Kadianakis, Gottfried Herold, Han Jian, Ignacio Hagopian, Justin Drake, Tau, Thomas Coratger, and Vitalik Buterin.

We (the Ethereum Foundation) recommend Keccak-256 as the hash function used for Ethereum's hash-based cryptography.

Keccak-256 has nearly two decades of accumulated cryptanalysis behind it, with ample security margin. Ethereum already uses it to handle addresses and execution layer state, and continuing to bet on it means Ethereum does not need to add a third general-purpose hash to the protocol beyond SHA2-256.

Since we need more than one hash function, we use a family of symmetric primitives derived from the Keccak-f[1600] permutation: including Keccak-256 for standard hashing, the sponge object Keccak-duplex for the Fiat-Shamir transform, and SHAKE256 for pseudorandom bit generation and key derivation.

What Changed: Performance Is No Longer the Deciding Factor

Once Ethereum moves to hash-based cryptography, the security of the protocol comes down to the hash function itself: if the hash is broken, everything else is broken. The same hash must also perform well in three rather different environments:

  • On the CPU. Clients natively run it for signing and verification, hashing the state tree, and deriving addresses.
  • In the zkVM. Signatures, blobs, and recursive aggregation all run in leanVM, the zkVM we will use in the protocol. The proof cost per hash must be low enough not to become a bottleneck for aggregation—today this means proving about 500,000 hashes per second on EIP-7870-class hardware, corresponding to about 1,000 attestations per second, enough to cover one committee of the consensus layer.
  • Inside the EVM. Contracts compute hashes to verify signatures, check on-chain storage proofs, or support some niche application that requires hashing. What matters here is gas cost, which usually means a dedicated opcode or precompile.

For years, performance in the zkVM was the bottleneck: traditional hashes were too expensive to prove, so the industry's default assumption was that Ethereum's post-quantum signatures would need a ZK-friendly hash, such as Poseidon, trading more thoroughly studied security for proof speed. It was precisely for this reason that we spent years trying to harden the cryptanalysis of Poseidon.

This trade-off has disappeared, because SNARKs can now handle standard hashes efficiently. Binary-field SNARKs (Binius, Flock) and GKR-based provers now prove standard hashes at speeds that meet or even clearly exceed the target of 500,000 per second. Proof performance can no longer distinguish standard hashes from algebraic hashes, so security has become the deciding factor.

The security bar is high, because this choice is hard to reverse. This hash will protect Ethereum's value for decades, so we want the largest possible body of public cryptanalysis and a security margin wide enough that breaking it would require entirely new cryptanalytic methods. Where candidates are otherwise comparable, we prefer to reuse what Ethereum already has, to reduce ecosystem disruption, because every new primitive must be implemented, optimized, audited, and fuzzed in every client, zkVM, and SDK.

Narrowing the Field

We compared five candidates: Poseidon/Poseidon2, BLAKE3, BLAKE2, SHA2-256, and Keccak-256.

ZK-Friendly Hashes: Poseidon and Poseidon2

Poseidon (2019) and Poseidon2 (2023) were designed to be efficiently provable in SNARKs over prime fields, and this advantage has been largely erased by binary-field SNARKs.

In 2022, Bariant et al. used a small trick—skipping two full rounds at almost zero cost—to show that the designers' analysis was overly optimistic. In addition, the Poseidon cryptanalysis program launched by the EF in November 2024 has continued to produce new attacks against reduced-round versions of both (Sanso and Vitto 2025, Bak et al. 2026). The full-round versions of both have not been broken, but since traditional hashes are now fast enough to prove, there is no reason to wait for cryptanalysis to mature slowly.

We note that Poseidon and Poseidon2 are actually two completely different hash functions. However, our conclusion is the same for both.

High-Speed Hashes: BLAKE3 and BLAKE2

BLAKE3 (2020) is the fastest traditional hash we examined: on a 16 vCPU machine, provers have already reached about 2.2 million BLAKE3 compressions per second (SNARK.fast Flock challenge).

But it both modifies BLAKE2's round function and reduces the number of rounds from 10 to 7. As a result, cryptanalytic attacks against BLAKE2 and BLAKE3 cannot be applied to each other, and BLAKE3's cryptanalysis record is sparse. In addition, BLAKE3's mode of operation has no security proof, and its underlying block cipher is known to have distinguishers for a considerable number of rounds.

BLAKE2 (2012) is more thoroughly studied, although there are still fewer than 10 publicly known cryptanalytic attacks, with the best attack on the hash itself reaching 2.5 rounds (BLAKE2). It is still considered secure (and fast), and Ethereum exposes its compression function (blake2f) through the EIP-152 precompile. We ultimately did not choose BLAKE2 because the remaining candidates have significantly more accumulated cryptanalysis and sufficient performance.

The Incumbents: SHA2-256 and Keccak-256

This leaves the two hashes Ethereum already uses.

SHA2-256 (2001) is used by the consensus layer (CL)'s SSZ, and is also the execution layer (EL)'s 0x02 precompile, and is further used by the current deposit contract.

It is fast natively, especially benefiting from SHA-NI on x86. But practical collision attacks have reached 35 of its 64 rounds, and the best collision attack reaches 38 rounds, more than half of the total rounds (Li et al. 2026, Zhang et al. 2026, Goldreich 2026).

The security proofs of hash-based signatures, as well as the Fiat-Shamir step in the SNARGs that aggregate them, treat the hash as a random oracle. But SHA2-256 uses the Merkle-Damgård construction, and length extension alone is enough to distinguish it from a random oracle.

Therefore, schemes built on it require extra care: for example, SLH-DSA-SHA2 uses HMAC and MGF1 in some functions. The random oracle issue can of course be patched, but requiring every protocol built on SHA2-256 to take extra care here is not desirable.

Keccak-256 (2008) is arguably the most thoroughly cryptanalyzed of all unbroken traditional hashes (Keccak team); and so far, its security has not been affected by AI-assisted cryptanalysis.

Practical collision attacks reach 5 of its 24 rounds; theoretical attacks against the underlying permutation used by Keccak-256, SHAKE128, and SHAKE256 reach 6 rounds (Guo et al. 2020, Zhang, Hou, and Liu 2024). It is built on the sponge construction: if the underlying permutation is ideal, the sponge construction is provably indistinguishable from a random oracle—for classical adversaries, and for quantum adversaries under a looser bound (Tokat, Alagic, Carolan, and Majenz, QCrypt 2026). This means the sponge construction is structurally secure, and there are no attacks that exploit the sponge construction itself. However, there may be methods that directly attack the internal Keccak-f permutation.

Relative performance is precisely where Keccak-256 performs worse compared to other traditional hashes, especially in binary tree hashing scenarios. Nevertheless, leanVM proves Keccak-f at over 500,000 times per second on EIP-7870 hardware, which is sufficient to meet the required aggregation throughput; it is just harder to prove than BLAKE3, and its native speed is also slower than SHA2-256. We accept this relative performance cost for the sake of security margin and accumulated historical cryptanalysis.

Keccak-256 and SHA3-256

Keccak-256 and SHA3-256 share the same Keccak-f permutation, the same rate and capacity, so their security, native speed, and proving cost are all the same. The only difference is the padding bits. Basically, every cryptanalysis result against one applies to the other, and every Keccak-f accelerator works for both functions.

The trade-off between the two comes down to integration issues within Ethereum:

  • It is already in the protocol. KECCAK256 is already an opcode and is widely used at the execution layer and application layer.
  • It avoids two nearly identical functions. Having SHA3-256 coexist with Keccak-256 means two functions that differ by only one padding byte. Moreover, both are easily called "SHA3" informally, because strictly speaking Keccak is a variant of the SHA3 family. By not introducing SHA3-256, we avoid an entire class of integration bugs.
  • FIPS certification does not help here. SHA3-256 is FIPS certified, while Keccak-256 is not, but choosing SHA3-256 does not make signatures FIPS compliant, because the signature scheme itself is not within the scope of FIPS certification. For users who need FIPS compliance, we will satisfy them through another protocol-layer construction—it allows users to verify arbitrary computations at low cost.

What this means for clients

For most teams, this choice requires almost no new code.

  • EL clients: No new hash is needed. Signature verification reuses the existing Keccak-256 implementation. In addition, when SSZ is introduced to the execution layer (which is very likely to happen in the context of frame transactions), we recommend using Keccak-256 in conjunction.
  • CL clients: Keccak-256 is already in use (discv5 node IDs use it). In the long term, we recommend migrating SSZ merkleization from SHA2-256 to Keccak-256.

References



Source link