Skip to content

Recursive verifier updates#351

Open
veljkovranic wants to merge 38 commits intomainfrom
recursive_verifier_updates
Open

Recursive verifier updates#351
veljkovranic wants to merge 38 commits intomainfrom
recursive_verifier_updates

Conversation

@veljkovranic
Copy link
Copy Markdown
Collaborator

@veljkovranic veljkovranic commented Mar 19, 2026

This PR aims to realign Gnarks recursive verifier.

The changes include:

  • Updating circuit to support ZK WHIR3 updates
  • Latest versions of Spongefish
  • Native parsing and unrolling of Merkle tree proofs (which requires native Skyscraper2 implementation)
  • Re-enabling of E2E CI workflow.

Supporting PRs that were needed for this PR to work are listed here:

Additional details in here: #260

Proof of testing:

Screenshot 2026-04-09 at 12 30 38

@veljkovranic veljkovranic marked this pull request as ready for review April 8, 2026 15:19
@veljkovranic veljkovranic changed the title [WIP] Recursive verifier updates Recursive verifier updates Apr 8, 2026
MONITOR_PID=$!

# Run the main process
./gnark-verifier --config "../noir-examples/noir-passport/merkle_age_check/params_for_recursive_verifier" --r1cs "../noir-examples/noir-passport/merkle_age_check/r1cs.json"
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.

For CI, we used to save and reuse PK and VK. Might be worth it to bring it back.

},
acir::native_types::{Witness, WitnessMap},
anyhow::{Context, Result},
hex,
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.

Seems like and unused import

Comment thread Cargo.toml

# 3rd party
anyhow = "1.0.93"
ciborium = "0.2.2"
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.

Seems unused?

}
verifyMerkleProofs(api, sc, rd.Leaves, rd.LeafIndexes, rd.SiblingHashes, rd.AuthPaths, prevRootHash)
}

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.

LogNumConstraints int

SessionID [32]uints.U8 `gnark:",public"`
Transcript []uints.U8 `gnark:",public"`
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.

Transcript doesn't need to be public. Only the Public Value hash needs to.

instance := nativePublicInputsHashBytes(piValues)

assign = NimueInit{
ProtocolID: [2]frontend.Variable{
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.

Shouldn't the protocol ID be a baked-in constant?

numBitsForReversal := bits.Len(uint(foldedDomainSize)) - 1
mainRoundData.StirChallengesPoints[r] = make([]frontend.Variable, len(stirIndexes))
for index, idx := range stirIndexes {
mainRoundData.StirChallengesPoints[r][index] = BitReversedExponentVar(api, expDomainGenerator, idx, numBitsForReversal)
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.

I believe we started using rs_in_order flag in Cargo.toml. So we no longer Reverse the exponent.

finalNumBitsForReversal := bits.Len(uint(finalFoldedDomainSize)) - 1
finalRandomnessPoints := make([]frontend.Variable, len(finalIndexes))
for i, idx := range finalIndexes {
finalRandomnessPoints[i] = BitReversedExponentVar(api, expDomainGenerator, idx, finalNumBitsForReversal)
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.

I believe we started using rs_in_order flag in Cargo.toml. So we no longer Reverse the exponent.

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