Skip to content

ADR-0068: DSL soundness, PlonK scaling, MPF canonicality & gadget hardening - #125

Merged
satran004 merged 3 commits into
mainfrom
fix/adr-0068-dsl-plonk-mpf-hardening
Nov 21, 2026
Merged

satran004 merged 3 commits into
mainfrom
fix/adr-0068-dsl-plonk-mpf-hardening

Conversation

@satran004

Copy link
Copy Markdown
Member

Summary

Implements ADR-0068 (Proposed, Risk R2) — circuit DSL soundness, PlonK BLS12-381 scaling & batched SRS consistency, Poseidon MPF canonical < Fr key-path conformance, witness validation, and standard-library gadget hardening:

  1. ZkUInt.sub 252-bit cap & MAX_SAFE_BITS documentation:
    • Capped ZkUInt.sub at max(bits, other.bits) < 253 (<= 252), closing BN254 253-bit subtraction underflow wrap-around (2^(bits+1) <= r).
    • Clarified CircuitAPIImpl.MAX_SAFE_BITS to distinguish decomposition uniqueness (2^bits < p, 253 bits on BN254) from difference-underflow safety (2^(bits+1) <= p, 252 bits on BN254).
  2. PlonK BLS12-381 scaling & batched RLC SRS consistency (SrsConsistencyBLS381):
    • Eliminated $O(n^2)$ exponent loops in PlonKProverBLS381.cosetEval, linear powFr (switched to binary square-and-multiply), zetaN (switched to logN squarings), and PlonKSetupBLS381 (omegaPows precomputation).
    • Replaced duplicated $O(n)$ sequential pairings in PtauImporterBLS381 and PlonKSetupBLS381 with a single SecureRandom-challenged batched RLC two-pairing check (SrsConsistencyBLS381), plus a snapshot-verified WeakHashMap fast path that avoids redundant verification on unmodified imported SRS instances while catching any post-import array mutation.
  3. Raw CircuitAPI.{xor,and,or,not,fromBinary} booleanity & width guards:
    • Recorded provably-boolean wires (oneWire, exact constants 0/1, isZero/isEqual, and outputs of xor/and/or/not) in CircuitAPIImpl.booleanWires.
    • Enforced assertBoolean on operands of xor, and, or, and not (zero extra rows for proven booleans; eliminates redundant AssertBoolean rows in circuits such as Jubjub subgroup checks and JMT insert-different-leaf), and bounded fromBinary to 1 <= bits.length <= 253 with non-null checks.
  4. Canonical witness/input validation & curve-generic R1CSConstraintSystem.verifyWitness:
    • Hardened WitnessCalculator (calculate, calculateFlat, calculateFlatChunked) to reject null maps, unknown input keys, multi-value lists, null elements, and non-canonical values (< 0 or >= p) without silent modular reduction.
    • Added typed range validation (BOOL/BITS: {0,1}, BYTES: [0,255], UINT(bits): [0, 2^bits), FIELD: canonical [0, p)) to ZkInputMap and generated Inputs setters / calculateWitness.
    • Added curve-generic R1CSConstraintSystem.verifyWitness (instance and static overloads).
    • Deprecated (forRemoval = true), legacy-gated (LegacyCurvePolicy.requireLegacyBn254Enabled()), and hardened Groth16Prover.validateWitness (wire-0, canonical BN254 scalars, bounds) while preserving the public method surface.
  5. Poseidon MPF canonical < Fr key-path constraint & Step.fork validation:
    • Constrained 64-nibble big-endian key paths in ZkMpf.requireKeyPath (and ZkMpfProof leaf key paths) to be strictly less than FieldConfig.BLS12_381.prime(), matching PoseidonMpfHash.digestToNibbles and docs/merkle/poseidon-authenticated-state-v1.md invariant Review: Groth16 + PlonK end-to-end — findings & public-testnet readiness gates (ADR-0025) #8.
    • Validated skip, neighborNibble in [0, 15], and every fork prefix byte in [0, 15] in PoseidonMpfCodec.Step.fork.
    • Updated pinned MPF R1CS profiles and documented the ~1% terminal-fork rejection rate in docs/merkle/poseidon-authenticated-state-v1.md and ADR-0068.
  6. Gadget fixes & @Prove ZkBool ownership:
    • Fixed LSB-first rotation direction and negative-shift handling in Binary.rotateLeft and SignalBinary.rotateLeft, and guarded Binary.shiftRight against n < 0 and i + n overflow.
    • Added RangeCheck with honest < 2^nBits semantics and deprecated AliasCheck (forRemoval = true) with corrected Javadoc.
    • Added null checks and explicit fixed-arity / non-circomlib collision warnings to PoseidonN.
    • Enforced Objects.requireNonNull + __zeroj.requireSignal(__zerojResult.signal()) before .assertTrue() on non-void @Prove returns in CircuitAnnotationProcessor.

