Context
Three independent implementations must agree byte for byte, and a disagreement is silent until a
claim fails on-chain with InvalidProof:
- The circuit's public signal order (
circuits/membership.template.circom + the generated component main {public [...]} line).
- The contract's
public_inputs vector order (contracts/sharibo/src/lib.rs, in claim).
- The SDK's G1/G2 byte encoding and field-element serialisation (
packages/client/src/prove.ts).
Plus the external nullifier derivation, which is implemented twice — compute_external_nullifier in
Rust and computeExternalNullifier in TypeScript — and must produce identical values.
Each site has good comments. None of them is authoritative, and the recipient-binding work will change
the signal order in all three at once.
Where to build it
- New file
docs/wire-format.md.
circuits/membership.template.circom, contracts/sharibo/src/lib.rs, packages/client/src/prove.ts — replace the local prose with a pointer to the document.
test-vectors/ — the fixtures that make it checkable.
What to do
Acceptance criteria
- All three implementations point at this document instead of describing the format themselves.
- The document is validated by the committed test vectors, not just prose.
Context
Three independent implementations must agree byte for byte, and a disagreement is silent until a
claim fails on-chain with
InvalidProof:circuits/membership.template.circom+ the generatedcomponent main {public [...]}line).public_inputsvector order (contracts/sharibo/src/lib.rs, inclaim).packages/client/src/prove.ts).Plus the external nullifier derivation, which is implemented twice —
compute_external_nullifierinRust and
computeExternalNullifierin TypeScript — and must produce identical values.Each site has good comments. None of them is authoritative, and the recipient-binding work will change
the signal order in all three at once.
Where to build it
docs/wire-format.md.circuits/membership.template.circom,contracts/sharibo/src/lib.rs,packages/client/src/prove.ts— replace the local prose with a pointer to the document.test-vectors/— the fixtures that make it checkable.What to do
u64 circle_id || u32 round, reduced mod r. Note that both implementations must agree on byte order, and point at the test that proves it.vk.iclength aspublic_inputs + 1.Acceptance criteria