Folding vs full-verifier recursion for PQ signature aggregation in leanVM: measurements and negative results

TL;DR

On an 8 GB M2 running leanVM at commit df7d122, hash-based accumulation did not beat leanVM’s full-verifier recursion inside an aggregator. Our best batching design also missed its 15% gate once the leaf size was tuned.

  • Negative results (D1, D2, D3-S).
    • Folding leanXMSS verifications directly needs at least 7.1M R1CS constraints per signature. That is about 450x leanVM’s per-signature cost (Inferred from measured WARP rates).
    • Folding the whole leanVM step relation runs at 260 ns per witness element, against leanVM’s 55 ns per committed word (Verified rates).
    • Accumulating children’s openings across merges spends about 57k cycles per step to save at most 46k (Verified counts).
  • Cost anatomy (Verified).
    • Verifying one child inside a merge costs 186.8k VM cycles. Its WHIR opening is 55% of that.
    • Merkle hashing is 12% of the cycles but 79% of the Keccak calls.
    • 73% of the JUMP rows are subfield checks.
  • Batched child openings (B’-L1).
    • One shared WHIR opening from level 1 saves 32.8k cycles per child (17.6%, Verified by cost emulation). A round-by-round sketch keeps leanVM’s bounds (Inferred).
    • For 1,500 signatures it is still 2.4% slower at the slot deadline than the baseline at the baseline’s best configuration.
  • Configuration rule (Verified on this machine).
    • A merge node that steps from mu 25 to mu 26 takes 1.4 to 1.8x longer for about 3% more committed words.
    • Aggregating 1,500 signatures as 5 leaves of 300 instead of 6 of 250 keeps the node at mu 25. The deadline drops from 3.11 s to 2.24 s and CPU per slot from 7.99 s to 6.47 s. A cost model that is linear in fan-in and leaf size cannot see this step.
  • Scope. Everything here is inside one aggregator, and gossiped objects stay leanVM proofs. An accumulator would have to carry its leaf’s witness (about 1 GiB at 1,500 signatures) instead of a 265 KiB proof.

1. Question and setting

We asked where, if anywhere, hash-based accumulation (WARP, Arc) beats leanVM’s full-verifier recursion for post-quantum signature aggregation. We counted CPU time, latency at the slot deadline, memory and bytes moved.

Lean Ethereum replaces BLS with leanXMSS signatures aggregated by leanVM proofs. EIP-8292 (draft) defines leaf aggregation, recursive merges and a gossip target of about 256 KiB per aggregate.

The EF design study by Coratger and Setty contrasts two paths. Path A runs a full verifier inside a zkVM. Path B folds and then proves a decider. The study gives no numbers. We found no public Arc implementation. WARP has research code (compsec-epfl/warp), which we ran locally.

Scope: inside one aggregator. An accumulator must carry its witness: about 1 GiB of committed words for a 1,500-signature leaf, against a 265 KiB leanVM proof. Gossip hops therefore stay recursive. Accumulation can only replace recursion between proofs that one machine already holds.

Setup (Verified).

  • leanVM: leanEthereum/leanMultisig (since renamed leanVM) at commit df7d122, built with rustc 1.99.0.
    • Binary tower field: GF(2^64), with challenges in GF(2^192).
    • Keccak-256 as the hash.
    • WHIR in its Ligerito form, over one stacked commitment per proof.
  • Machine: Apple M2 MacBook Air, 8 cores (4 performance, 4 efficiency), 8 GB, fanless, macOS 26.5.2. We treat it as a low-end aggregator.
    • Background swap was 1.4 to 1.8 GiB during timing.
    • Run-to-run noise reaches 10 to 15% on some configurations.
  • Workload: leaves of 250 to 350 leanXMSS signatures at rate 1/4, merged n-to-1 at outer rate 1/4. Merge proofs were 218 to 248 KiB.
  • Metrics: deadline = last leaf + merge. CPU per slot = n x leaf + merge.
  • What transfers: cycle counts, table sizes and committed words are exact and do not depend on the platform. Times are meaningful only as ratios on this machine.

