Skip to content

docs(circuits): detailed pages for PrimaryTransactionCircuit - #14

Merged
shramee merged 9 commits into
mainfrom
feat/circuits-docs
Nov 28, 2026
Merged

shramee merged 9 commits into
mainfrom
feat/circuits-docs

Conversation

@shramee

@shramee shramee commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #13 (feat/landing-design).

What

Six detailed pages under Circuits, linked from the section overview with RuledIndex, ordered by sidebar.order:

Page Covers
What a spend proves The 2-in/2-out shape, the private inputs, dummy notes, every assertion in PrimaryTransactionCircuit.Define, the two auth_done modes, withdrawal binding, and what the circuit leaves to the Chamber, including that no public input carries the Chamber ID
Public inputs All 14 inputs in order with circuit field, PublicParams field and meaning; field and address encoding; which constraint binds each input; what one spend reveals to an observer and to a key holder
Notes and hashes Note fields, Chamber ID, custody binding, owner commitment, note hash, nullifier and its consequences, the two owner types, Poseidon2 parameters and output reads, Fold2, a table of every hash in use
Merkle trees HM4, prover-ordered insertion (hint bits constrained only to be boolean), the 30-element proof, position independence and pass-through, the three trees and their capacities, cost
Reserve messaging The zkState leaf, messaging on/off gating, the users leaf, the Hash-and-Add keystream and privateTxKey, the six commitment slots and their fold, how the Chamber files them, decryption, limits, and that a removed member is frozen like an unregistered holder
Constraints and trusted setup The measured constraint count and gadget costs, the proof system, the single-party groth16_bn254.Setup with no MPC ceremony, artifacts, and what changing the circuit involves

Three diagrams (spend shape, one Merkle level, the keystream) use the existing diagram grammar. No new CSS.

Sources

Every name, formula and number was checked against core fa7b92d (circuits/src/primary.go, witnesses.go, gadgets/gadgets.go, lib/{hash,merkle,note}, build/.constraint-snapshot, scripts/gen, contracts/src/Chamber.sol, ChamberVerifier.sol, lib/Merkle4.sol). From cf1413d to fa7b92d the circuit changed by one comment line; the snapshot, the circuit source and the verifier are byte-identical. Rationale follows spec/ 01, 03, 04, 05 and decisions.md; where the spec text describes older core, the pages follow the code.

Numbers are measured, not written from intent: PrimaryTransactionCircuit = 17,318 constraints and the gadget costs are the committed snapshot. TestConstraintSnapshotMatchesCompile and TestVerifierPublicInputCountMatchesCircuit were run against exports of both cf1413d and fa7b92d, and pass on both (snapshot matches a fresh compile, 14 public inputs). The pages say that each snapshot gadget figure includes its wrapper circuit's one equality assertion. The Poseidon2 S-box degree (5) was read from gnark-crypto's BN254 poseidon2.go.

Planned items (exit spends, sequential identifiers, relayer fee leg, the multi-party ceremony) are marked Planned.

How it was checked

  • npm ci && npm run check && npm run copyrules && npm run build && npm run linkcheck: all green, after the rebase onto feat(docs): landing design and EVM information architecture #13. In-page anchors checked against the built HTML.
  • Playwright at 1440 and 390 px, dark and light, every page: no horizontal overflow outside table and code frames; the three diagrams read in both themes and stack at 390 px.
  • Independent accuracy reviews against the core source, at cf1413d and again for the fa7b92d update; findings fixed before pushing.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Nov 28, 2026 11:03pm UTC

shramee and others added 9 commits November 29, 2026 04:33
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Count the width-4 uses correctly, say that snapshot gadget figures include the wrapper's assertion, scope the custody rule and note that no public input carries the Chamber ID, point zkState root acceptance at the history cutoff, and describe the setup and drift checks without process claims.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The circuit changed by one comment, so the constraint figures stand: the snapshot matches a fresh compile at fa7b92d. The messaging page now says a removed member is frozen like an unregistered holder, and that the Chamber refuses a users root returning to zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@shramee
shramee merged commit 6745207 into main Nov 28, 2026
3 checks passed
@shramee
shramee deleted the feat/circuits-docs branch November 28, 2026 23:04

This branch was successfully deployed

1 active deployment
Preview — edea7735 Deployed Nov 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant