EIPs Explained

EIP-7885 · Draft · Core · 2025-02-12

EIP-7885: Precompile for NTT operations

Proposes precompiles for the Number Theoretic Transform (NTT), its inverse and vectorized modular add/multiply, so lattice-based post-quantum signatures and STARK verifiers become affordable on-chain.

What problem does it solve?

Ethereum accounts are secured by ECDSA, which a large enough quantum computer could break. The leading replacements, such as the lattice-based signatures FALCON and Dilithium (ML-DSA), spend most of their verification time multiplying polynomials. Done in Solidity, that is very expensive: the spec measures about 1.8M gas for one FALCON verification in hand-optimized Yul.

Rather than adding one precompile per signature scheme, EIP-7885 adds the shared building block: the NTT, the polynomial equivalent of an FFT. With NTT in the EVM, polynomial multiplication drops from O(n²) to O(n log n), and many schemes (FALCON, Dilithium, Kyber, and STARK verifiers over fields like BabyBear, Goldilocks or M31) can be built on top cheaply.

How it works

Polynomials live in the ring F_q[X]/(X^n + 1), where n is a power of two and the prime q satisfies q ≡ 1 mod 2n. Four precompiles are proposed:

Precompile Operation
NTT_FW Forward NTT (negative-wrapped convolution), output in bit-reversed order
NTT_INV Inverse NTT, back to standard order
NTT_VECMULMOD Element-wise a[i] * b[i] mod q
NTT_VECADDMOD Element-wise a[i] + b[i] mod q

Multiplying two polynomials f and g then becomes:

f × g = NTT_INV( VECMULMOD( NTT_FW(f), NTT_FW(g) ) )

The input carries the ring degree, the modulus and the coefficients, so the same precompile serves different schemes. Gas is calibrated per scheme from benchmarks, aiming at roughly the same throughput (about 50–55 Mgas/s) as ECRECOVER; vector operations scale linearly with n.

Sample code

Illustrative pseudocode for verifying a lattice signature with the precompiles (addresses are not final in the spec):

# Polynomial product in Z_q[X]/(X^n + 1) using the proposed precompiles
def poly_mul(f, g, n, q):
    F = call(NTT_FW,  encode(n, q, f))
    G = call(NTT_FW,  encode(n, q, g))
    H = call(NTT_VECMULMOD, encode(n, q, F + G))
    return call(NTT_INV, encode(n, q, H))

# e.g. FALCON-512: n = 512, q = 12289
# A verifier computes s2 * h with poly_mul, adds c with VECADDMOD,
# then checks the result's norm in ordinary EVM code.

Things to know

  • Status is Draft. Precompile addresses are marked TBD in the specification, and the gas numbers and input encoding are still evolving. The security considerations section is unfinished.
  • The prototype in op-geth uses addresses 0x12–0x15, but these are not assigned on mainnet.
  • The spec reports end-to-end tests on an OP-Stack testnet where a FALCON-512 verification fell from about 1.8M gas to under 480K gas.
  • A scheme-specific alternative is EIP-8051, a precompile that verifies ML-DSA signatures directly. EIP-7951 shows the precompile route for a classical (non-post-quantum) curve.

#precompile #post-quantum #cryptography #ntt #stark

Details

Authors
Renaud Dubois (@rdubois-crypto), Simon Masson (@simonmasson), Yoon Hyoung Lee (@yhl125)
Status
Draft
Type
Standards Track / Core
Created
2025-02-12

Machine-readable: Markdown · JSON