Sparse GKR proof engine for state synchronization
Lighter to prove.
Faster to check.
StateSync-GKR proves that a record is present, absent or correctly changed under a published state root. Its GKR core extends to other layered computations, and the path from state meaning to verification is machine-checked in Isabelle/HOL.
less memory to generate the same proof
Peak process RAM on v1.2.0, 88.87× lower than the engine's own dense baseline (89.46× on v1.1.0). Same circuit, field and prover driver; two-layer mixed circuit of width 4,096.
faster to verify the same proof
The same proof checked with derived wiring instead of the table-based baseline, tree depth 32; 10.80–23.68× across operations and depths 24 to 32. Preparation is outside the timer, and v1.2.0 keeps the same verifier.
requests a second on one server, each proof accepted within 1 s
One 192-core VM over one connection, every proof verified by a separate frontend, held for 30 minutes and 5.94 million requests. A ≥ marks a lower bound: two connections passed 5,000/s, and v1.1.0 was offered at most 1,150/s.
99th-percentile latency at 1,000 requests a second
Both versions on one 192-core VM on the same day, median of three 60-second runs each; v1.2.0 in its default continuous mode. Latency runs from sending a request to accepting its complete proof against that request.
Measured, not projected
Every number comes
from a controlled run.
Every chart states its conditions, and version gains count only against v1.1.0 measured on the same instance types the same day. The engine paper's appendix keeps every run: 367 panels in 47 figure families.
More requests within one second on every machine size.
Highest offered rate at which every request was accepted within 1 s, with v1.1.0 measured the same day. On 192 cores three 60-second runs confirm the one-connection value and 15-second screens the two-connection value; 48 and 96 cores ran 15 to 20 seconds per rate. The limit was server CPU on 48 cores and one connection's reply traffic on 96 and 192. A ≥ marks a lower bound. Past their limits v1.2.0 completed 3.31 times (48 cores) and 4.10 times (96 cores) as many requests per second as v1.1.0.
From 100 to 2,500 requests a second, the tail barely moves.
Median p99 per offered rate on one 192-core server; bands span the runs, of 15 to 60 seconds each. v1.1.0 was measured the same day and not offered above 1,150 per second. From 3,000 to 3,300 per second v1.2.0 held 35 to 51 ms; above that, one connection is the limit. Batch-fused mode held 94 to 109 ms up to 1,200 per second.
Independent proofs scale with the cores you give them.
Prepared proving at depth 24, batch 768, three processes per point on a two-socket bare-metal host. Grey lines are v1.1.0 measured the same day at 1, 48, 96 and 192 workers; v1.2.0 completed 2.41–2.71 times as many proofs per second there, with the same proof bytes in 13,824 comparisons. Worker counts are threads on one machine; witness generation, encoding and transport are excluded.
Fifteen minutes at 500 requests a second, and no queue builds.
One 900-second run per version at 500 requests per second on a 48-core server. v1.1.0 is the earlier campaign's run (48 workers, batch 48); v1.2.0 runs in continuous mode. The lower panel shows each second's range and mean of the worker queue. Both runs accepted all 450,000 requests within 500 ms, with a whole-run p99 of 267 ms for v1.1.0 and 33.4 ms for v1.2.0.
Inside the engine
Sparse where it counts.
Shared where it repeats.
Two design rules explain the memory and repeated-setup results. Store only the gates a circuit actually has, and prepare everything that stays the same once, so each request pays only for its own witness (glossary) and proof.
Keep the gate list sparse.
The dense baseline (glossary) builds six square tables of input pairs for every layer, and that is where its memory goes. The sparse prover (glossary) records only the gates that exist, in two passes.
Storage grows with the square of the input width.
Two-phase booking avoids the square tables.
Prepare once. Prove many.
The circuit, its derived wiring (glossary) and its commitment are built once per operation and configuration. Every request still gets its own witness, transcript (glossary) and proof.
Own witness
Own transcript
Proof AOwn witness
Own transcript
Proof BOwn witness
Own transcript
Proof CNine mechanisms
Each advantage has
a mechanism behind it.
Some mechanisms are measured directly. Others follow from the source structure, from rejection tests or from the formal model. Each one names the evidence it rests on.
More work fits in the same memory.
The prover books only the gates a layer has, not six square tables of input pairs. At width 4,096 that is 88.87 times less peak memory than the engine's own dense baseline on v1.2.0 (89.46 on v1.1.0), and v1.2.0 makes 93 to 94 percent fewer allocation calls per proof.
Verification skips repeated work.
Regular connections are derived from the circuit's structure instead of looked up, so the same proof verifies 10.80 to 23.68 times faster than with table wiring (glossary) (measured on v1.1.0, whose verifier v1.2.0 keeps). The formal model states the equivalence.
Hash rounds stay compact.
Native cube gates (glossary) and fused affine steps (glossary) express the supported hash rounds with fewer intermediate wires and layers. This is a structural property of the circuit.
Proofs grow slowly with depth.
Path constraints (glossary) widen the circuit within the same layer schedule. From tree depth (glossary) 24 to 32 the inclusion proof grows by about 2.93 percent, while the total work still grows with the path.
Setup is paid once.
Circuit, derived wiring and commitment are prepared once per operation and configuration. At depth 24 with v1.2.0, per-request proving time is 7.19 to 10.13 times lower than preparing fresh for every request.
Each proof keeps its own lane.
Caller-sized worker pools run independent proof jobs, each with its own witness, transcript and proof. In v1.2.0's continuous serving (glossary) a worker starts the oldest waiting request as soon as it is free, so no request waits for a batch (glossary) to fill.
Deleted and never-written stay distinct.
Empty, occupied and tombstone (glossary) leaves stay distinct, so a deleted record is never confused with one that never existed. An absence proof accepts either an empty or a deleted slot.
A proof answers only its own request.
The encoded verifier (glossary) checks the original request, the complete proof and its settings together, and rejects malformed bytes and any proof for a different request. That binding lets v1.2.0 return replies in completion order, matched by job identifier (glossary).
A core you can build on.
The layered-circuit (glossary) core is separate from the sparse-Merkle compiler. A new frontend supplies its own circuit and inputs, and settles the final input checks the core leaves to it.
Where it fits
Built for systems
that prove state.
Anywhere a record has to be shown present, absent or correctly changed against a committed root (glossary), and anywhere a computation can be written as a layered circuit.
Registers and ledgers
Show that a holder is on a register, that an address is absent from a restricted list, or that a holding changed correctly, against a published root.
State commitments
Prove membership, absence and single-record updates for rollups, app-chains and synchronization layers that keep their state in the engine's sparse Merkle tree (glossary).
Authenticated data
Give a key-value store or registry a checkable answer to whether a key is present, absent or updated, checked against a root the client already trusts.
Your own circuit
Use the sumcheck (glossary) and GKR (glossary) core directly for a computation written as a layered circuit, from machine-learning arithmetic to data pipelines, through a frontend you build.
Formal verification
Machine-checked
from state to proof.
Every link from a state change to an accepted proof is a theorem the Isabelle/HOL (glossary) proof checker accepts, and a refinement theorem (glossary) connects the shipped Rust verifier to that model under stated conditions.
- 01
State semantics
Membership, non-membership and updates are given a formal meaning.
- 02
Circuit compiler
In the compiler model, the compiled circuit accepts exactly the valid state operations.
- 03
GKR soundness
A false claim survives only within a proved bound, in the exact field the verifier uses.
- 04
Composition
In the model, one machine-checked bound covers the whole path from a state operation to its proof.
- 05
Rust verifier
A separate conditional theorem places each accepted run of the shipped verifier in the model's bounded event, given a stated value correspondence.
For developers
Three commands
to your first proof.
The quickstart builds one membership request, proves it, verifies it and shows a tampered proof being rejected, all on your machine. The documentation takes you on to batching, encoding and integration.
$ git clone https://github.com/Oraclizer/statesync-gkr.git
$ cd statesync-gkr
$ cargo run --release --locked --example state_sync_prove_verify
honest-proof=PASS
tampered-proof=REJECTED
secondary-finalized=falseLicensing
Free to build and test.
Commercial for production.
The source is available under the Business Source License (glossary) (BUSL-1.1). Research, development and testing are free. Generating proofs in production requires a commercial license (glossary); verifying proofs stays free, even in production.
Research and development
Study, modify, test and benchmark the engine in any non-production setting.
Verifying proofs in production
Run, embed or distribute the verifier in production solely to check proofs.
Generating proofs in production
Production proving, embedding the prover in a product or service, or proving for others.