2. Baseline, and what verifying one child costs

Verifying one 250-signature child inside a merge costs 186.8k VM cycles, and that child’s WHIR opening is 55% of it (Verified).

Baseline (Verified).

  • Leaf aggregation: N leanXMSS signatures cost about 18.5k + 805.7 N cycles, with 186.5 Keccak calls per signature.
    • N = 1,500 reproduces the README exactly: 1,227,023 cycles, 2^26.993 committed words, 265.1 KiB proof.
  • Merge: n children over 250-signature leaves cost about 19.4k + 186.8k n cycles.
    • The README’s 2-to-1 recursion figure (542,049 cycles) did not reproduce. We measured 438,675 over 900-signature leaves.
  • Timing on the M2: a 250-signature leaf proves in about 1.0 s. Merges at mu 25 prove at 35 to 44 ns per committed word.
  • No batching today: the merge guest runs a full five-level WHIR opening for every child’s stacked commitment.

Per-child cost inside the merge guest (Verified; exact profiler attribution, 250-signature leaves, rate 1/4):

Component Cycles per child Share
WHIR opening, level 0 56,931.5 30.5%
WHIR opening, level 1 18,815.5 10.1%
WHIR opening, levels 2 to 4, tail and setup 27,375.5 14.7%
Keccak GKR 35.8k 19.2%
Table sumcheck 12.1k 6.5%
Terminal weights 11.3k 6.0%
Bus GKR 9.6k 5.1%
Ring switch and claim batching 6.1k 3.3%
Other (remainder, derived) about 8.8k 4.7%
Total 186,807.5 100%

The WHIR ladder at rate 1/4 folds by 6, 4, 4, 4, 4 with 112, 45, 28, 21 and 16 queries and 17 grinding bits per level.

Two observations (Verified).

  • Merkle hashing is 12.4% of the per-child cycles but 78.7% of its 5,188 Keccak calls. A hash change would move Keccak counts far more than cycles.
  • JUMP rows: there are 12,665 per child.
    • 9,300 (73%) come from assert_in_k subfield (packing) checks.
    • 1,488 come from runtime match dispatch.
    • Loops account for only 567, so loop unrolling cannot shrink this table much.

3. Negative results for hash-based accumulation

None of the three accumulation designs we costed beats recursion inside an aggregator. Each misses by a margin that tuning does not close.

D1: fold signature verifications directly (WARP-style PESAT / R1CS).

  • One leanXMSS verification runs 186 Keccak-f permutations. A bit-level encoding needs at least 7.1M R1CS constraints (Inferred).
  • WARP’s research code has a measured marginal prover rate of about 0.26 us per constraint over Goldilocks on this machine. That gives about 1.9 s per signature.
  • leanVM spends about 4.1 ms per signature, so D1 is about 450x slower (Inferred from Verified rates). Even an ideal 64-way packing of bits leaves about 29 ms, still 7x.

D2: fold the whole leanVM step relation.

  • WARP’s prover cost about 260 ns per witness element. leanVM proves a whole leaf at about 55 ns per committed word. Both are Verified on the M2.
  • That 4.7x gap holds before the bus and Keccak GKR arguments are even expressed as PESAT, and before the final decider (Inferred).

D3-S: accumulate children’s WHIR proximity claims across merges.

  • A child’s level-0 opening costs about 57k cycles in-circuit. Levels 1 and above cost about 46k (Verified).
  • An accumulation step must re-open its own accumulator at level 0. It pays about 57k to defer at most 46k, so it loses on every child (Inferred from Verified counts).

WARP reference point (Verified). WARP’s research code at commit 655e7d5 accumulated 8 instances with M = 2^16 over the BLS12-381 scalar field:

  • prove 1.16 s;
  • verify 1.48 ms;
  • decide 141 ms;
  • proof 189 KB.

