SpectrePerformance

Benchmark

Performance · measured numbers, and an honest read of what they mean.

Spectre proves an update in seconds on commodity hardware, where IBC Eureka's SP1 prover takes minutes (~100x slower) on a specialized GPU cluster

Circuit constraints

Measured R1CS constraint counts of the BatchCircuit, generated by TestConstraintBreakdown (relayer/prover/constraint_count_test.go). Methodology: the full circuit is compiled at each bucket size N, then each of the 5 sub-circuits is compiled in isolation and reported as a fraction of the full total.

ComponentN = 1N = 2N = 4N = 8N = 16N = 32
SHA-512 (H_RAM, per slot)178,402223,411313,421493,451853,5011,573,610
ECIP verify (2N points)197,638204,572218,440246,510302,646414,596
SHA-256 witness hash143,141143,908149,916161,926190,615238,661
Fiat-Shamir challenges9,85818,79435,93570,780139,814278,204
Prefix binding2464919811,9613,9217,841
Total484,462548,146679,517943,2131,469,5872,507,617

Two things to read off the table:

  • Batching scales cleanly — each additional slot costs a stable ~65K constraints (63,684–65,924 across the whole range).
  • SHA-512 is the dominant cost at production bucket sizes (N ≥ 16): 58–63 % of all constraints. ECIP scales sub-linearly — a large fixed overhead (~198K at N = 1) but barely growing after, its share falling from 41 % at N = 1 to 17 % at N = 32.

Per-component cost

Cost of each additional slot, measured N = 16 → 32; the remaining ~1K/slot (1.5 %) is uncategorized overhead.

ComponentWhat it doesCost per extra slot
SHA-512 (H_RAM)Per-slot SHA-512(R ∥ A ∥ msg[0:msgLen]) with FixedLengthSum, computing the Ed25519 H_RAM scalar. Includes point compression (Edwards Y + sign of X → 32 bytes).45,007 (69.4 %) — linear, most of what each extra slot costs
Fiat-Shamir challengesTranscript-based derivation of the N per-slot random challenges: MarshalG1(R, A) + ToBinary(msg bytes) bound to a recursion.Transcript, then N × ComputeChallenge + FromBits + Reduce.8,649 (13.3 %) — linear, driven by ToBinary over all MaxMsgLen=192 message bytes
ECIP verifyElliptic Curve Inner Product argument verifying Σ zᵢ·[Sᵢ]·(−G) + Σ zᵢ·Hᵢ·Aᵢ + Σ zᵢ·Rᵢ = 0 over 2N Weierstrass points: hint-based polynomial evaluation, Fiat-Shamir for A₀, ScalarMul, and per-point EvalPointChallengeSigned.6,997 (10.8 %) — sub-linear thanks to degree-based ECIP
SHA-256 witness hashSingle SHA-256(PrefixHead ∥ roundPresent ∥ BlockHash ∥ per-slot(active ∥ A)) producing the 2-element public commitment. Includes compressEdwardsToLE per pubkey (emulated ToBits).3,003 (4.6 %) — mostly fixed; only the hash buffer grows, 33 B/slot
Prefix bindingSelect + AssertIsEqual checking each active slot's Type|Height and BlockHash against the committed values, with per-slot varint-width detection (ToBinary on byte 0).245 (0.4 %) — negligible

Reproduce:

cd relayer
LD_LIBRARY_PATH=../../ecip-gnark go test -v -run TestConstraintBreakdown -timeout 1200s ./prover/

Proof generation

Wall-clock to generate one Groth16 proof for an N-signer quorum batch, on the same circuit across three hardware setups. 10 samples per bucket; the figure is the mean (Go benchmark ns/op), run-to-run variation ±2–7%. Witness build and local verify are sub-20 ms at every bucket, so these are effectively groth16.Prove.

Bucket (N signers)CPU only ¹CPU + GPU ²AWS g6e.2xlarge ³
41.30 s0.91 s0.45 s
81.76 s1.18 s0.79 s
163.04 s2.22 s1.50 s
325.63 s4.55 s3.00 s
6411.50 s9.55 s6.36 s
12822.36 s18.90 s15.00 s

¹ CPU only — Intel Core i7-13700K, native gnark (no GPU). ² CPU + GPU — Intel Core i7-13700K + NVIDIA RTX 4080, ICICLE/CUDA backend. ³ AWS g6e.2xlarge (NVIDIA L40S), ICICLE/CUDA backend.

All three rows are the same circuit version, so this is a clean hardware comparison — and the point it makes is the important one:

A commodity machine is enough. Where IBC Eureka's SP1 prover needs a GPU cluster and minutes per update, Spectre proves a real-world quorum batch (bucket-16) in ~3 s on a plain desktop CPU — no GPU, no special hardware. A single consumer gaming GPU (RTX 4080) takes it to ~2.2 s. Anyone can run a Spectre relayer + prover on hardware they already own.

  • CPU-only is already practical — a desktop i7 proves bucket-16 in ~3.0 s and even a full 128-signer batch in ~22 s, with no GPU at all.
  • A consumer GPU (RTX 4080) cuts ~25–30% off that — an off-the-shelf gaming card, not datacenter kit.
  • A datacenter GPU (L40S on AWS g6e) is the fastest — ~2× the CPU (bucket-16: 1.50 s vs 3.04 s) — but it's purely optional headroom for operators who want the lowest latency. The protocol requires none of it.

On-chain cost

updateApplicationState gas on Ethereum at the production bucket (16 signers) — measured prod, real Groth16 verify included: 617k gas.

The first recvPacket to a fresh client costs ~941k gas (one-time cold-storage init), then each subsequent packet drops to ~324k gas (warm storage), trending lower across a batch — steady-state delivery is ~⅓ the cold first-hit.

On this page