ByAUJay
Could You Explain How Proof Aggregation Can Cut Gas Costs for a Rollup I’m Launching?
Summary: Proof aggregation compresses many ZK proofs into one verifier call, trading off proving time for dramatically lower, more predictable L1 gas. If you’re launching a rollup in 2026, combining recursion/wrapping with careful public‑input minimization and EIP‑4844 blob planning can reduce per‑batch verification to a few hundred thousand gas while keeping data availability cheap.
Why this matters for decision‑makers
On Ethereum after Dencun (activated March 13, 2024), posting transaction data can be cheap via blobs, but verifying proofs still consumes regular EVM gas. Aggregating proofs lets you pay the “verification tax” once per batch rather than once per proof, which is where a large share of non‑DA L1 cost still hides. (blog.ethereum.org)
First principles: where your L1 gas goes today
- Data availability (DA)
- With EIP‑4844, rollups can post data into blobs: each blob is 131,072 bytes, max 6 blobs per block, with a target of 3 blobs per block and a separate EIP‑1559‑style “blob base fee.” That keeps DA costs low and decoupled from EVM gas spikes, but you still pay for verifier execution in normal gas. (eips.wiki)
- Proof verification
- Ethereum’s BN254 pairing precompile (EIP‑1108) prices the core pairing check at 45,000 + 34,000·k gas for k pairings; a typical Groth16 verifier lands ~200k–300k gas plus a per‑public‑input term. (eips.ethereum.org)
- Empirically, Groth16 verification cost ≈ 207,700 + 7,160 × l gas, where l = number of public inputs. This is why public‑input minimization matters. (hackmd.io)
- Raw STARK verification on‑chain is significantly costlier (hundreds of ops beyond pairings) and is usually avoided on L1 in favor of “STARK → SNARK” wrapping. (jolt.a16zcrypto.com)
Bottom line: after EIP‑4844, DA is cheaper and elastic; verification gas is your stubborn fixed cost. Aggregation attacks this fixed cost.
What “proof aggregation” actually does
“Aggregation” means you:
- create many leaf proofs,
- compress them (recursively or via a dedicated aggregator) into one “super‑proof,” and
- verify that single proof on L1.
The one L1 verify call is the same order of magnitude whether you aggregated 2 or 2,000 leaf proofs; the per‑proof L1 cost approaches zero as batch size grows. (docs.electron.dev)
Three practical aggregation patterns (and when to use each)
1) Recursive accumulation and wrapping (STARK/FRI → SNARK/KZG)
- How it works
- Leaf proofs (often STARKs from a zkVM or custom circuits) are verified inside a recursion circuit; the result is wrapped into a succinct pairing‑based SNARK so Ethereum only verifies the tiny wrapper proof. (dev.risczero.com)
- What it costs on L1 (illustrative)
- Succinct SP1’s wrapped proof verifies for roughly 275k–300k gas on Ethereum/Bases/Arbitrum/Scroll. zkSync Era’s Boojum upgrade reduced their per‑batch L1 verification from ~760k to ~460k gas. Jolt estimates a raw on‑chain STARK verifier around ~2M gas without such wrapping. (succinct.xyz)
- When to use
- High‑throughput rollups where the leaf prover is STARK‑based or a zkVM. It’s the mainstream path for L2s that want predictable, low L1 verify gas and wide EVM support.
Operational tips:
- Keep public inputs tiny; pack them into one hash so the wrapper verifier has l ≈ 1. Polygon’s FFLONK/Groth16 verifiers explicitly recommend “hash‑the‑publics” to avoid the ~7k gas per public signal penalty. (docs.polygon.technology)
2) SNARK‑level aggregators (pack many SNARKs into one)
- How it works
- If you already produce many Groth16/Plonk proofs (heterogeneous statements), you can aggregate them using schemes like SnarkPack or newer folding constructions; the verifier runs in O(1) or O(log n) time. (research.protocol.ai)
- Real‑world numbers
- SnarkPack aggregated 8,192 Groth16 proofs in ~8–9s on a 32‑core CPU, verifying the aggregate in tens of milliseconds off‑chain, then one L1 verifier call. Newer “folding” schemes (e.g., Mira, SnarkFold) further cut prover memory/latency while keeping constant‑size or log‑size verification. (research.protocol.ai)
- When to use
- Multi‑app proof hubs, or rollups with many independent circuits (e.g., per‑transaction membership proofs) where you don’t want to redesign the stack around a zkVM.
Operational tips:
- Budget gas with a simple formula: per‑proof L1 gas ≈ (base_verifier_gas / N) + per‑proof bookkeeping. For Groth16, base_verifier_gas is ~200k–300k and bookkeeping can be kept small if the aggregate verifier has l ≈ 1. (hackmd.io)
3) External verification/aggregation networks (AVS and shared provers)
- How it works
- Offload heavy verification to an AVS (Actively Validated Service) or a shared prover network; the network returns an attestation (e.g., aggregated BLS signature) and/or a compressed proof. This can slash on‑chain gas by an order of magnitude but changes the trust/latency profile. (blog.alignedlayer.com)
- Examples and numbers
- Aligned’s Proof Verification Layer verifies thousands of proofs off‑chain and posts a single result back, claiming 90–99% per‑proof L1 gas reduction, with a separate “Proof Aggregation Service” for recursion when you need on‑chain final proofs. (blog.alignedlayer.com)
- StarkWare’s SHARP aggregates heterogeneous Cairo programs (think “UberPool for proofs”), reportedly bundling ~220k tx into one STARK proof; the on‑chain cost is shared across all participants. (starkware.co)
When to use:
- If you want near‑zero on‑chain verification gas immediately and can accept AVS assumptions, or if you want to pool across multiple apps for economies of scale.
Worked examples you can budget against
Example A — You plan to post a proof every 2 minutes
- Without aggregation:
- Suppose you produce 12 small Groth16 proofs per 2‑minute window. Each verify ≈ 207,700 + 7,160·l gas. If l ≈ 4 per proof, that’s ≈ 236k gas each, ≈ 2.8M gas per 2 minutes.
- With recursion/wrapping:
- Aggregate the 12 into one wrapped SNARK with l = 1. L1 cost ≈ 275k–300k gas total. Savings ≈ 90%+, with negligible per‑proof gas. (succinct.xyz)
- Interpretation:
- You’ve turned a linearly scaling verification bill into a flat fee. You’ll pay marginal proving time off‑chain instead of marginal gas on L1.
Example B — Cross‑app aggregator (shared service among 10 dapps)
- Baseline:
- Each dapp posts a Groth16 once per hour: 250k gas × 10 = 2.5M gas/hr just for verification. (hackmd.io)
- With an aggregator service:
- Aggregate all proofs into one “super‑proof”: base ≈ 300k gas per hour. Per‑dapp allocation: ~30k gas/hr. If you also use per‑dapp inclusion attestations, budget ~16k–25k gas per query/inclusion call. (docs.electron.dev)
How EIP‑4844 changes the calculus (and how it doesn’t)
- Blobs are fantastic for DA: 131,072‑byte blobs, target 3 per block (max 6), with a separate EIP‑1559 fee that typically sits near the floor unless there’s a blob rush. Pack your batch data to fill blobs; don’t leak paid but unused capacity. (eips.wiki)
- But proof verification still uses normal gas. This is why aggregation remains central post‑4844: it’s the lever for the non‑DA costs. (blocknative.com)
Engineering moves that cut real gas today
- Minimize public inputs to your outer verifier
- Every extra public signal adds ~7k gas on Groth16/FFLONK verifiers. Hash your public IO (Keccak) and pass a single field element. Polygon’s zkEVM “Aggregator” docs show the exact pattern. (hackmd.io)
- Choose the right wrapper and curve
- Ethereum BN254 pairings are cheap after EIP‑1108; 2–3 pairings dominate the fixed cost. If you don’t need 128‑bit security for the outermost proof, BN254 remains the pragmatic choice for L1 verification cost. (eips.ethereum.org)
- Use recursion trees sized for your prover topology
- If your prover fleet is GPU‑heavy and latency‑sensitive, shallow trees with a fast zkVM (e.g., SP1) plus a single wrap can hit ~275k–300k gas on L1. If you’re combining heterogeneous proofs, a fold/aggregate phase (SnarkPack/Mira/SnarkFold) prior to wrapping can reduce total proving time and contract size. (succinct.xyz)
- Batch sizing formula to find your sweet spot
- Per‑proof L1 gas ≈ (Gbase / N) + Gmeta. Example: if your outer verifier is 300k gas and you add ~7k gas of metadata per included proof, then:
- N = 32 → ≈ 9.4k + 7k ≈ 16.4k gas/proof.
- N = 256 → ≈ 1.2k + 7k ≈ 8.2k gas/proof.
- Use system‑specific constants (e.g., Nebra UPA quotes ~18k verify/proof + ~22–25k for per‑proof result queries, depending on flow). (docs.nebra.one)
- Align blob posting with aggregator cadence
- Target full blobs to avoid paying for padding; plan for 3‑blob target/6‑blob max behavior when scheduling posts during peak L2 activity. If the blob base fee spikes, delay non‑urgent posts or fall back to calldata for critical anchors. (eips.wiki)
- Pick audited verifier templates and watch per‑chain precompiles
- Use well‑reviewed verifier generators (e.g., gnark’s audited verifiers, PSE’s Halo2/Solidity toolchain; for zkVMs, integrate vendor‑supplied verifiers). Do not assume all EVM chains match Ethereum’s precompile gas; some change pairing costs, which can break hardcoded gas stipends. (github.com)
“How much will aggregation save me?” — concrete scenarios
-
ZK rollup with small circuit per block (Groth16), l = 4
- No aggregation: ~236k gas × 60 blocks/hour ≈ 14.2M gas/hr.
- Aggregate hourly: one ~300k gas verify + N×bookkeeping. With N = 60 and ~7k gas/proof metadata, ~300k + 420k = 720k gas/hr. Savings > 94%. (hackmd.io)
-
zkVM rollup (STARK proofs), wrapped to SNARK
- Direct STARK verification on L1 could approach ~2M gas per proof. Wrapping brings it down to ~275k–300k once per batch. At 6 batches/hour, save ≈ 10.2M gas/hr vs direct STARK verifies. (jolt.a16zcrypto.com)
-
Multi‑chain relay/oracle network
- Thousands of micro‑proofs per hour are infeasible to verify individually (Ethereum’s ~45M gas/block would cap you at ~15 Groth16 verifies/sec). Aggregating to a single on‑chain result or offloading to an AVS turns a hard throughput ceiling into a policy choice. (blog.alignedlayer.com)
Implementation checklist (rollup founder edition)
- Proof system
- If you’re STARK‑native: plan a STARK→SNARK wrap for L1. If you’re SNARK‑native: decide between direct recursion vs an external aggregator (SnarkPack‑style). (zksync.io)
- Public I/O discipline
- One public hash, everything else private. Keeps your outer verifier at l = 1. (docs.polygon.technology)
- Verifier contract choice
- For Halo2/KZG or PLONK: audited Solidity verifiers or generator toolchains; for zkVMs (RISC Zero, SP1), use the vendor’s minimal Groth16 verifier contracts and deploy only once. (github.com)
- Batch size and cadence
- Size N to fill blobs and meet latency SLOs; revisit after traffic is real. Start with N ∈ [32, 256] to get per‑proof costs in the low tens of k‑gas. (eips.wiki)
- Monitoring and fallback
- Watch blob base fee and gas spikes; support switching batch timings or temporary calldata anchors if blobspace is saturated. (blocknative.com)
- Multi‑chain readiness
- If you might verify proofs on other EVMs, re‑test verifier gas there; do not assume EIP‑1108 parity. Some networks price pairings differently. (infsec.io)
Emerging practices you can adopt in 2026 builds
- FFLONK/FF systems as outer verifiers
- Comparable constant term to Groth16 and lower per‑public‑input cost; Polygon exposes an FFLONK verifier and recommends single‑input designs. (docs.polygon.technology)
- Folding‑based aggregators
- Schemes like Mira and SnarkFold target constant verifier cost and smaller memory footprints, useful for large heterogeneous batches before wrapping to a pairing SNARK. Track these if your batches contain thousands of distinct circuits. (eprint.iacr.org)
- High‑performance zkVM stacks
- SP1 shows wrapped proof verification ~275k–300k gas and continues to push real‑time proving; this can simplify your pipeline: write programs in Rust, recurse within the VM, and emit a single L1‑friendly proof. (succinct.xyz)
Pitfalls we see (and how to avoid them)
- Assuming calldata got cheaper after 4844
- Only blob DA got the new market; calldata pricing is unchanged. Use blobs for DA; keep verifiers tight for gas. (blocknative.com)
- Over‑exposing public inputs
- Every extra public costs ~7k gas. Hash them. (hackmd.io)
- Hardcoding gas stipends for pairings across chains
- Ethereum BN254 pairings follow EIP‑1108; some EVM chains do not. Parameterize or probe at runtime to avoid DoS via under‑provisioned gas. (infsec.io)
- Ignoring contract size limits
- Naive code‑gen verifiers can hit EVM bytecode limits. Prefer compact, audited templates from mature toolchains (gnark/PSE) or zkVM‑supplied verifiers. (github.com)
Quick decision flow
- Are you STARK‑native or zkVM‑first?
- Yes → Use recursion + SNARK wrapping; target ~275k–300k gas outer verifier. (succinct.xyz)
- Are you SNARK‑native with many small, heterogeneous proofs?
- Yes → Use a SNARK‑level aggregator (SnarkPack/folding), then one outer verify. (research.protocol.ai)
- Need near‑zero on‑chain gas per proof and can accept external verification assumptions?
- Consider an AVS (e.g., Aligned) and anchor periodically with a wrapped proof. (blog.alignedlayer.com)
Implementation pointers
- Ethereum verification cost model: use EIP‑1108 pairing formula (45,000 + 34,000·k) to sanity‑check verifier gas. (eips.ethereum.org)
- Groth16/FFLONK gas budgeting: 207,700 + 7,160·l for Groth16; design outer circuit so l = 1. (hackmd.io)
- zkVM stacks with ready verifiers:
- SP1: ~275k–300k gas on EVM chains for wrapped proofs; production verifiers deployed on mainnet L1s. (succinct.xyz)
- RISC Zero: Bonsai produces Groth16 receipts with a standard on‑chain verifier interface. (dev.risczero.com)
- SNARK aggregator references:
- SnarkPack (Groth16 aggregation, log‑size/log‑time). (research.protocol.ai)
- Mira/SnarkFold (folding for pairing‑based arguments; constant‑size verifier focus). (eprint.iacr.org)
The executive‑level takeaway
- EIP‑4844 removed most of the DA pain; the remaining L1 cost driver is proof verification.
- Proof aggregation moves you from O(n) verifier calls to O(1) per batch.
- In practice, well‑designed stacks land in the 200k–300k gas range per batch on Ethereum, with per‑proof L1 cost trending to low tens of k‑gas—or effectively zero if you offload verification to an AVS and only anchor periodically. (succinct.xyz)
If you’re launching a rollup in 2026, plan for: tiny outer public inputs, a wrapped proof verified once per batch, blob‑aware batching, and a clear stance on whether you’ll share an aggregator or run your own.
Appendix: reference facts and constants (for your team’s calculators)
- EIP‑1108 BN254 pairing cost: 45,000 + 34,000·k gas. (eips.ethereum.org)
- Groth16 verify gas (empirical): ≈ 207,700 + 7,160 × l gas. (hackmd.io)
- EIP‑4844 blob size and limits: 131,072 bytes per blob; target 3 blobs, max 6 per block; independent blob‑gas market. (eips.wiki)
- Wrapped zkVM proofs (SP1): ~275k–300k gas to verify on EVM. (succinct.xyz)
- Boojum (zkSync Era) L1 verify per batch: ~460k gas (down from ~760k). (nethermind.io)
- Aggregation services (Nebra/UPA): ~18k verify/proof plus ~22k–25k per‑proof query/read; Electron Labs reports ~380k base for an aggregated batch plus ~16k per proof for inclusion checks. (docs.nebra.one)
- Shared STARK aggregation (StarkWare SHARP): bundles up to hundreds of thousands of tx per proof; costs shared across participants. (starkware.co)
7Block Labs builds, profiles, and operates these pipelines end to end—from leaf circuits and zkVM integration to outer verifiers and blob‑aware posting schedules—so you can budget gas precisely before mainnet traffic hits.
Like what you're reading? Let's build together.
Get a free 30‑minute consultation with our engineering team.

