Skip to content

pub_inputs support#215

Merged
Bisht13 merged 19 commits intomainfrom
ash/witness_split
Jan 23, 2026
Merged

pub_inputs support#215
Bisht13 merged 19 commits intomainfrom
ash/witness_split

Conversation

@ashpect
Copy link
Copy Markdown
Collaborator

@ashpect ashpect commented Oct 13, 2025

Support for public_witness opening

@ashpect ashpect force-pushed the ash/witness_split branch 3 times, most recently from a35db76 to 67cae81 Compare November 5, 2025 05:47
@ashpect ashpect changed the base branch from main to sl/witness-split November 6, 2025 08:47
@ashpect ashpect changed the base branch from sl/witness-split to main November 9, 2025 22:07
@ashpect ashpect changed the base branch from main to sl/witness-split November 11, 2025 01:17
@ashpect ashpect marked this pull request as ready for review November 11, 2025 01:17
@ashpect ashpect force-pushed the ash/witness_split branch 3 times, most recently from 69ba9b3 to 857db9b Compare December 12, 2025 07:59
@shreyas-londhe shreyas-londhe force-pushed the sl/witness-split branch 2 times, most recently from da0ce79 to 52b6528 Compare December 23, 2025 08:45
Base automatically changed from sl/witness-split to main December 24, 2025 07:15
@ashpect ashpect requested a review from Copilot January 1, 2026 17:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for public witness opening in the WHIR R1CS proof system. The implementation introduces a new PublicInputs struct to handle public values, updates both the prover and verifier to compute and verify public input hashes, and modifies the witness scheduling to ensure public inputs are correctly ordered in the witness commitment.

Key Changes:

  • Introduced PublicInputs struct with SHA-256 hashing for commitment
  • Modified prover and verifier to handle public weights and verify public input consistency
  • Updated witness scheduling to place public inputs in w1 (pre-challenge) layer with proper ordering

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 22 comments.

Show a summary per file
File Description
provekit/common/src/witness/mod.rs Adds PublicInputs struct with hashing and serialization support
provekit/common/src/utils/serde_ark_vec.rs New module for serializing vectors of field elements
provekit/common/src/utils/mod.rs Exports new serde_ark_vec module
provekit/common/src/utils/sumcheck.rs Adds add_public_inputs() method to IO pattern for public input hash and randomness
provekit/common/src/whir_r1cs.rs Updates constraint counts and IO pattern to include public weights verification
provekit/common/src/noir_proof_scheme.rs Adds public_inputs field to NoirProof struct
provekit/common/src/lib.rs Exports PublicInputs type
provekit/common/Cargo.toml Adds sha2 dependency for hashing
provekit/common/src/witness/witness_builder.rs Passes public input indices to witness splitting logic
provekit/common/src/witness/scheduling/splitter.rs Ensures public inputs are placed in w1 and properly ordered after constant builder
provekit/r1cs-compiler/src/noir_proof_scheme.rs Extracts ACIR public input indices for witness splitting
provekit/prover/src/lib.rs Extracts public inputs from witness and passes to proof generation
provekit/prover/src/whir_r1cs.rs Implements public weights computation and statement updates for both single and batch commitment cases
provekit/verifier/src/lib.rs Passes public inputs to verification
provekit/verifier/src/whir_r1cs.rs Verifies public input hash and updates statements with public weights constraints

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread provekit/verifier/src/whir_r1cs.rs Outdated
Comment thread provekit/prover/src/whir_r1cs.rs Outdated
Comment thread provekit/common/src/witness/scheduling/splitter.rs Outdated
Comment thread provekit/common/src/witness/scheduling/splitter.rs Outdated
Comment thread provekit/verifier/src/whir_r1cs.rs Outdated
Comment thread provekit/common/src/witness/mod.rs Outdated
Comment thread provekit/verifier/src/whir_r1cs.rs Outdated
Comment thread provekit/prover/src/whir_r1cs.rs
Comment thread provekit/common/src/whir_r1cs.rs Outdated
Comment thread provekit/verifier/src/whir_r1cs.rs Outdated
Comment thread provekit/common/Cargo.toml Outdated
Comment thread recursive-verifier/app/circuit/mtUtilities.go
Comment thread recursive-verifier/app/utilities/utilities.go Outdated
Comment thread recursive-verifier/app/circuit/circuit.go Outdated
Comment thread recursive-verifier/app/circuit/circuit.go Outdated
Comment thread provekit/common/src/whir_r1cs.rs Outdated
Comment thread provekit/prover/src/lib.rs
Comment thread provekit/verifier/src/whir_r1cs.rs
Comment thread provekit/verifier/src/whir_r1cs.rs
Comment thread provekit/prover/src/whir_r1cs.rs Outdated
@Bisht13
Copy link
Copy Markdown
Collaborator