Stacked cleanly on #121 (fix/adr-0066-plonk-ptau-and-zkey-import).

Verification

./gradlew -PrequireSnarkjs \
  :zeroj-circuit-dsl:test \
  :zeroj-circuit-annotation-api:test \
  :zeroj-circuit-annotation-processor:test \
  :zeroj-circuit-lib:test \
  :zeroj-jmt-poseidon:test \
  :zeroj-mpf-poseidon:test \
  :zeroj-crypto:test --tests 'org.zeroj.crypto.plonk.*' \
                     --tests 'org.zeroj.crypto.groth16.Groth16ProverApiSurfaceTest' \
                     --tests 'org.zeroj.crypto.groth16.Groth16EndToEndTest' \
                     --tests 'org.zeroj.crypto.groth16.Groth16ProverValidateWitnessTest' \
  :zeroj-integration-tests:test --tests 'org.zeroj.examples.annotation.*' \
                                --tests 'org.zeroj.it.snarkjs.SnarkjsPlonkInteropTest'
  • All 8 module suites and live snarkjs@0.7.6 .ptau -> setup -> prove -> verify interop tests passed.
  • New negative & regression suites added: ZkUIntSubAndInputMapHardeningTest, CircuitDslHardeningTest, GadgetHardeningTest, PlonKSrsAndScalingTest, Groth16ProverValidateWitnessTest, ZkMpfCanonicalKeyPathAndForkTest, plus expanded tests in CircuitAnnotationProcessorTest and PoseidonMpfOperationWitnessTest.

@satran004

Copy link
Copy Markdown
Member Author

[reviewer1] Changes requested on 63ea72cbc3daad590a13f99da028ed7599d48fa8. My isolated annotation processor, example and live snarkjs 0.7.6 PlonK interoperability run passed all 47 tests.

  1. Use the same SRS points for validation and commitments. PlonKSetupBLS381.validateSrs checks caller-visible arrays, then setup reads them again at line 128 and retains the caller's G1 array in the proving key. The cache lock protects the map only. Pin a private snapshot of the exact required G1 prefix and G2 anchors at setup entry, compare or validate that snapshot, and use it through every commitment, the returned key and X2. An immutable SRS with equivalent ownership guarantees also works. Test that later edits to an importer's or caller's arrays cannot change the key already returned. Record the fixed-input-before-challenge assumption in the ADR and pin a primary reference for the randomized batch equation.
  2. Keep witness values out of exceptions. The new ZkInputMap range checks and WitnessCalculator append the offending scalar, including for private inputs. Both constraint-evaluation branches in R1CSConstraintSystem.verifyWitness include witness-derived left and right sides. These exceptions commonly reach logs. Report the signal/wire or constraint index and the failed rule, and redact values throughout the changed validators, including the legacy helper. Test redaction with a recognizable private value.
  3. Preserve circuit ownership in the new signal APIs. RangeCheck.check(SignalBuilder, Signal) and PoseidonN.hash(SignalBuilder, …, Signal...) unwrap signals without checking signal.isFrom(builder). Raw wire IDs are local to a builder, so the generated constraint can act on an unrelated local signal. Check all owners before emitting gates. Cover foreign signals from builders with overlapping wire IDs and keep same-builder positive controls.
  4. Correct the terminal-fork guidance. The ADR advises retrying or using a branch-only template for total non-inclusion. Retrying a fixed key against an unchanged trie repeats its path, and a branch-only template only covers its supported shapes. Describe the unsupported case and what the caller can actually verify. For the quoted ~1% rate, include a traceable experiment with trie size, key distribution and sample counts, or remove the number from the ADR and state specification.

Copy link
Copy Markdown

Initial automated review · Aster

Hi @satran004, thanks for the PR! 🙏 This is an automatic first check by an AI reviewer. It does not replace maintainer review and may be wrong.

Reviewed commit: 63ea72cbc3daad590a13f99da028ed7599d48fa8

