PQAI #1: Keccak-256, the Hash Cornerstone of Ethereum in the Post-Quantum and Post-AI Era

CN
7 hours ago

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

Compiled by|Express@Odaily Planet Daily

qx2027VKmayqmS-NV-wR9kTPk2WBZSyoO8uWmG6m2wk.webpThis decision is the result of years of work, with numerous researchers and engineers inside and outside the EF contributing ideas, breakthroughs in proofs, and feedback, leading to today's step—including the authors of Binius, the authors of WHIR, Angus Gruen, as well as Lev Soukhanov who contributed to GKR, Benedikt Bünz, Ron Rothblum, and William Wang who contributed to Flock, Justin Thaler and Quang Dao who contributed to the innovation of sumcheck, and various zkEVM teams who shaped the current version of leanVM, along with many others in the cryptography community. This list is longer than this post itself.

Special thanks to every individual within 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 recommendKeccak-256 as the hash function used by Ethereum based on hash cryptography.

Keccak-256 has nearly two decades of accumulated cryptanalysis, with sufficient security margins. Ethereum has already used it to handle addresses and execution layer states; continuing to bet on it means Ethereum does not need to introduce a third universal hash into the protocol beyond SHA2-256.

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

What has changed: Performance is no longer a deciding factor

Once Ethereum transitioned to hash-based cryptography, the security of the protocol hinged on the hash function itself: if the hash is broken, everything else is broken. The same hash must also perform well in three relatively different environments:

  • On CPU. Clients run it natively for signing and verification, hashing state trees, and deriving addresses.
  • In zkVM. Signatures, blobs, and recursive aggregations run in leanVM, which is the zkVM we will use in the protocol. The proof cost for each hash must be low enough not to become a bottleneck for aggregation—today that means proving about 500,000 hashes per second on hardware at the level of EIP-7870, which corresponds to about 1,000 attestations per second, sufficient to cover a committee in the consensus layer.
  • In EVM. Contracts compute hashes to verify signatures, check on-chain storage proofs, or support niche applications that require hashing. Here, gas costs are important, usually implying a dedicated opcode or precompiled function.

For years, performance in zkVM has been a bottleneck: traditional hash proof costs are too high, so the industry's default assumption is that Ethereum's post-quantum signatures will require a ZK-friendly hash, such as Poseidon, trading off well-researched security for proof speed. This is precisely why we spent years attempting to strengthen the cryptanalysis of Poseidon.

This trade-off has disappeared, as SNARKs can now efficiently handle standard hashes. Binary field SNARKs (Binius, Flock) and GKR-based provers have now proven standard hashes at speeds reaching or even significantly exceeding the goal of 500,000 per second. Proof performance can no longer distinguish standard hashes from algebraic hashes, so security has become the decisive factor.

The standards for security are high because this choice is hard to backtrack. This hash must protect Ethereum's value for decades, so we want the largest possible public cryptanalysis volume and a security margin wide enough that breaking it requires entirely new cryptanalysis methods. Where other aspects of candidates are equal, we lean towards reusing existing elements of Ethereum to minimize ecosystem shocks since every new primitive must be implemented, optimized, audited, and fuzz tested in every client, zkVM, and SDK.

Narrowing Down

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

ZK-friendly hashes: Poseidon and Poseidon2

The design goal of Poseidon (2019) and Poseidon2 (2023) is to be efficiently provable in SNARKs over finite fields, but this advantage has largely been neutralized by binary field SNARKs.

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

We noted that Poseidon and Poseidon2 are actually completely different hash functions. However, our conclusions for both remain the same.

High-speed hashes: BLAKE3 and BLAKE2

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

However, it modifies the round function of BLAKE2 and reduces the rounds from 10 to 7. The result is that cryptanalysis attacks for BLAKE2 and BLAKE3 cannot be interchanged, and the cryptanalysis record for BLAKE3 is sparse. Additionally, BLAKE3's mode of operation lacks a proof of security, and its underlying block cipher is known to have distinguishers for a considerable number of rounds.

BLAKE2 (2012) has more extensive research, although there are still fewer than 10 published cryptanalysis attacks on the hash itself, with the best attack reaching 2.5 rounds (BLAKE2). It is still considered secure (and fast), and Ethereum has exposed its compression function (blake2f) through EIP-152 precompilation. We ultimately did not choose BLAKE2 because the accumulated cryptanalysis for the remaining candidates is significantly greater, and performance is also sufficient.

The incumbents: SHA2-256 and Keccak-256

This leaves the two hashes that Ethereum is already using.

SHA2-256 (2001) is used by the consensus layer (CL) SSZ and is also the 0x02 precompiled function of the execution layer (EL), subsequently used for the current deposit contracts.

It is natively fast, particularly benefiting from SHA-NI on x86. However, practical collision attacks have reached 35 rounds out of its 64 rounds, with the best collision attack reaching 38 rounds, exceeding half the total rounds (Li et al., 2026, Zhang et al., 2026, Goldreich, 2026).

The security proof for signature schemes based on hashing, as well as the Fiat–Shamir steps in aggregating them in SNARG, treats hashes as random oracles. However, SHA2-256 uses a Merkle–Damgård structure, and just the length extension issue is enough to distinguish it from a random oracle.

Therefore, schemes built on it need extra caution: for example, SLH-DSA-SHA2 utilizes HMAC and MGF1 in certain functions. Of course, the random oracle issue can be patched, but it is not desirable for every protocol built upon SHA2-256 to exercise additional caution here.

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

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

Relative performance is exactly the area where Keccak-256 performs worse compared to other traditional hashes, especially in a binary tree hashing scenario. Nevertheless, leanVM has proven the speed of Keccak-f exceeds 500,000 hashes per second on EIP-7870 hardware, sufficient for the required aggregation throughput; it's just that it is harder to prove than BLAKE3 and has a native speed slower than SHA2-256. We accept this relative performance cost for the sake of the security margin and historical cryptanalysis accumulation.

Keccak-256 vs SHA3-256

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

The trade-offs for both boil down to integration issues within Ethereum:

  • It is already in the protocol. KECCAK256 is already an opcode used widely in the execution layer and application layer.
  • It avoids having two almost identical functions. Having both SHA3-256 and Keccak-256 coexist means the two functions differ by just one padding byte. Moreover, both are easily referred to as "SHA3" informally, since strictly speaking, Keccak is a variant of the SHA3 family. Not introducing SHA3-256 avoids a whole 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 the signatures FIPS compliant since the signing scheme itself is outside the scope of FIPS certification. For users needing FIPS compliance, we will construct a different protocol layer to accommodate this—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. Furthermore, when SSZ is introduced to the execution layer (which is likely to occur in the frame transaction scenario), we recommend using Keccak-256 in conjunction.
  • CL clients: Keccak-256 is already in use (the node IDs in discv5 use it). In the long run, we recommend migrating the Merkleization of SSZ from SHA2-256 to Keccak-256.

References

免责声明:本文章仅代表作者个人观点,不代表本平台的立场和观点。本文章仅供信息分享,不构成对任何人的任何投资建议。用户与作者之间的任何争议,与本平台无关。如网页中刊载的文章或图片涉及侵权,请提供相关的权利证明和身份证明发送邮件到support@aicoin.com,本平台相关工作人员将会进行核查。

Share To
APP

X

Telegram

Facebook

Reddit

CopyLink