WARP needs a large field. leanVM’s witness lives in GF(2^64) with challenges in GF(2^192). The WARP authors list linear-time folding over small fields as open.

A note on WARP’s research code. While running WARP’s research code, we noticed an implementation matter that we consider important. We have reported it privately to the WARP authors and will describe it here once they have responded. We do not expect it to change the WARP rates above (Inferred).

4. Batching the children’s openings (B’-L1)

One WHIR opening shared by all children from level 1 on saves 32.8k cycles per child (17.6%). Yet at 1,500 signatures it is 2.4% slower at the deadline than the baseline at the baseline’s best configuration.

Design.

  • Each leaf runs its own WHIR level-0 round, then stops and keeps its level-1 codeword.
  • The merge verifies each child’s level-0 round as today.
  • It then runs one opening over a virtual word that stacks the children’s level-1 words as extra interleaving rows, with k = ceil(log2 n) extra fold variables.
  • From level 1 on, query counts and 17-bit grinding are unchanged. We checked this against leanVM’s own parameter search.

Soundness sketch (Inferred, not a proof). Treat the merge as one IOP: n child prefixes, then one batched suffix compiled with BCS. The batch transcript is seeded by every child’s statement, roots and claims. Every round-by-round transition then keeps leanVM’s per-transition bound or a stronger one, provided that:

  1. the stacked level-1 word is analysed as one interleaved codeword, whose Johnson list size L_1 does not depend on the alphabet;
  2. folding 2^{4+k} rows uses the mutual-correlated-agreement result leanVM already relies on (Jo 2026/891, Thm 4.4), whose error does not depend on the row count;
  3. the batching challenge \\beta is drawn only after all children’s roots and claims are absorbed.

The only new transition is \\beta.

  • A tuple that agrees with the stacked word on a common large set has each child component in that child’s own list.
  • So for every tuple in the joint list (at most L_1 of them), the combined claim error is a nonzero multilinear polynomial in \\beta.
  • A union bound over the joint list then gives:
\Pr[\text{escape at } \beta] \le \frac{k , L_1}{|\mathbb{E}|} \approx 2^{1.6 + 9.4 - 192} = 2^{-181} \quad (k = 3)

The pitfall is a union over the individual lists instead. That gives L_1^n tuples and only about 2^{-114} at n = 8, below the 128-bit target.

Measured cost. We emulated the cost exactly, not the soundness. An UNSOUND guest variant (V6) does each child’s level-1 Merkle openings at shared positions. It adds the batch transcript, the k extra fold rounds and the per-child combination work, using dummy values where the batch would supply real ones.

Quantity Value Status
Cycles saved per child 32,835 (17.6% of 186,873) Verified (slope over n = 2 to 8)
New per-child work 511.5 cycles Verified (profiled)
Keccak calls saved per child at least 1,134 (about 22%) Verified (earlier variant)
Leaf time saved (levels 1 to 4 not run) 0.103 s Inferred from measured trace spans
Batched native opener at the deadline 0.11 s Inferred
Level-1 data held per child until the deadline about 0.45 GiB Inferred

Gate result. Before timing, we fixed the rule. Each side is compared at its lower-deadline configuration for 1,500 signatures, and B’-L1 must cut the deadline or CPU per slot by at least 15%.

Configuration Side Merge mu Leaf (s) Merge (s) Deadline (s) CPU per slot (s)
6 x 250 baseline 26 0.976 2.132 3.108 7.988
6 x 250 B’-L1 25 0.873 1.305 2.288 6.653
5 x 300 baseline 25 1.059 1.176 2.235 6.471
5 x 300 B’-L1 25 0.956 1.235 2.301 6.125