Issues found:

  • zeroj-circuit-dsl/src/main/java/org/zeroj/circuit/r1cs/R1CSConstraintSystem.java:64 — For a failed secret * 1 = public constraint, the exception includes the complete private value, exposing it if errors are returned or logged. Could we report only the constraint index and failed rule?
  • zeroj-circuit-lib/src/main/java/org/zeroj/circuit/lib/RangeCheck.java:43 — A foreign signal with an overlapping wire ID silently constrains an unrelated local wire. Could we check value.isFrom(c) before emitting gates in this new replacement API?

Not tested: Code and tests were read only; I did not run the build, circuit tests, or proof interoperability tests.

@satran004

Copy link
Copy Markdown
Member Author

[reviewer3] Review of head 63ea72cb — APPROVED (engineering, cross-backend and compatibility scope)

What I verified

  • Tests (clean worktree, -PrequireSnarkjs, Java 25). All pass:

    Module Tests Skipped
    zeroj-circuit-dsl 140 1
    zeroj-circuit-annotation-api 25 0
    zeroj-circuit-annotation-processor 32 0
    zeroj-circuit-lib 1,317 26 (existing benchmark / heavy suites)
    zeroj-jmt-poseidon 15 0
    zeroj-mpf-poseidon 49 0
    zeroj-crypto 1,147 2
    zeroj-verifier-plonk 38 0

    The full :zeroj-integration-tests:test run was still going when I posted: about 2,800 tests passed, 0 failed so far.

  • Derived-boolean cache (CircuitAPIImpl.booleanWires):

    • Every new entry is algebraically forced. oneWire and the cached 0/1 constants are Gate.Const wires. isZero's pair a·inv = 1 − r, a·r = 0 pins r ∈ {0, 1} for every a.
    • xor/and/or/not outputs are boolean only because their operands now pass through assertBoolean first.
    • assertBoolean still calls requireNotFrozen() before consulting the cache.
    • The only effect of caching is fewer redundant AssertBoolean gates, and this happens at DSL level, so R1CS, PlonK and Halo2 lowering all see the same reduction.
    • The pinned-profile updates line up with that: ZkJubjubPoint subgroup −1 row, JMT insert-different-leaf −160 rows, and the wire counts are unchanged.
  • SRS batching. In SrsConsistencyBLS381:

    • The anchors are checked first.
    • The SecureRandom challenge is non-zero and below Fr.
    • Both sides use the same weights rʲ with one two-pairing check.
    • Every point is validated individually (canonical, on-curve, subgroup) before the random linear combination, in both the importer's decodeSrsG1/G2 and the setup's requireValidSrsG1 loop. That validation is what makes the batched check sound.

    The setup fast path only skips work when the first requiredG1 elements and both G2 points are value-equal to the snapshot taken at import. It uses a synchronizedMap(WeakHashMap) keyed by the SRS record (array identity), so a mutated or freshly built SRS is re-verified.

  • PlonK O(n²) removals.

    • zetaN uses logN squarings, which is valid because n is a power of two.
    • cosetEval uses incremental shift^i powers.
    • powFr is square-and-multiply. Its inputs (zeta, shift, ω) are all public, so variable time is fine.
    • Setup uses precomputed omegaPows.
    • The live same-power snarkjs .ptau → setup → prove → verify test is still green.
  • Callers of changed APIs. Binary/SignalBinary.rotateLeft (now direction-correct), AliasCheck, fromBinary (now capped at 253 bits), Groth16Prover.validateWitness and the bitwise ops have no other in-repo callers that depend on the old behaviour, and none in zeroj-usecases. Every SHA-2 and Blake2b gadget uses its own rotation helpers, and the NIST and RFC vector suites pass.

  • Generated Inputs. The annotation processor now emits putChecked / putArrayChecked / putNestedArrayChecked with explicit null checks, plus the requireSignal(result.signal()) ownership check on @Prove ZkBool returns. The processor tests cover both.

  • ADR-0068. Relative links resolve.

Non-blocking (P3)

  1. ADR-0068 "Compatibility & Migration Notes" describes the derived-boolean change only as removing rows. Enforcing assertBoolean on xor/and/or/not operands can also add rows (and change keys) in circuits that called these ops on wires not already proven boolean, such as raw secretVar bits or hint outputs. In-repo gadgets feed toBinary bits, which are already cached, so their counts don't move. Downstream circuits can, though. One sentence would cover it.
  2. SrsConsistencyBLS381.VERIFIED keeps a full tauG1.clone() snapshot strongly reachable for as long as the SRS key is alive. At the 2^24 + 6 cap that is about 128 MiB of extra reference array. That is acceptable, but worth a Javadoc line, or snapshot only the first count actually validated.
  3. The MPF < Fr comparison depends on keyPath[0] being the most significant nibble, matching PoseidonMpfHash.digestToNibbles and the big-endian hex in bls12381ModulusNibbles(). The tests cover 64 × 0xF and exactly Fr. A positive case at Fr − 1 would also pin the boundary from below.

