EIP-8051 ML-DSA signature verification precompiles (Precompile for ML-DSA signature verification)

No call decision · Security & privacy · EIP status Draft · created 2025-10-15

Adds two precompiles for verifying ML-DSA, the NIST-standard signature scheme that is also secure against quantum computers, on the EVM: one that follows the FIPS-204 standard as-is, and an EVM-optimized version that saves gas using the Keccak hash.

Why it is needed

The secp256k1 signature scheme widely used in Ethereum relies on the hardness of the elliptic curve discrete logarithm problem, which quantum computing algorithms can break, exposing on-chain assets and core infrastructure to long-term risk. Since it takes existing applications years to adopt a new signature scheme, the groundwork needs to be laid before quantum attacks become practical. ML-DSA (Dilithium), the lattice-based signature NIST standardized as FIPS-204, is the primary winner of the standardization process and offers strong security against both classical and quantum attacks. Its signature (2.4kB) and public key (1.3kB) are larger than those of other candidates such as Falcon (FN-DSA), but its flexible parameters make it easier to build zero-knowledge versions, and its simple signing algorithm also makes hardware implementation easier. In addition, the EVM already has a Keccak256 precompile, so using a Keccak-based function instead of SHAKE256 makes verification much faster. This proposal therefore puts forward two versions together: one that follows the NIST standard as-is, and an EVM version that changes the encoding to reduce gas costs.

What changes

Today

After EIP-8051

Who is affected

In depth

Specification of the two precompiles

VERIFY_MLDSA at address 0x12 verifies ML-DSA signatures that follow FIPS-204 as-is, while VERIFY_MLDSA_ETH at address 0x13 verifies ML-DSA-ETH signatures adapted for the EVM. Both precompiles cost 4500 gas. The input, in big-endian, consists of a 32-byte message, a 2420-byte signature, and a 20512-byte expanded public key, and the output is 1 in 32-byte format on success or 0 on failure. The specified error cases are insufficient gas, mismatched input length, field element encodings greater than or equal to q, norm bound violations, failed hint checks, and failed signature verification.

Parameters are fixed at NIST security level II

ML-DSA can be used at NIST security levels II, III, and IV, but this EIP covers only level II, which corresponds to 128-bit security. The fixed parameters are polynomial degree n = 256, modulus q = 8380417, matrix dimensions k = 4 and l = 4, rejection bounds γ_1 = 2^17 and γ_2 = (q-1)/88, β = 78, and additional parameters η = 2, τ = 39, and d = 13. q, n, k, l, and η are chosen so that the MLWE-related problem remains hard, and the rest are exactly the NIST values chosen for the hardness of MSIS and for efficiency. β = τ * η = 78 is the norm bound used in the rejection condition ||z||_∞ < γ_1 - β, and corresponds to the ML-DSA-44 parameter set in FIPS-204.

Public key: 20512 bytes, signature: 2420 bytes

The verifier could expand the public key from its 1312-byte compressed form, but that would make on-chain verification cost impractically high. This EIP therefore takes a pre-expanded raw format as input. The public key totals 20512 bytes: the full 16384-byte matrix A_hat, 32 bytes of tr stored to save one hash computation, and 4096 bytes of t1 stored in the NTT domain to save one NTT computation. The signature uses the same format as FIPS-204: 32 bytes for c_tilde, 2304 bytes for the z coefficients, and 84 bytes for hint h, totaling 2420 bytes.

Why Keccak-PRNG is used instead of SHAKE256

Verification needs an extendable output function (XOF) that can draw as many bytes as required. SHAKE256, the XOF used in the NIST submission, has no EVM opcode for its internal Keccak_f permutation, making it expensive to compute on the EVM. ML-DSA-ETH instead uses a Keccak256-based counter-mode PRNG (per the NIST SP800-90A revision 1 approach) as its XOF. The interface matches SHAKE256, but adds a flip() function that resets the counter to 0, and squeeze outputs bytes in counter mode. Since the EVM already has a Keccak256 precompile, this construction is far more efficient. The modified version of sample_in_ball differs only in that flip() is inserted between lines 3 and 4 of FIPS-204 Algorithm 29.

Verification algorithm and required checks

Verification follows FIPS-204 Algorithm 8. tr and the message are fed into the XOF to derive 64 bytes of μ, and the challenge polynomial c, whose τ coefficients are in {-1,1}, is generated from c_tilde via sample_in_ball (Algorithm 29). A_hat * z - c * (2^d * t1) is computed in the NTT domain; the standard version requires 3 NTTs and 1 inverse NTT for c, z, and t1, while the ETH version reduces this to 2 NTTs and 1 inverse NTT because t1 is already stored in the NTT domain with the 2^d multiplication precomputed. use_hint (Algorithm 40) then recovers w_prime. There are three required checks: that the encoding of hint h is valid (Algorithm 21), that the norm of z satisfies ||z||_∞ < γ_1 - β, and that the final hash output equals c_tilde.

Basis for the 4500 gas cost

The cost of both precompiles is driven by NTT calls and hash calls. NTT and inverse NTT each require roughly n·log(n) additions and n/2·log(n) multiplications over F_q, and efficient polynomial multiplication can be implemented following a separate draft NTT EIP. Hashing, including challenge sampling, the μ computation, and the final comparison, averages around 5 calls. Applying the keccak256 cost linearly and avoiding context switches, both precompiles were priced at 4500 gas.

EIP-7932 transaction integration

This defines the integration parameters needed to send ML-DSA signature transactions through EIP-7932's AlgorithmicTransaction container. ALG_TYPE = 0xD1 identifies ML-DSA transactions (the version field in signature_info is 0xD1 for the NIST version and 0xD2 for the EVM version), MAX_SIZE is 2441 bytes to fit the fixed-length container, and GAS_PENALTY is recommended at around 3000 gas based on benchmarks. signature_info consists of a 1-byte version, a 2420-byte signature, and pubkey_hash, the last 20 bytes of keccak256(pubkey). The verification function looks up the public key using pubkey_hash, verifies the signature against the transaction payload hash, and derives the signer's Ethereum address as the last 20 bytes of keccak256(pubkey).

Draft status and open items

This EIP is in Draft status, so the address, gas cost, and format may still change. The path for deriving a private key from a seed, in the Security Considerations section, also remains to be determined (tbd). Test vectors are provided as the NIST KAT file for security level II (mldsa_nist.rsp) and an EVM-version vector file in the same format (mldsa_evm.rsp). The reference implementation uses the NIST submission code for the standard version and ZKNOX's implementation for ML-DSA-ETH. There is no core developer call decision yet on fork inclusion.

Original EIP · ← EIPs