A transparent multilinear polynomial commitment scheme over KoalaBear. The
whir-pcs package provides the prover and the general Rust verifier. The
whir-verify package provides no_std + alloc verification of the fixed
functional Stacked WHIR opening used by zkDTVM Seal.
MlPCS commits batches of CompressedMatrix values. Choose the opening
geometry when committing and supply the same geometry when verifying.
| Opening | Commit option | Prover | Verifier |
|---|---|---|---|
| Compact WHIR | MlCommitOptions::paired(kind) |
open |
verify |
| Stacked WHIR linear functional | MlCommitOptions::stacking_log_height(log_height) |
open_functional |
verify_functional |
Use commit_with_options for either opening path. Plain commit makes
a commitment without an opening mode. Compact WHIR packs columns into lanes
and batches evaluation claims without a stacking sumcheck. Stacked WHIR
combines columns at a shared physical height and uses a stacking sumcheck
to reduce the claimed linear functional before opening it.
WhirConfig<FriMmcs> wraps a WhirIoppConfig<FriMmcs> with the initial
code rate, early-stop height, grinding, and query parameters. For a custom
Stacked WHIR grouping, set WhirIoppConfig::num_committed_groups to None
and pass the fold sizes to with_cross_round_log_foldings. With Some(n),
the scheduler divides the active rounds as evenly as possible among the groups.
Set the number of queries in each group with with_round_query_counts. Under the
reduced-rate Stacked WHIR schedule (compute_reduced_rate_commit_schedule), a
group folding k variables reduces the polynomial dimension by k and the
next committed codeword log height by one (giving Merkle row log height
codeword_log - k), whereas fixed-rate Compact WHIR keeps a constant blowup
rate.
pcs/src/
├── koalabear/ # Scalar and AVX-512, AVX2, and NEON field arithmetic
├── merkle.rs # Merkle commit and pruned batch authentication
├── utils/ # Field, multilinear, univariate, and equality polynomials
└── whir/
├── mlpcs.rs # Commitment and opening interface
├── paired.rs # Compact geometry and proofs
├── whir_stacked.rs # Functional Stacked proofs
├── whir_commit.rs # Batch encoding and commitments
├── whir_helpers.rs # Layout and encoding helpers
├── whir_pcs.rs # Interface implementation
├── whir_types.rs # Configuration, schedules, and proof types
├── whir_iopp.rs # IOPP row openings
├── evals_dft.rs # Evaluation encoding
├── sumcheck.rs # Multilinear reductions
├── transcript.rs # BLAKE3 transcript and grinding
└── profile.rs # Optional phase timing
verify/src/
├── decode.rs # Bounded wire decoder
├── field.rs # Scalar KoalaBear and quintic extension
├── merkle.rs # Pruned row authentication
├── stacked.rs # Functional opening replay
├── stacking.rs # Shared deterministic column placement
└── transcript.rs # BLAKE3 transcript
cargo test --release --workspaceOn an x86-64 host with AVX-512F, enable the 16-lane KoalaBear implementation:
RUSTFLAGS="-C target-feature=+avx512f" cargo test --release --workspace --features avx512Licensed under MIT or Apache-2.0, at your option. The KoalaBear implementation
is adapted from Plonky3 p3-koala-bear 0.8.0 (MIT OR Apache-2.0).