@satran004

Copy link
Copy Markdown
Member Author

[reviewer3] Follow-up: the full :zeroj-integration-tests:test run at 63ea72cb has now finished and is green: 127 tests, 0 failures, 0 skipped, including live snarkjs 0.7.6. With that, the whole -PrequireSnarkjs run (9 modules) passed with BUILD SUCCESSFUL. My review stands.

@satran004

Copy link
Copy Markdown
Member Author

Addressed all four Round 1 findings from [reviewer1]:

  1. Caller-isolated SRS snapshot throughout PlonKSetupBLS381 + primary references:
    • PlonKSetupBLS381.validateSrs now defensively copies the exact required domainSize + 6 G1 prefix and 2 G2 anchors into private arrays before cache comparison, subgroup checks, or drawing the SecureRandom challenge, and setup() uses those exact pinned arrays for all 8 selector/sigma KZG commitments and inside the returned PlonKProvingKeyBLS381 (srsG1 and x2).
    • Added a regression test in PlonKSrsAndScalingTest confirming post-setup edits to the caller's tauG1/tauG2 arrays cannot modify the returned proving key and are rejected on subsequent setup() calls.
    • Updated ADR-0068 with the fixed-input-before-challenge assumption and primary references (Bellare-Garay-Rabin EUROCRYPT 1998; Bowe-Gabizon-Miers ePrint 2017/1050 §2.2).
  2. Witness-value redaction across all modified validators:
    • Redacted scalar values and witness-derived linear-combination evaluations from exception messages in WitnessCalculator, ZkInputMap, R1CSConstraintSystem.verifyWitness (both flat and list paths), and Groth16Prover.validateWitness, reporting only signal/wire/constraint identifiers and the violated rule.
    • Added redaction assertions with recognizable private sentinels across ZkUIntSubAndInputMapHardeningTest, CircuitDslHardeningTest, and Groth16ProverValidateWitnessTest.
  3. Signal ownership checks in RangeCheck / AliasCheck / PoseidonN:
    • Enforced signal.isFrom(c) before emitting any gate in RangeCheck.check(SignalBuilder, Signal, int) (inherited by AliasCheck) and PoseidonN.hash(SignalBuilder, PoseidonParams, Signal...).
    • Added foreign-builder tests with overlapping wire IDs alongside same-builder positive controls in GadgetHardeningTest.
  4. Corrected MPF terminal-fork guidance:
    • Removed the ungrounded rate figure and misleading retry / branch-only guidance from ADR-0068 and docs/merkle/poseidon-authenticated-state-v1.md, accurately documenting the unsupported terminal-fork case and directing callers needing total non-inclusion to zeroj-jmt-poseidon templates or a future authenticated terminal-fork witness format.
  5. Warning hygiene: Suppressed [removal] warnings on legacy AliasCheck / Groth16Prover.validateWitness test callers in NewStdlibTest and Groth16EndToEndTest.

Verification

  • ./gradlew -PrequireSnarkjs :zeroj-circuit-dsl:test --tests 'org.zeroj.circuit.CircuitDslHardeningTest' :zeroj-circuit-annotation-api:test --tests 'org.zeroj.circuit.annotation.ZkUIntSubAndInputMapHardeningTest' :zeroj-circuit-lib:test --tests 'org.zeroj.circuit.lib.GadgetHardeningTest' --tests 'org.zeroj.circuit.lib.NewStdlibTest' :zeroj-crypto:test --tests 'org.zeroj.crypto.plonk.*' --tests 'org.zeroj.crypto.groth16.Groth16ProverValidateWitnessTest' --tests 'org.zeroj.crypto.groth16.Groth16EndToEndTest' — PASSED (zero skips, zero [removal] warnings).

@satran004

Copy link
Copy Markdown
Member Author

[reviewer1] Changes requested on fcd4ad37bb1df7a06ff44974c3d8d236f02d9911. Three earlier findings are resolved. Setup validates and consumes the same privately copied G1 prefix and G2 anchors through key construction. The range and Poseidon signal wrappers check builder ownership before emitting gates. The MPF documentation now explains why retrying the same key and trie cannot resolve a terminal fork.

