Skip to content

Add explicit R1CS witness blinding API - #506

Merged
Srinath Setty (srinathsetty) merged 9 commits into
mainfrom
sai/required-proof-randomness
Aug 19, 2026
Merged

Add explicit R1CS witness blinding API#506
Srinath Setty (srinathsetty) merged 9 commits into
mainfrom
sai/required-proof-randomness

Conversation

@sai-deng

@sai-deng Sai (sai-deng) commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve the existing safe witness APIs, which sample fresh blinds internally
  • add R1CSWitnessBlind as a typed witness-commitment blind
  • add _with_blind variants on the existing NovaWitness trait and R1CSWitness type for deterministic protocols
  • keep ordinary Nova, Neutron, Spartan, tests, and fixtures on the safe random-default path
  • release as nova-snark 0.74.0

Why

Normal callers should not need to manage commitment randomness. The typed explicit path makes that exceptional ownership visible without passing bare scalars or adding a second trait.

API

// Safe default: samples internally; returned witness exposes r_W().
cs.r1cs_instance_and_witness(&shape, &ck)?;

// Deterministic protocol/replay path.
let blind = R1CSWitnessBlind::from_scalar(derived);
cs.r1cs_instance_and_witness_with_blind(&shape, &ck, blind)?;

Validation

  • default and experimental target compilation
  • strict Clippy
  • safe-default witness test
  • typed-blind deterministic commitment test

@sai-deng
Sai (sai-deng) force-pushed the sai/required-proof-randomness branch from d61f7ba to 96b0f09 Compare August 10, 2026 02:49

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread src/frontend/mod.rs Outdated
Comment thread src/frontend/r1cs.rs Outdated
Comment thread src/gadgets/ecc.rs Outdated
Comment thread src/gadgets/ecc.rs Outdated
Comment thread src/gadgets/ecc.rs Outdated
Comment thread src/r1cs/mod.rs Outdated
@sai-deng Sai (sai-deng) changed the title Require explicit R1CS witness blinds Add explicit R1CS witness blinding API Aug 18, 2026
Comment thread src/r1cs/mod.rs Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left one minor nit.

@srinathsetty
Srinath Setty (srinathsetty) added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit 0d0d00a Aug 19, 2026
12 checks passed
@srinathsetty
Srinath Setty (srinathsetty) deleted the sai/required-proof-randomness branch August 19, 2026 01:56
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.

3 participants