Skip to main content

Crate p3_commit

Crate p3_commit 

Source
Expand description

§p3-commit

A framework for cryptographic commitment schemes, including non-hiding variants. This crate defines the traits that connect proof systems to their commitment backends.

Key items:

  • Pcs / MultilinearPcs — polynomial commitment scheme interfaces used by the STARK provers and verifiers
  • Mmcs — “Mixed Matrix Commitment Scheme”, a vector-commitment abstraction over batches of matrices of differing heights
  • PolynomialSpace and TwoAdicMultiplicativeCoset — evaluation-domain abstractions
  • periodic — periodic-column evaluation helpers
  • testing (the opt-in test-utils feature) — mock instantiations and shared PCS contract checks for downstream tests

Implementations live in p3-merkle-tree (Mmcs), p3-fri, p3-circle and p3-whir (Pcs).

testing::assert_pcs_opening_contract exercises real transparent backends with caller-supplied matrices and independently computed expected values. It checks batched opening order, honest verification, transcript agreement, and rejection of swapped point fields, modified values and missing matrix/column claims. Fixtures must include a multi-matrix commitment and point-dependent expected values. FRI, Circle, and STIR use this helper alongside their backend-specific tests.

Part of Plonky3, dual-licensed under MIT and Apache 2.0.

§Univariate PCS API migration

Pcs covers domains, commitments, prover data, and opening/verification. Implementers that serve univariate STARKs also implement UnivariateStarkPcs: move EvaluationsOnDomain, ZK, LDE/evaluation/quotient/periodic helpers and preprocessing adaptation to that implementation. Generic commitment clients can continue to bound only Pcs; STARK configurations require UnivariateStarkPcs. Import both traits when calling both sets of methods, and change qualified references to moved members to UnivariateStarkPcs. MultilinearPcs is unchanged.

Opening batches now use named requests and claims:

ⓘ
let requests = vec![OpeningRequest {
    prover_data: &data,
    points: vec![vec![zeta]], // one point vector per committed matrix
}];
let claims = vec![CommitmentOpening {
    commitment,
    matrices: vec![MatrixOpening {
        domain,
        points: vec![PointOpening { point: zeta, values }],
    }],
}];

Requests borrow prover data and own their point vectors. Claims own commitments, matrices and column values, as before. All ordering remains significant: requests, matrices, points and columns are used in caller order. The existing CommitmentWithOpeningPoints name aliases CommitmentOpening. Explicit From conversions accept the former tuples, including nested matrix/point claims, so a caller can migrate a batch with old_batch.into_iter().map(Into::into).collect(). The FRI ProverDataWithOpeningPoints alias likewise names OpeningRequest.

PCS traits no longer define trace, quotient or preprocessing commitment indices. Univariate STARK owns these positions in p3_uni_stark::StarkOpeningLayout. open_with_preprocessing now takes Option<usize> identifying the preprocessing commitment request, replacing the old boolean. Use None for no preprocessing; STARK callers pass Some(layout.preprocessed) when it is present. Other clients may place preprocessing at any commitment index.

This is a Rust API change only; commitment/proof serialization, transcript absorption order and evaluation-view ownership remain unchanged. No version bump is included.

Structs§

BatchOpening
A Batched opening proof.
BatchOpeningRef
A reference to a batched opening proof.
CommitmentOpening
A joint commitment to a collection of matrices and their opening at a collection of points.
ExtensionMmcs
A wrapper to lift an MMCS from a base field F to an extension field EF.
LagrangeSelectors
Given a PolynomialSpace, S, and a subset R, a Lagrange selector P_R is a polynomial which is not equal to 0 for every element in R but is equal to 0 for every element of S not in R.
MatrixOpening
Opening points and claimed column evaluations for one matrix.
OpeningRequest
Points to open for each matrix in one commitment.
PeriodicColumns
Periodic columns screened against the rows they have to cover.
PeriodicLdeTable
Compact storage for periodic column values on the LDE domain.
PointOpening
Claimed evaluations of every column at one point, in column order.

Enums§

PeriodicColumnShapeError
Why a declared periodic column cannot be laid over a trace of a given height.

Traits§

Encoder
A linear code applied to every column of a matrix.
Mmcs
A “Mixed Matrix Commitment Scheme” (MMCS) is a generalization of a vector commitment scheme.
MultilinearPcs
Polynomial commitment scheme for multilinear polynomials over the Boolean hypercube.
Pcs
A polynomial commitment scheme, for committing to batches of polynomials defined by their evaluations over some domain.
PeriodicEvaluator
Evaluates periodic polynomials for a given domain system.
PolynomialSpace
Fixing a field, F, PolynomialSpace<Val = F> denotes an indexed subset of F^n with some additional algebraic structure.
UnivariateStarkPcs
Capabilities used by univariate STARK provers and verifiers.

Type Aliases§

CommitmentWithOpeningPoints
Compatibility name for the named verification claim.
OpenedValues
OpenedValuesForMatrix
OpenedValuesForPoint
OpenedValuesForRound
Val