Skip to main content

BinaryPcs

Struct BinaryPcs 

Source
pub struct BinaryPcs<F: EncodableLevel, EF, MT, MX, E = <F as EncodableLevel>::Encoder> { /* private fields */ }
Expand description

A multilinear polynomial commitment scheme over a binary tower field: an additive-domain Reed-Solomon codeword folded in lockstep with a residual sumcheck.

The stacked-layout binding mode is fixed rather than chosen. The codeword fold merges adjacent pairs, which only suffix-order binding matches.

The base codeword and the folded codewords live over different fields. Each therefore has its own commitment scheme.

The two schemes must report the same failure type. One commitment family instantiated at two levels does.

Implementations§

Source§

impl<F: EncodableLevel, EF: TowerLevel, MT, MX> BinaryPcs<F, EF, MT, MX>

Source

pub fn new( config: BinaryPcsConfig, mmcs: MT, round_mmcs: MX, ) -> Result<Self, BinaryPcsConfigError>

Builds a PCS instance from a derived configuration and its two commitment schemes.

The schedule carries the two widths it was derived for, and both are checked here.

Every cap the derivation applied belongs to one of those two levels:

    committed alphabet   the additive domain the codeword lives in, and the grind
    challenge field      the width every algebraic error is charged against

A schedule derived elsewhere would otherwise report a bound it cannot deliver.

§Arguments
  • config: the validated fold and query schedule both sides read.
  • mmcs: commits the base codeword over the committed alphabet.
  • round_mmcs: commits every folded codeword over the challenge field.
§Errors

Returns an error unless the schedule was derived for these two levels.

Source

pub const fn num_variables(&self) -> usize

Variables of the committed stacked polynomial.

The same number the commitment trait reports, reachable without naming a challenger.

Source§

impl<F, EF, MT, MX, Ntt> BinaryPcs<F, EF, MT, MX, AdditiveRsEncoder<F, Ntt>>
where F: EncodableLevel, EF: TowerLevel, Ntt: AdditiveNtt<F> + Sync,

Source

pub fn with_ntt( config: BinaryPcsConfig, mmcs: MT, round_mmcs: MX, ntt: Ntt, ) -> Result<Self, BinaryPcsConfigError>

Builds an instance around an explicitly selected additive transform.

The transform encodes the base codeword only. A folded codeword the opening encodes from its bound message goes through the challenge field’s own encoder instead. Every correct transform produces the same codeword, so the choice moves no committed symbol.

§Errors

Returns an error unless the schedule was derived for these two tower levels.

Source§

impl<F, EF, MT, MX, E> BinaryPcs<F, EF, MT, MX, E>
where F: EncodableLevel + TranscriptField + FoldAlphabet<EF>, EF: ChallengeField<F> + ExtensionField<F> + TowerLevel + FoldAlphabet<EF>, MT: Mmcs<F>, MX: Mmcs<EF, Error = MT::Error>, E: Encoder<F> + Sync,

Source

pub fn validate_opening_protocol( &self, protocol: &OpeningProtocol, ) -> Result<(), BinaryPcsError<F, MT::Error>>

Check table dimensions and scalar claim capacity before committing or opening.

Security rejection is a behavior change. A protocol an older release accepted can exceed the configured target.

Use this preflight, or a fallible opening entry point, to validate one directly. The commitment traits propagate the same typed errors.

§Minimum non-degenerate protocol

A protocol of empty batches passes every check here.

A table with no opening still contributes its rows, and no claim is under any budget.

Such a run reaches the terminal relation with both sides zero:

    0  ==  0 * final_value      holds whatever the final value is

That is harmless rather than unsound.

A run that claims nothing proves nothing, and asserts nothing either.

Every column it might have opened stays as unconstrained as it was.

The shape is also load-bearing in the security tests.

Only it reaches query sampling with a tampered final codeword.

That isolates the codeword’s binding from the check that otherwise rejects first.

A caller wanting a floor of one claim can read the opening count and impose it.

Source

