prove function, the key function in the STARK proof generation process. It is implemented as follows:
Input and Output
It takes the following as input:components: A list of AIR components. For more details, refer to the Components and Prover Components sections.channel: A Fiat-Shamir channel for non-interactive randomness.commitment_scheme: ACommitmentSchemeProverfor committing to trace and composition polynomials. For more details, refer to the PCS Prover section.
StarkProof object if successful, or a ProvingError if any constraint is not satisfied. The StarkProof object is a wrapper around CommitmentSchemeProof.
Step-by-Step Breakdown
-
Determine Preprocessed Columns
- The function determines the number of preprocessed columns,
n_preprocessed_columns, from thecommitment_scheme, which is used to initialize theComponentProversstructure.
- The function determines the number of preprocessed columns,
-
Collect Trace Data
- The
trace, containing all columns (execution, interaction, preprocessed), is retrieved from thecommitment_scheme. This includes both coefficient and evaluation forms for each column.
- The
-
Composition Polynomial Construction
- A
random_coeffis drawn from the channel. - The
composition_polyis computed as a random linear combination of all constraint quotient polynomials, using powers of the random coefficient. For more details, refer to the Prover Components section.
- A
-
Commit to the Composition Polynomial
- The
composition_polyis split into coordinate polynomials and committed to using a Merkle tree.
- The
-
Out-of-Domain Sampling (OODS)
- An
oods_pointis drawn randomly from the channel. This point is used to bind the prover to a unique low-degree polynomial, preventing ambiguity in the list decoding regime. For more details, refer to the Out-of-Domain Sampling section.
- An
-
Determine Sample Points
- The function computes all
sample_pointsrequired to verify constraints at the OODS point, using themask_pointsfunction. This includes all necessary offsets for each constraint and the OODS points for the composition polynomial.
- The function computes all
-
Openings and Proof Generation
- The
commitment_schemeis asked to open all committed polynomials at the sampled points, producing the required evaluations and Merkle authentication paths. This is handled by theprove_valuesfunction, which also integrates the FRI protocol for low-degree testing. For more details, refer to the PCS Prover section.
- The
-
Sanity Check
- The function checks that the composition polynomial evaluated at the OODS point matches the value reconstructed from the sampled trace values. If not, it returns a
ConstraintsNotSatisfiederror.
- The function checks that the composition polynomial evaluated at the OODS point matches the value reconstructed from the sampled trace values. If not, it returns a
-
Return Proof
- If all checks pass, the function returns a
StarkProofobject containing the full proof transcript, including all commitments, openings, and FRI proof.
- If all checks pass, the function returns a