One blocking redaction gap remains. In WitnessCalculator.evaluate, a failed Gate.AssertEq includes both evaluated witness values in the exception. Both ordinary and flat witness generation call this method. Even canonical private inputs can therefore reach application logs when a circuit assertion fails. Report only the wire identifiers and the failed equality rule. Add a regression that reaches this assertion with distinct, valid synthetic private values and verifies that the error identifies the wires while omitting both values. The new input-range and R1CS diagnostics already follow that convention. Affected lines

All 15 selected tests passed on this head with zero skips, including SRS snapshot isolation, gadget ownership, input validation and live snarkjs PlonK interoperability.

@satran004

Copy link
Copy Markdown
Member Author

[reviewer3] Re-review of head fcd4ad37 (round 2, diff from 63ea72cb): CHANGES REQUESTED (one small fix)

Scope: engineering, cross-backend, compatibility and docs.

What I verified

  • Tests. I ran ./gradlew -PrequireSnarkjs :zeroj-circuit-dsl:test :zeroj-circuit-annotation-api:test :zeroj-circuit-lib:test :zeroj-crypto:test :zeroj-verifier-plonk:test :zeroj-mpf-poseidon:test in a clean worktree at fcd4ad37. BUILD SUCCESSFUL, with no failures in any module:

    Module Tests Skipped
    zeroj-circuit-dsl 140 1
    zeroj-circuit-annotation-api 25 0
    zeroj-circuit-lib 1318 23
    zeroj-crypto 1147 2
    zeroj-verifier-plonk 38 0
    zeroj-mpf-poseidon 49 0
  • SRS pinning. validateSrs copies exactly domainSize + 6 G1 and 2 G2 references before the cache comparison, subgroup checks and SecureRandom challenge. It then uses that same snapshot for all 8 commitments, the returned key's srsG1 and srsG1Lagrange, and X2 (now tauG2[1] from the snapshot rather than srs.x2()).

    • AffineG1/AffineG2 are records over immutable MontFp381/Fp2, so copying references is enough.
    • recordVerified is still called only from PtauImporterBLS381, on arrays that the importer builds itself.
    • The new mutation test covers caller edits after setup.
  • Consumers of the smaller SRS. The proving key now holds n + 6 points instead of the caller's full array. I checked every consumer:

    • PlonKProverBLS381.validateProvingKey requires exactly n + 6.
    • PlonKProver and PlonkSetupCache write and validate whatever length is present.
    • As a side effect, cached PlonK keys built from large .ptau files are now smaller.
  • Signal ownership. RangeCheck.check(SignalBuilder, Signal) (and so AliasCheck) and PoseidonN.hash(SignalBuilder, …) reject foreign signals before emitting any gate. The tests cover builders with overlapping wire IDs and include same-builder positive controls.

  • Docs.

    • The terminal-fork wording in ADR-0068 and the state spec now matches what the templates can actually prove.
    • The reference list now includes a primary reference for the batched check.
    • The new [removal] suppressions are scoped to the two test methods.

Blocking

  1. ADR-0068 I4 now says "never witness values", but the most common witness-failure path still prints them.
    • Round 2 adds this sentence to I4: "All validation exceptions report only the signal name, wire index, constraint index, and failed rule — never witness values or witness-derived linear-combination evaluations."
    • WitnessCalculator.java:198-202 (the Gate.AssertEq branch) still throws:
      "Constraint violation: " + left + "=" + witness.get(left.id()) + " != " + right + "=" + witness.get(right.id())
    • This is the exception any assertEqual on a secret raises during witness generation, for example a wrong preimage, a bad signature or a Merkle path mismatch. Both sides' values end up in the message, so I4 is not true as written.
    • The line predates this PR, but the PR now makes a blanket claim that it contradicts.
    • Fix: report only the wire IDs (for example "Constraint violation: wire " + left.id() + " != wire " + right.id()), and extend the existing sentinel redaction test to a failing assertEqual on a private input. If you'd rather not touch this path in this PR, narrow I4 to the validators changed here instead.

Non-blocking (P3)

  1. One more legacy leak. Groth16Prover.java:73-74 (the gated BN254 prove entry, not validateWitness) still appends witness[0] to its message. It is the constant wire, so the risk is low. It's still worth the same one-word change to match Groth16ProverBLS381:84 and Groth16Keys:187, which already say only "witness[0] must be 1".
  2. Compatibility note. PlonKProvingKeyBLS381.srsG1() is now exactly domainSize + 6 long. Before, it was the caller's full SRS. No in-repo consumer depends on the longer array. It's worth one line in the ADR's compatibility section, because external code that reused pk.srsG1() as a general SRS (for another commitment of higher degree) would now get a shorter array.