How to read the table:

  • Leaf and merge times are pooled medians of 6 runs (Verified). B’-L1 rows subtract 0.103 s per leaf and add the 0.11 s opener.
  • Best against best (baseline 5 x 300, B’-L1 6 x 250): B’-L1 is 2.4% slower at the deadline and uses 2.8% more CPU.
  • Most favourable assumptions (a free opener, the maximum leaf saving, lane-model merge times from section 5): the gain is at most 11.4% on the deadline and 10.5% on CPU (Inferred).

At a fixed 6 x 250, B’-L1 does cut the deadline by 26%. Nearly all of that comes from keeping the node at mu 25, and the baseline gets there more cheaply by choosing a larger leaf.

5. Committed size, lanes and the mu step

Two things set a merge’s prove time on this machine: its committed lane count within one mu, and a large jump when the node crosses from mu 25 to mu 26 (Verified).

How leanVM sizes its commitment (Verified from source at df7d122). Each table is padded to a power of two, and the stacked witness has

\mathrm{TC} = 4 \cdot 2^{h} + 2^{k_{bc}} + 2^{6+\tau_K} + \sum_t w_t , 2^{\tau_t}, \quad \tau_t = \lceil \log_2 \mathrm{rows}_t \rceil, \quad \mu = \max(\lceil \log_2 \mathrm{TC} \rceil, 15)
  • Widths: w is 15 for XOR, MUL and DEREF, 8 for SET, 14 for JUMP and 26 for KECCAK.
  • Other terms: h is the memory height and k\_{bc} the bytecode-counter height.
  • Lanes: the prover commits only ceil(TC / 2^(mu-6)) lanes of 2^(mu-6) words, and never encodes the zero tail.
  • Check: TC recomputed from exact row counts matched the printed value in all 8 runs we checked.

Node capacity at mu 25 (Verified). Crossing a power of two adds w x 2^tau words at once, so capacity comes in steps.

Leaf size (signatures) Baseline children at mu 25 B’-L1 children at mu 25 First fan-in at mu 26
250 5 6 baseline 6: JUMP passes 2^16 rows (+14 x 2^16 words). B’-L1 7: memory passes 2^21.
350 5 (exactly 2^25 words) 6 baseline 6; B’-L1 7

The largest leaf that stays at mu 25 is 350 signatures. A 375-signature leaf is mu 26; we tested in steps of 25.

The mu-26 premium (Verified on this machine). Two near-controlled pairs show the jump:

Pair mu 25 run mu 26 run Committed words Time ratio
Baseline, 6 runs each 5 x 300: 1.176 s 6 x 250: 2.132 s 33.55M vs 34.60M 1.81
Baseline, single runs 5 x 350: 1.163 s 6 x 350: 1.637 s 33.55M vs 34.60M 1.41

Stage attribution of the first pair (2 traced proves each; spans Verified, causes Inferred):

Stage mu 25 (ms) mu 26 (ms) Ratio
WHIR iterations, levels 0 to 3 240.1 529.7 2.21
Commit (encode and Merkle) 365.5 625.5 1.71
Bus, other than GKR 63.2 203.5 3.22
Execute 41.1 130.9 3.18
Bus GKR 94.8 132.5 1.40
Keccak reduction 168.5 192.5 1.14
Table sumcheck, ring switch, witness build, tail 139.4 147.2 1.06
Sum of stages 1,112.6 1,961.8 1.76

The Prove-span totals are 1,130 and 1,975 ms.

Reading the attribution (Inferred).

  • The structural part is about 290 ms. Everything after WHIR’s first fold works on objects of 2^(mu-6) entries, so the WHIR rows doubling is expected.
  • The rest looks like memory cost.
    • The commit should grow about 8% (lanes x per-lane encode length: 33 x 2^22 x 22 against 64 x 2^21 x 21). It grew 71%.
    • Bus and execute grew more than 3x while cycles grew 19%.
    • We read the roughly 500 ms excess as memory-system cost: a 3.1 GB footprint on an 8 GB machine, with full codewords held in memory (leanVM’s store mode on Apple silicon).
  • Larger machines may show less. Their premium may sit closer to the structural 0.3 s. We could not test one.