pub fn try_open<Challenger>( &self, prover_data: BinaryPcsProverData<F, EF, MT>, protocol: &OpeningProtocol, challenger: &mut Challenger, ) -> Result<BinaryPcsProof<F, EF, MT, MX>, BinaryPcsError<F, <MT as Mmcs<F>>::Error>>
where Challenger: FieldChallenger<F> + GrindingChallenger<Witness = F> + CanSampleUniformBits<F> + CanObserve<MT::Commitment> + CanObserve<MX::Commitment>,

Produce a sampled-point opening, returning an error for an invalid or over-budget protocol before touching the challenger. Prover data must match the committed tables.

Source

pub fn try_open_at<Challenger>( &self, prover_data: BinaryPcsProverData<F, EF, MT>, protocol: &OpeningProtocol, points: &[Point<EF>], challenger: &mut Challenger, ) -> Result<BinaryPcsProof<F, EF, MT, MX>, BinaryPcsError<F, <MT as Mmcs<F>>::Error>>
where Challenger: FieldChallenger<F> + GrindingChallenger<Witness = F> + CanSampleUniformBits<F> + CanObserve<MT::Commitment> + CanObserve<MX::Commitment>,

Produce a prescribed-point opening with recoverable protocol and budget errors.

Points must already be transcript-bound, as the prescribed-point contract requires. Rejection leaves the challenger unchanged.

Prover data must match the committed tables.

Source

pub fn try_open_at_known<Challenger>( &self, prover_data: BinaryPcsProverData<F, EF, MT>, protocol: &OpeningProtocol, points: &[Point<EF>], evals: &[OpeningEvals<EF>], challenger: &mut Challenger, ) -> Result<BinaryPcsProof<F, EF, MT, MX>, BinaryPcsError<F, <MT as Mmcs<F>>::Error>>
where Challenger: FieldChallenger<F> + GrindingChallenger<Witness = F> + CanSampleUniformBits<F> + CanObserve<MT::Commitment> + CanObserve<MX::Commitment>,

Produce a prescribed-point opening from evaluations the caller already holds.

As Self::try_open_at, except that each batch’s claimed values are supplied instead of read off the committed columns. A protocol whose own reduction already produced the evaluation at every prescribed point passes it here, rather than paying a pass over the columns to find a value it has.

Points must already be transcript-bound, as the prescribed-point contract requires. Rejection leaves the challenger unchanged.

Prover data must match the committed tables.

§Soundness

A supplied evaluation is bound exactly as a computed one is, and a verifier recomputes its own. A wrong one therefore yields a proof that does not verify, never one that does.

Trait Implementations§

Source§

impl<F, EF, MT, MX, E, Challenger> MultilinearPcs<EF, Challenger> for BinaryPcs<F, EF, MT, MX, E>
where F: EncodableLevel + TranscriptField + FoldAlphabet<EF>, EF: ChallengeField<F> + ExtensionField<F> + TowerLevel + FoldAlphabet<EF>, MT: Mmcs<F>, MX: Mmcs<EF, Error = MT::Error>, E: Encoder<F> + Sync, Challenger: FieldChallenger<F> + GrindingChallenger<Witness = F> + CanSampleUniformBits<F> + CanObserve<MT::Commitment> + CanObserve<MX::Commitment>,

Source§

fn open( &self, prover_data: Self::ProverData, protocol: Self::OpeningProtocol, challenger: &mut Challenger, ) -> Result<Self::Proof, Self::ProverError>

Rejects an over-budget protocol before touching the challenger.

Source§

type Val = F

Base field of the committed polynomials.
Source§

type Commitment = <MT as Mmcs<F>>::Commitment

Succinct binding commitment sent to the verifier.
Source§

type ProverData = BinaryPcsProverData<F, EF, MT>

Prover-side auxiliary data retained between commit and open. Never sent to the verifier.
Source§

type Proof = BinaryPcsProof<F, EF, MT, MX>

Opening proof checked by the verifier.
Source§

type Error = BinaryPcsError<F, <MT as Mmcs<F>>::Error>

Verification failure type.
Source§