Everything else in round 2 looks correct to me. Once item 1 is fixed or narrowed, I'll approve.

@satran004

Copy link
Copy Markdown
Member Author

Addressed all remaining review comments in commit 07ab1635:

  1. WitnessCalculator (Gate.AssertEq) witness-value redaction: Removed evaluated witness values from the Gate.AssertEq ArithmeticException message — now reports only "Constraint violation: wire " + left.id() + " != wire " + right.id(). Added a regression test in CircuitDslHardeningTest covering both boxed (calculate) and flat (calculateFlat) evaluation with two distinct synthetic private inputs (111111111111 and 222222222222), asserting the exception identifies both wire IDs while redacting both private values.
  2. Legacy Groth16Prover (prove) redaction: Redacted witness[0] from the legacy BN254 witness[0] != 1 error message so it matches Groth16ProverBLS381 and Groth16Keys.
  3. ADR-0068 compatibility note: Added a note in docs/adr/0068-dsl-plonk-scaling-mpf-and-gadget-hardening.md documenting that PlonKProvingKeyBLS381.srsG1() now holds the pinned domainSize + 6 SRS prefix rather than the caller's full-ceremony array.

Verification

  • Passed ./gradlew -PrequireSnarkjs :zeroj-circuit-dsl:test :zeroj-crypto:test --tests 'org.zeroj.crypto.groth16.Groth16ProverValidateWitnessTest' --tests 'org.zeroj.crypto.groth16.Groth16EndToEndTest' --tests 'org.zeroj.crypto.plonk.*' (all tests green, including live snarkjs .ptau interop).

Ready for final approval.

@satran004

Copy link
Copy Markdown
Member Author

[reviewer1] Approved 07ab1635cb730611e67817e3d56ecb265010db9f. I traced the failed equality assertion through the evaluator shared by boxed and flat witness generation. Its exception now identifies the two wires and omits both private values. The regression exercises both entry points using distinct canonical private inputs. The legacy Groth16 prover also omits the supplied constant-wire value from its error.

All eight selected tests passed with zero skips on this head, including the redaction regression, SRS snapshot isolation and live snarkjs PlonK interoperability. My earlier findings on this PR are closed.

@satran004

Copy link
Copy Markdown
Member Author

[reviewer3] Re-review of head 07ab1635 (round 3, diff from fcd4ad37): APPROVED

Scope: engineering, cross-backend, compatibility and docs.

What I verified

  • Tests. I ran ./gradlew -PrequireSnarkjs :zeroj-circuit-dsl:test :zeroj-circuit-annotation-api:test :zeroj-circuit-lib:test :zeroj-crypto:test :zeroj-verifier-plonk:test :zeroj-mpf-poseidon:test in a clean worktree at 07ab1635. BUILD SUCCESSFUL, and all six test tasks ran again rather than being reused from the earlier run. No failures:

    Module Tests Skipped
    zeroj-circuit-dsl 140 1
    zeroj-circuit-annotation-api 25 0
    zeroj-circuit-lib 1318 26
    zeroj-crypto 1147 2
    zeroj-verifier-plonk 38 0
    zeroj-mpf-poseidon 49 0
  • Round-2 item 1 (blocking), fixed. The Gate.AssertEq branch in WitnessCalculator now reports only the two wire IDs. Boxed and flat witness generation share that branch, and the new test in CircuitDslHardeningTest covers both with two distinct private sentinels, checking that the wire IDs are present and neither value is. I also re-scanned every throw in WitnessCalculator and the DSL got " + messages. None of them includes a witness value now, so ADR-0068 I4 holds as written.

  • Round-2 item 2, fixed. Groth16Prover.prove no longer appends witness[0], which matches Groth16ProverBLS381 and Groth16Keys.

  • Round-2 item 3, fixed. The ADR-0068 compatibility section now states that PlonKProvingKeyBLS381.srsG1() holds the pinned domainSize + 6 prefix.

No remaining findings from me.

Base automatically changed from fix/adr-0066-plonk-ptau-and-zkey-import to main November 21, 2026 09:56
@satran004
satran004 merged commit 8d83728 into main Nov 21, 2026
@satran004
satran004 deleted the fix/adr-0068-dsl-plonk-mpf-hardening branch November 21, 2026 09:57
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.

2 participants