Configuration rule. On this hardware, choose leaf size and fan-in so that the merge node stays at mu 25.

  • With mu-25 leaves of up to 350 signatures, a baseline mu-25 node holds up to 5 children, so 1,750 signatures.
  • For 1,500 signatures, use 5 x 300 instead of 6 x 250. The deadline drops from 3.11 s to 2.24 s (-28%) and CPU per slot from 7.99 s to 6.47 s (-19%), with no protocol change (Verified inputs).

Implication for topology tools (Inferred). A cost model that is linear in fan-in and leaf size smooths over the mu step. leanBench’s topology explorer uses per-machine linear fits of this kind.

  • Such a model over-predicts merges just below a mu boundary and under-predicts merges just above it, by up to about 0.5 to 1 s on this machine.
  • A step-aware model can use the TC formula above: count rows per table, pad each table, sum, then charge per committed lane plus a per-mu term.

6. Where batching could still matter

B’-L1 fits one more child inside a mu-25 node. That only helps an aggregator that must merge more signatures than a baseline mu-25 node holds (Inferred).

  • The window is 1,751 to 2,100 signatures. With leaves of at most 350 signatures, a baseline mu-25 node holds 1,750 signatures and a B’-L1 node 2,100. In that range B’-L1 avoids the mu-26 premium, worth about 0.5 to 1.0 s on this machine.
  • Memory works against it. B’-L1 holds about 0.45 GiB of level-1 data per child until the deadline. Six children plus a 350-signature leaf (3.3 GB footprint) exceed 70% of an 8 GB machine.
  • The cost to adopt it is real. It needs partial leaf proofs, a new batched opener, guest changes and a full soundness proof.
  • Our workloads sit below the window. We assumed 512 and 1,500 signatures per aggregator. If committees push a single aggregator past 1,750, this regime becomes relevant, and the design and soundness sketch above are a starting point.

7. Limitations

  • One machine. An 8 GB fanless M2 with 1.4 to 1.8 GiB of background swap, and 10 to 15% noise on some configurations. The B’-L1 verdict survives this noise. The size of the mu-26 premium may not carry over to other hardware.
  • One commit. leanVM df7d122 (6 Nov 2026). Its planned hash change, RISC-V ISA and zero knowledge will each move these numbers.
  • B’-L1 was emulated for cost, not built. The V6 guest is unsound by construction: dummy values and unconstrained shared positions. Its leaf saving comes from native trace spans, and its opener cost is an estimate.
  • The soundness argument is a sketch of round-by-round bounds, not a proof. It assumes leanVM’s own regime is sound as claimed: Johnson bound, 128 bits per transition, 17-bit grinding.
  • D1 and D2 rest on WARP’s prime-field research code for their rates. A binary-field or small-field folding scheme could change those constants, but not the D3-S argument.
  • Out of scope: recursion across gossip hops, and zero knowledge.

8. Questions for readers

  1. leanVM developers: is the mu-26 jump in commit, bus and execute time expected? Does rebuild mode (REBUILD_OVER_STORE) change it on machines with more RAM? cc @tcoratger
  2. Subfield checks: can the assert_in_k checks (9,300 JUMP rows per child) be batched soundly? A random K-linear combination gives only about 64 bits per repetition.
    cc Tom Wambsgans
  3. EF / leanSpec: what aggregation interval and how many signatures per aggregator should we target? We assumed 1, 2 or 4 s intervals and 512 or 1,500 signatures.
  4. Path B: is folding still under consideration after the binary-field rewrite, and for which hop of the tree? cc @tcoratger
  5. leanBench maintainers: would a step-aware cost model (section 5) be useful in the topology explorer? @unnawut
  6. Larger machines: anyone with a larger Linux machine could rerun the configuration comparison with the scripts below.

