Skip to content

refactor(openings): split PCS traits into verifier/prover halves and fuse batched openings#1467

Closed
quangvdao wants to merge 2 commits into
a16z:refactor/cratesfrom
quangvdao:quang/pcs-prover-verifier-split
Closed

refactor(openings): split PCS traits into verifier/prover halves and fuse batched openings#1467
quangvdao wants to merge 2 commits into
a16z:refactor/cratesfrom
quangvdao:quang/pcs-prover-verifier-split

Conversation

@quangvdao
Copy link
Copy Markdown
Contributor

Summary

Splits the PCS trait family into role-based verifier/prover halves and fuses batched openings into a single prove_batch / verify_batch pair. 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:

  1. cbb47baf7 — full trait split + fused batching + ISA cutover
  2. ba8136ef3 — file rename verification.rshomomorphic.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_inputs
  • CommitmentScheme: CommitmentSchemeVerifier (prover extension): ProverSetup, Polynomial, OpeningHint, SetupParams, setup, project_verifier_setup, commit, prove_batch
  • AdditivelyHomomorphicVerifier: CommitmentSchemeVerifier (verifier extension): combine, verify
  • AdditivelyHomomorphic: AdditivelyHomomorphicVerifier + CommitmentScheme (prover extension): combine_hints, open
  • ZkOpeningSchemeVerifier + ZkOpeningScheme: same split for ZK openings

Single-claim open / verify moved off the core PCS traits onto AdditivelyHomomorphic(Verifier) so non-homomorphic / fused-batch schemes never have to implement them. They survive as RLC primitives consumed by homomorphic_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 plain Transcript and reused by all three current schemes; future fused-batch schemes (lattice / hash-based) implement prove_batch / verify_batch directly without touching this helper module.

JoltProof::opening_proof: PCS::BatchProof replaces the prior Vec<PCS::Proof>.

Verifier-owned setup

New VerifierSetupParams + verifier_setup (verifier constructs its own setup from public inputs) and project_verifier_setup (prover-side projection). Prior trait only had the projection, which was useless to a verifier that never holds a ProverSetup.

Runtime ISA changes

  • Op::ProveBatch replaces Op::ReduceOpenings + Op::Open on the prover side
  • VerifierOp::VerifyOpenings calls PCS::verify_batch directly (with an early-out for partial / WIP verifier modules that emit VerifyOpenings without preceding CollectOpeningClaims)
  • RuntimeState tracks a single BatchProof + binding_evals

Other

  • Deleted jolt-verifier-backend crate and jolt-openings/src/backend.rs (verifier no longer needs a backend type parameter)
  • Folded OpeningVerification (an interim trait from backend: multi-backend verifier prototype (FieldBackend + Tracing AST) #1461's design) into CommitmentScheme(Verifier) directly
  • Drop the backend type parameter from OpeningClaim; bound on CommitmentSchemeVerifier
  • Helpers use plain Blake2bTranscript (no transcript-AST framework on this branch's verifier path)
  • Fix pre-existing clippy lints in jolt-witness/src/polynomials.rs and jolt-equivalence/tests/{booleanity_debug,uniskip_azbz,uniskip_debug}.rs so workspace clippy goes green

Test plan

All gates green locally on macOS / aarch64:

  • 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 failure unchanged (verified via git stash):

  • jolt-zkvm muldiv_prove_verify — register-access wiring missing on this branch, unrelated to this refactor

Posted by Cursor assistant (model: Claude Opus 4.7) on behalf of the user (Quang Dao) with approval.

Made with Cursor

…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
@github-actions github-actions Bot added spec Tracking issue for a feature spec implementation PR contains implementation of a spec labels Apr 23, 2026
@quangvdao
Copy link
Copy Markdown
Contributor Author

Close in lieu of #1521

@quangvdao quangvdao closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

implementation PR contains implementation of a spec spec Tracking issue for a feature spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant