GKR Circuit Visualizer — a step-by-step visualizer of a GKR proof of a layered circuit

GKR Circuit Visualizer

Apogee VM proves every shard's circuit with GKR. The circuit is a stack of layers ending in a few roots, and one sumcheck per layer turns a claim about the layer above into a claim about the layer below, until all that remains is one value of each committed column at a single point. This page runs that procedure end to end on a sixteen-row circuit and prints every number it touches: the forward pass layer by layer, then every round of every layer sumcheck, with the prover's and the verifier's side of each step shown together.

Launch the visualizer → Opens in a new tab · runs in the browser · needs 1024 × 600 or wider

Scope. The GKR engine of Apogee's specification and the checks a shard runs after it, on one shard with no polynomial commitment or recursion around it. The field is F65537 rather than BN254's Fr, so every value fits on screen.

The circuit

A 4-bit accumulator runs twelve cycles, adding the cycle number each time and keeping the carry; four padding rows fill the table to sixteen. Five columns are committed. A sixth, the row index, is a virtual table: never committed, and evaluated by the verifier itself. The gates follow the way Apogee assembles a family circuit:

GatesKindWhat they write
Layer 1row-wiseA memory read leaf and write leaf per row, the RANGE4 channel's table and lookup fractions, and three enforcing gates that must vanish on every row
Layer 2row-wiseEach memory side copied up; the two fractions added
Layers 3–6halvingTreeProduct on each product tree, TreeCross and TreeProduct on the fraction tree, 16 → 8 → 4 → 2 → 1: a read root, a write root, and the channel's numerator and denominator
One sumcheck per layer

Each transition starts from claims about the layer above at a point p. A challenge λ folds them, with any enforcing gates beside them, into one claim c, and a single sumcheck proves c = Σy eq(p, y)·S(y), where S is every gate of the layer weighted by a power of λ. In each round the prover evaluates eq·S at four nodes over every pair of rows, interpolates a cubic and sends its four coefficients; the verifier checks g(0) + g(1) against its claim and draws the next coordinate.

the claim moves
layer k + 1 at p  →  layer k at (r, τ)
The prover states each column at r, both children on a halving layer; the verifier tests the values against eq(p, r)·S, and a final challenge τ joins the two children on one line.
Five provers
ProverWhat it doesCaught by
HonestProves the trace as executedAccepted
Bad gateFlips one carryThe layer 1 → 0 sumcheck, in its first round
Out of rangeLeaves one sum unreduced and takes the carry a row laterThe RANGE4 root, whose numerator is not 0
Bad readReads a value the previous row never wroteThe memory argument
Forged rootClaims the RANGE4 channel balancesThe opening

The last is the case GKR is built for. Every round and every final check passes, because a dishonest prover can always restate its lie at the next random point, and the claim chain shows the lie moving down layer by layer. It cannot restate a committed column, and that is where the opening catches it.

What is real, and what is small
  • Real. Apogee's layer model, gate shapes and kernel; the transcript schedule and tags; the batching, the cubic rounds, the final checks and the child lines; the duplex sponge with Apogee's framing.
  • Small on purpose. Sixteen rows over a 17-bit field. The sponge keeps Apogee's Poseidon2 shape with its round constants reduced mod p, so it mixes but is not secure. Witness digests stand in for the commitments, and folding each column at the final point stands in for the Mercury opening.
  • Simplified. One register, touched once a cycle, so a read's timestamp is its row index. The memory challenges come from a one-sponge stand-in for the global phase.
How it was checked
  • The shipped script is the tested script: the Node harness extracts it from the page.
  • The same sponge code, handed BN254 arithmetic, reproduces Apogee's transcript vectors: all 128 Poseidon2 permutations, and every transcript case that absorbs no bytes.
  • 127,174 assertions across 112 instances and all five provers: every round sum, final value and child line against direct sums over the cube, and every verdict where it should fall.
  • A click-driven probe walks every step of every prover at six screen sizes, and a self-test reruns the main checks in the browser.
Launch the visualizer → Keys: → step · ← back · Enter run · R reset · N reseed · C next prover · T tree map · G gates · L legend · ? spec

Specification: Apogee VM, The GKR engine, with the fraction tree of Lookups §6 and the memory leaves of The memory argument §2. GKR: Shafi Goldwasser, Yael Tauman Kalai and Guy Rothblum, Delegating Computation: Interactive Proofs for Muggles, STOC 2008. Fraction trees for LogUp: Shahar Papini and Ulrich Haböck, Improving logarithmic derivative lookups using GKR, IACR ePrint 2023/1284.