9. Related work

We found no prior work that batches WHIR or FRI openings across the children of one recursion node. We also found none that models aggregation-tree cost with table padding.

This rests on a targeted search of the sources below, as of 8 Nov 2026; it is not an exhaustive survey.

  • Hash-based accumulation.
    • Accumulation Without Homomorphism: bounded depth, any linear code.
    • Arc: unbounded depth; accumulates Reed-Solomon proximity claims as a near drop-in for IOP-based PCD.
    • WARP: linear-time prover, straightline extraction.
    • D3-S is our cost check of the Arc-style use inside leanVM.
    • FACS is named in the WARP authors’ talk; we could not locate a paper.
  • Folding over small and binary fields. The WARP authors list linear-time folding over small fields as an open problem. Neo, SuperNeo and PikkuFold are lattice-based. Accordion batches folding with a KZG decider, so it is not post-quantum.
  • Binary-field recursion with deferred claims. A closed Plonky3 pull request (October 2026, since moved to a separate repository) recurses Flock proofs over binary fields.
    • Each node defers the inner circuit’s matrix evaluation as a public claim. Claims on the same matrix fold across children, and the root evaluates each once.
    • It defers a different object than B’-L1: a matrix-evaluation claim, not a PCS proximity opening.
    • Its 2-to-1 XMSS node took 36.9 s on a Ryzen 9 9950X3D with 8 threads, so it is not a latency comparator for leanVM today.
  • Batched openings inside one proof. Opening several committed oracles at shared query positions is standard practice.
    • Examples: batch FRI in Plonky2; per-height FRI groups with shared query indices in recent STARK provers; one WHIR opening over many commitments in Ziren.
    • B’-L1 applies the same idea across a recursion node’s children, from level 1 on.
  • Aggregation topology.
    • leanBench measures leanVM trees with fan-in 2, 4 and 8 over 125-, 250- and 500-signature leaves, at rate 1/4.
    • Its topology explorer predicts feasibility from per-machine linear fits. Section 5 suggests such fits miss the mu step.
    • A survey of Ethereum’s post-quantum consensus (August 2026) lists optimal aggregation-tree construction as an open problem.
  • Soundness of recursion over hash-based SNARKs. PCD from straightline extractors; PCD from arithmetized random oracles; the impossibility of relativized succinct arguments in the ROM.
  • Framing. The EF design study by Coratger and Setty (Path A vs Path B) posed the question this post measures.

10. Reproducibility

Every number above records the leanVM commit (df7d122abbe25cf12e5c8ae992ce6d3505f75372), the command line, the repeat count, and whether it is a median.

Update, 9 Nov 2026: fixes to the WARP reference code

The WARP measurements above use compsec-epfl/warp at commit 655e7d5. While running them, we found two verifier issues and reported them privately to the authors, who responded quickly and asked for a fix.

  1. The Fiat-Shamir transcript did not bind the relation index (the R1CS matrices) or the protocol parameters, so verifier challenges did not depend on the relation being proven. See Weak Fiat-Shamir Attacks on Modern Proof Systems: Weak Fiat-Shamir Attacks on Modern Proof Systems
  2. The verifier did not check the number of authentication paths for the fresh commitment. With paths omitted, false shift-query answers could pass verification, as long as they kept the batching claim unchanged. We did not test whether this extends to accumulating a false instance.

Both are fixed in Bind the index into the Fiat-Shamir transcript and check the fresh auth path count: Bind the index into the Fiat-Shamir transcript and check the fresh auth path count by aryaethn · Pull Request #27 · compsec-epfl/warp · GitHub

The fix does not change our measurements. Verify (1.45 vs 1.44 ms), decide (146.2 vs 146.4 ms) and proof size (189,264 B) are unchanged, and the prove difference is within run-to-run noise. Thanks to @WizardOfMenlo and the WARP authors for the fast response.

References

1 Like