Bisht13 commented Jan 21, 2026

Please add unit tests for testing all cases of public inputs.

@ashpect
Copy link
Copy Markdown
Collaborator Author

ashpect commented Jan 21, 2026

Please add unit tests for testing all cases of public inputs.

Tracking ref: #257

Copy link
Copy Markdown
Collaborator

@Bisht13 Bisht13 left a comment

Choose a reason for hiding this comment

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

Hash Algorithm Mismatch: Rust SHA-256 vs Go Skyscraper

This will cause the recursive verifier to fail.

Rust (provekit/common/src/witness/mod.rs:78-97):

pub fn hash(&self) -> FieldElement {
    let mut hasher = Sha256::new();  // Uses SHA-256
    // ...
}

Go (recursive-verifier/app/circuit/mtUtilities.go:115-135):

func hashPublicInputs(sc *skyscraper.Skyscraper, publicInputs PublicInputs) (frontend.Variable, error) {
    hash := sc.CompressV2(publicInputs.Values[0], publicInputs.Values[1])  // Uses Skyscraper
}

Bisht13

This comment was marked as resolved.

@ashpect
Copy link
Copy Markdown
Collaborator Author

ashpect commented Jan 23, 2026

Hash Algorithm Mismatch: Rust SHA-256 vs Go Skyscraper

This will cause the recursive verifier to fail.

Rust (provekit/common/src/witness/mod.rs:78-97):

pub fn hash(&self) -> FieldElement {
    let mut hasher = Sha256::new();  // Uses SHA-256
    // ...
}

Go (recursive-verifier/app/circuit/mtUtilities.go:115-135):

func hashPublicInputs(sc *skyscraper.Skyscraper, publicInputs PublicInputs) (frontend.Variable, error) {
    hash := sc.CompressV2(publicInputs.Values[0], publicInputs.Values[1])  // Uses Skyscraper
}

Ref: #260
This is on the verifier server side which needs to be updated with many recent changes, not limited to this pr, hence opened an issue for this.

@Bisht13 Bisht13 merged commit 33b9d00 into main Jan 23, 2026
4 of 5 checks passed
@Bisht13 Bisht13 deleted the ash/witness_split branch January 23, 2026 22:03
Bisht13 added a commit that referenced this pull request Feb 7, 2026
Migrate ProveKit to the new WHIR version which replaces the
Statement/CommitmentWriter/Prover/Verifier abstraction with a unified
Config type, switches to spongefish-based transcripts, and uses a
hash-engine system for Merkle trees.

Key changes:
- Replace DuplexSponge<Skyscraper> with StdHash (Shake128) for transcripts
  due to Rust orphan rules; Skyscraper still used for Merkle trees via
  SkyscraperHashEngine
- Adapt prover/verifier to new WHIR batch commit/prove/verify API with
  cross-commitment evaluations for dual-commitment path
- Update spongefish to fcc277f8 and whir to 246dae28
- Remove obsolete IOPattern, SumcheckIOPattern, and PoW infrastructure
- Fix deferred evals offset bug: public weights are Geometric (not
  deferred), so offset must be 0 regardless of public inputs
Bisht13 added a commit that referenced this pull request Feb 13, 2026
Replace IOPattern-based transcript with whir's DomainSeparator/ProverState/
VerifierState API (rev 246dae28). Update spongefish to v1.0.0-rc1 with
byte-oriented Permutation<64> interface. Proof now carries narg_string +
hints instead of a single transcript blob.

Key changes:
- Sponge: Permutation<64> with U=u8, WIDTH=64, RATE=32
- PoW: PoWSolution return type, solution() method
- Prover: config.commit()/config.prove() replacing CommitmentWriter/Prover
- Verifier: config.receive_commitment()/config.verify() replacing readers
- Public weights use Weights::geometric (non-deferred) on both sides
- Cross-evaluation hints for dual-commitment path
- NTT registration via global type-map for ark_bn254::Fr
- Clippy clean on prover/verifier crates
Bisht13 added a commit that referenced this pull request Feb 16, 2026
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