modexp

Networks:
Ethereum Mainnet
Time range:
Start 2025-12-29T00:00:00Z
End 2026-02-26T23:59:59Z
precompiles execution modexp zk-rollups
Published March 12, 2026

Question

Who is driving modexp usage and what does their call pattern look like?

Background

modexp (0x05) computes modular exponentiation: base^exp mod modulus. Gas cost scales with the size of the inputs (base length, exponent length, modulus length), making it a variable-cost precompile where gas per call is a direct proxy for input complexity.

modexp is the #1 precompile by both call count (25.3%) and gas (37.7%). Over the analysis period it was called 17.8 million times, consuming 71.2 billion gas.

Investigation

Gas distribution

Is modexp usage spread across many different input sizes, or is it one thing?

View Query: precompile_modexp_gas_dist
Loading...

It's one thing. 98% of all modexp calls consume exactly 4,048 gas. Same input parameters, millions of times. The next most common value (500 gas) accounts for just 1.4%.

Top callers

Note: The callers data below covers a smaller window (~6,000 blocks) because the self-join query needed to resolve parent contracts is too expensive to run over the full range. The gas distribution above uses the full 426K-block range.

View Query: precompile_modexp_callers
Loading...

One contract accounts for 94% of all modexp calls: 0x77e3ba096355510e0e9f60d292010b42d662d2b5. It's a ZK proof verifier with 364,000 opcodes that calls modexp as part of proof verification.

Tracing up from the verifier to the top-level transaction:

It's Aztec Network's ZK rollup, submitting epoch root proofs to mainnet. Each proof verification transaction calls the verifier, which does exactly 277 modexp operations as part of the proof math, plus BN128 curve operations (ecAdd, ecMul, ecPairing).

Calls per transaction

Grouping modexp calls by transaction confirms the pattern.

View Query: precompile_modexp_per_tx
Loading...

The spike at 277 says it all. The vast majority of transactions containing modexp calls make exactly 277 of them. These are Aztec epoch proof submissions, about 1,100 per day.

Takeaways

  • modexp is #1 by both call count (25.3%) and gas (37.7%)
  • 98% of calls hit the same gas value (4,048) — this isn't diverse usage, it's one protocol's verification loop
  • Aztec Network's ZK rollup accounts for ~94% of all modexp usage
  • Each epoch proof does exactly 277 modexp calls at 4,048 gas each
  • Aztec submits ~1,100 proof transactions per day, burning roughly 1.2 billion modexp gas daily
  • Repricing modexp (e.g., EIP-7883) would land almost entirely on ZK rollup verification costs