type ProverError = BinaryPcsError<F, <MT as Mmcs<F>>::Error>

Configuration or budget failure during commitment or opening.
Source§

type Witness = Witness<F>

Committed witness.
Source§

type OpeningProtocol = OpeningProtocol

Public opening shapes agreed before commit.
Source§

fn num_vars(&self) -> usize

Number of variables m of the committed polynomials. Every polynomial has 2^m evaluations.
Source§

fn commit( &self, witness: Self::Witness, challenger: &mut Challenger, ) -> Result<(Self::Commitment, Self::ProverData), Self::ProverError>

Commit to a multilinear witness. Read more
Source§

fn observe_commitment( &self, commitment: &Self::Commitment, challenger: &mut Challenger, )

Bind a commitment into the transcript. Read more
Source§

fn verify( &self, commitment: &Self::Commitment, proof: &Self::Proof, challenger: &mut Challenger, protocol: Self::OpeningProtocol, ) -> Result<(), Self::Error>

Verify an opening proof against a public commitment and opening protocol. Read more
Source§

impl<F, EF, MT, MX, E, Challenger> PrescribedPointPcs<EF, Challenger> for BinaryPcs<F, EF, MT, MX, E>
where F: EncodableLevel + TranscriptField + FoldAlphabet<EF>, EF: ChallengeField<F> + ExtensionField<F> + TowerLevel + FoldAlphabet<EF>, MT: Mmcs<F>, MX: Mmcs<EF, Error = MT::Error>, E: Encoder<F> + Sync, Challenger: FieldChallenger<F> + GrindingChallenger<Witness = F> + CanSampleUniformBits<F> + CanObserve<MT::Commitment> + CanObserve<MX::Commitment>,

Source§

fn open_at( &self, prover_data: Self::ProverData, protocol: &OpeningProtocol, points: &[Point<EF>], challenger: &mut Challenger, ) -> Result<Self::Proof, Self::ProverError>

Rejects invalid or over-budget protocols before touching the challenger. Points must already be transcript-bound.

Source§

fn verify_at( &self, commitment: &Self::Commitment, proof: &Self::Proof, protocol: &OpeningProtocol, points: &[Point<EF>], challenger: &mut Challenger, ) -> Result<Vec<OpeningEvals<EF>>, Self::Error>

Verifies an opening proof against points instead of sampling each opening point from the transcript.

This trait gives no Fiat-Shamir guarantee on its own. The caller must bind points to the shared transcript first, as the prover did.

This method does not absorb commitment either. The caller absorbs it once, before drawing any challenge of its own.

That absorption is what binding points to the transcript rests on.

Source§

fn prescribed_security( &self, protocol: &OpeningProtocol, ) -> Option<PrescribedOpeningSecurity>

Soundness evidence for this exact opening protocol, or None when unknown. Read more

Auto Trait Implementations§

§

impl<F, EF, MT, MX, E> Freeze for BinaryPcs<F, EF, MT, MX, E>
where MT: Freeze, MX: Freeze, E: Freeze, PhantomData<(F, EF)>: Freeze,

§

impl<F, EF, MT, MX, E> RefUnwindSafe for BinaryPcs<F, EF, MT, MX, E>

§

impl<F, EF, MT, MX, E> Send for BinaryPcs<F, EF, MT, MX, E>
where MT: Send, MX: Send, E: Send, PhantomData<(F, EF)>: Send,

§

impl<F, EF, MT, MX, E> Sync for BinaryPcs<F, EF, MT, MX, E>
where MT: Sync, MX: Sync, E: Sync, PhantomData<(F, EF)>: Sync,

§

impl<F, EF, MT, MX, E> Unpin for BinaryPcs<F, EF, MT, MX, E>
where MT: Unpin, MX: Unpin, E: Unpin, PhantomData<(F, EF)>: Unpin,

§

impl<F, EF, MT, MX, E> UnsafeUnpin for BinaryPcs<F, EF, MT, MX, E>

§

impl<F, EF, MT, MX, E> UnwindSafe for BinaryPcs<F, EF, MT, MX, E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more