Skip to content

[Groth16/Assurance] Design key/R1CS consistency verification before private-witness use #67

Open

Description

@satran004

PR #61 validates canonical encodings, curve/subgroup membership and pinned artifact integrity. These checks do not establish that a proving key is consistent with its claimed R1CS and Powers of Tau, or protect a witness from a malicious key made entirely of valid subgroup points.

For example, shifting one private wire's L query by a known multiple of G preserves point validity but adds a witness-dependent term to a proof's pairing residual. An observer can test low-entropy witness guesses, including individual bits. This is particularly relevant to the account-ownership prover's root-key witness. The importer must not be described as a key-consistency or transcript verifier.

Current required boundary: independently run snarkjs zkey verify against the exact R1CS and trusted curve-appropriate .ptau, or obtain the key's pinned hash from someone trusted who performed that verification. A self-computed hash of an arbitrary download or a caller-supplied circuit fingerprint is insufficient. Verification does not remove the ceremony's honest-contributor/secret-destruction assumptions.

Proposed bounded follow-up (R2 validation with R3 witness-confidentiality impact):

  • Write and accept a security design before implementation: threat model, required artifacts/trust roots, exact invariants, malformed-input/DoS bounds, ceremony assumptions and API failure behavior.
  • Pin and review the reference equations and transcript verification behavior, including snarkjs v0.7.6 zkey_verify_fromr1cs.js and zkey_verify_frominit.js. Resolve profile differences explicitly; do not invent a new probabilistic check.
  • Specify whether the first milestone verifies full transcript/key consistency or a narrower property, and name any weaker result accordingly.
  • Add independent positive vectors and negative keys whose points all remain canonical, on-curve and in the subgroup but whose L/H/query data or circuit association is wrong. Differential-check against snarkjs.
  • Fail before private-witness operations on every supported import/prover route; qualify provider parity and bounded-memory behavior at large-key scale.
  • Document remaining audit and production ceremony gates and migration of artifact provenance manifests.

References:

This is distinct from #66's narrow rejection of known-unfinalized gamma/delta-equal keys: rejecting that one profile is not a general key-consistency check. Neither issue replaces independently verified ceremony provenance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions