refactor(openings): split PCS traits into verifier/prover halves and fuse batched openings#1467
Closed
quangvdao wants to merge 2 commits into
Closed
refactor(openings): split PCS traits into verifier/prover halves and fuse batched openings#1467quangvdao wants to merge 2 commits into
quangvdao wants to merge 2 commits into
Conversation
…fuse batched openings Split CommitmentScheme, AdditivelyHomomorphic, and ZkOpeningScheme into verifier-only base traits (CommitmentSchemeVerifier, AdditivelyHomomorphicVerifier, ZkOpeningSchemeVerifier) and prover extension traits. Verifier-side code (jolt-verifier, JoltProof, JoltVerifyingKey, OpeningClaim) now bounds on the verifier-only trait, removing prover-only associated types (Polynomial, OpeningHint, etc.) from verifier compilation paths. Fuse batched openings into a single PCS::BatchProof + prove_batch / verify_batch pair on every scheme. Mock, Dory, and HyperKZG impls are cut over; the homomorphic_prove_batch / homomorphic_verify_batch helpers are backend-free and operate on plain Transcript. JoltProof now carries one opening_proof: PCS::BatchProof instead of Vec<PCS::Proof>. Add VerifierSetupParams + verifier_setup / project_verifier_setup so verifier setup is owned by CommitmentSchemeVerifier and prover setup projects into it. Move single-claim open / verify onto the AdditivelyHomomorphic(Verifier) traits since not every scheme is homomorphic. Replace Op::ReduceOpenings + Op::Open in the Jolt runtime ISA with a single Op::ProveBatch; verifier collapses into VerifierOp::VerifyOpenings that calls PCS::verify_batch directly. RuntimeState now tracks a single BatchProof and binding_evals. Other: - Delete jolt-verifier-backend crate and jolt-openings/src/backend.rs - Move OpeningVerification into CommitmentScheme(Verifier); helpers use plain Blake2bTranscript - Reintroduce the early-out in VerifierOp::VerifyOpenings so partial / WIP verifier modules that emit VerifyOpenings without preceding CollectOpeningClaim still validate cleanly - Fix pre-existing clippy lints in jolt-witness and jolt-equivalence debug-test files so workspace clippy goes green Gates passing: - cargo clippy --workspace --all-targets -- -D warnings - cargo clippy -p jolt-core --features host -- -D warnings - cargo clippy -p jolt-core --features host,zk -- -D warnings - cargo nextest run -p jolt-core muldiv --features host - cargo nextest run -p jolt-core muldiv --features host,zk - cargo nextest run -p jolt-equivalence (43/43 incl. muldiv, modular_self_verify, transcript_divergence, zkvm_proof_accepted_by_core_verifier) - cargo nextest run -p jolt-openings -p jolt-dory -p jolt-hyperkzg -p jolt-verifier (86/86) Pre-existing failures unchanged: jolt-zkvm muldiv_prove_verify (register-access wiring on this branch, verified via git stash). Made-with: Cursor
The file holds both prover- and verifier-side bodies for additively homomorphic batched openings (homomorphic_prove_batch / homomorphic_verify_batch + RLC primitives). The previous "verification" name was a leftover from an interim design where an OpeningVerification trait was being folded in; the final design has only free helpers, so the file should be named after what it actually contains, the AdditivelyHomomorphic / AdditivelyHomomorphicVerifier trait pair it targets. Updates the mod / pub use lines in jolt-openings/src/lib.rs, the crate-internal use in mock.rs, and the two stale path citations in the spec. No behavior change. Gates: workspace clippy --all-targets -- -D warnings green; jolt-openings + jolt-dory + jolt-hyperkzg + jolt-verifier nextest 86/86; jolt-equivalence muldiv / modular_self_verify / transcript_divergence / zkvm_proof_accepted_by_core_verifier all pass. Made-with: Cursor
Contributor
Author
|
Close in lieu of #1521 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Splits the PCS trait family into role-based verifier/prover halves and fuses batched openings into a single
prove_batch/verify_batchpair. Verifier-side code (jolt-verifier,JoltProof,JoltVerifyingKey,OpeningClaim) bounds on the new verifier-only base trait, removing prover-only associated types from verifier compilation paths. Spec:specs/1467-pcs-prover-verifier-split.md.Two commits, both under
crates/jolt-openings/and the call sites that consume it:cbb47baf7— full trait split + fused batching + ISA cutoverba8136ef3— file renameverification.rs→homomorphic.rs(the file holds both prover- and verifier-side bodies for the homomorphic batched-opening protocol; old name was a leftover from an interim design)Trait shape
CommitmentSchemeVerifier(new base):Field,VerifierSetup,Proof,BatchProof,VerifierSetupParams,verifier_setup,verify_batch,bind_opening_inputsCommitmentScheme: CommitmentSchemeVerifier(prover extension):ProverSetup,Polynomial,OpeningHint,SetupParams,setup,project_verifier_setup,commit,prove_batchAdditivelyHomomorphicVerifier: CommitmentSchemeVerifier(verifier extension):combine,verifyAdditivelyHomomorphic: AdditivelyHomomorphicVerifier + CommitmentScheme(prover extension):combine_hints,openZkOpeningSchemeVerifier+ZkOpeningScheme: same split for ZK openingsSingle-claim
open/verifymoved off the core PCS traits ontoAdditivelyHomomorphic(Verifier)so non-homomorphic / fused-batch schemes never have to implement them. They survive as RLC primitives consumed byhomomorphic_prove_batch/homomorphic_verify_batch(which are the only production callers).Fused batched openings
Every PCS now exposes
BatchProof+prove_batch/verify_batch. For Dory,BatchProof = Vec<DoryProof>; for HyperKZG and Mock, similarly per-group. The standard "group-by-point + RLC + open" body is implemented once as backend-free helpers (homomorphic_prove_batch/homomorphic_verify_batch) over plainTranscriptand reused by all three current schemes; future fused-batch schemes (lattice / hash-based) implementprove_batch/verify_batchdirectly without touching this helper module.JoltProof::opening_proof: PCS::BatchProofreplaces the priorVec<PCS::Proof>.Verifier-owned setup
New
VerifierSetupParams+verifier_setup(verifier constructs its own setup from public inputs) andproject_verifier_setup(prover-side projection). Prior trait only had the projection, which was useless to a verifier that never holds aProverSetup.Runtime ISA changes
Op::ProveBatchreplacesOp::ReduceOpenings+Op::Openon the prover sideVerifierOp::VerifyOpeningscallsPCS::verify_batchdirectly (with an early-out for partial / WIP verifier modules that emitVerifyOpeningswithout precedingCollectOpeningClaims)RuntimeStatetracks a singleBatchProof+binding_evalsOther
jolt-verifier-backendcrate andjolt-openings/src/backend.rs(verifier no longer needs a backend type parameter)OpeningVerification(an interim trait from backend: multi-backend verifier prototype (FieldBackend + Tracing AST) #1461's design) intoCommitmentScheme(Verifier)directlyOpeningClaim; bound onCommitmentSchemeVerifierBlake2bTranscript(no transcript-AST framework on this branch's verifier path)jolt-witness/src/polynomials.rsandjolt-equivalence/tests/{booleanity_debug,uniskip_azbz,uniskip_debug}.rsso workspace clippy goes greenTest plan
All gates green locally on macOS / aarch64:
cargo clippy --workspace --all-targets -- -D warningscargo clippy -p jolt-core --features host -- -D warningscargo clippy -p jolt-core --features host,zk -- -D warningscargo nextest run -p jolt-core muldiv --features hostcargo nextest run -p jolt-core muldiv --features host,zkcargo nextest run -p jolt-equivalence(43/43 incl.muldiv,modular_self_verify,transcript_divergence,zkvm_proof_accepted_by_core_verifier)cargo nextest run -p jolt-openings -p jolt-dory -p jolt-hyperkzg -p jolt-verifier(86/86)Pre-existing failure unchanged (verified via
git stash):jolt-zkvm muldiv_prove_verify— register-access wiring missing on this branch, unrelated to this refactorPosted by Cursor assistant (model: Claude Opus 4.7) on behalf of the user (Quang Dao) with approval.
Made with Cursor