protocol.stark#

STARK verifier orchestration.

Top-level verifier that coordinates transcript operations, PCS verification, and constraint checking for a multi-AIR STARK proof.

The Fiat-Shamir transcript operations must match the Rust verifier EXACTLY in order: any deviation produces wrong challenges and breaks verification.

Reference:

stark-backend/src/verifier/mod.rs – MultiTraceStarkVerifier::verify_raps stark-backend/src/verifier/error.rs – VerificationError enum stark-backend/src/interaction/fri_log_up.rs – FriLogUpPhase::partially_verify

Attributes#

Exceptions#

InvalidProofShape

Proof structure does not match the verifying key.

InvalidOpeningArgument

PCS opening verification failed.

ChallengePhaseError

RAP challenge phase verification failed (e.g. non-zero cumulative sum).

InvalidDeepPowWitness

DEEP proof-of-work witness is invalid.

Functions#

verify_stark(→ None)

Verify a multi-AIR STARK proof.

prove_stark(→ protocol.proof.Proof)

Generate a multi-AIR STARK proof.

Module Contents#

protocol.stark.p = 2013265921[source]#
protocol.stark.STARK_LU_NUM_CHALLENGES = 2[source]#
protocol.stark.STARK_LU_NUM_EXPOSED_VALUES = 1[source]#
protocol.stark.EXT_DEGREE = 4[source]#
exception protocol.stark.InvalidProofShape(message: str = '')[source]#

Bases: protocol.constraints.VerificationError

Proof structure does not match the verifying key.

Reference:

stark-backend/src/verifier/error.rs (VerificationError::InvalidProofShape)

exception protocol.stark.InvalidOpeningArgument(message: str = '')[source]#

Bases: protocol.constraints.VerificationError

PCS opening verification failed.

Reference:

stark-backend/src/verifier/error.rs (VerificationError::InvalidOpeningArgument)

exception protocol.stark.ChallengePhaseError(message: str = '')[source]#

Bases: protocol.constraints.VerificationError

RAP challenge phase verification failed (e.g. non-zero cumulative sum).

Reference:

stark-backend/src/verifier/error.rs (VerificationError::ChallengePhaseError)

exception protocol.stark.InvalidDeepPowWitness(message: str = '')[source]#

Bases: protocol.constraints.VerificationError

DEEP proof-of-work witness is invalid.

Reference:

stark-backend/src/verifier/error.rs (VerificationError::InvalidDeepPowWitness)

protocol.stark.verify_stark(vk: protocol.proof.MultiStarkVerifyingKey, proof: protocol.proof.Proof, fri_params: protocol.proof.FriParameters) None[source]#

Verify a multi-AIR STARK proof.

This is the top-level verification function. It must reproduce the Rust verifier’s Fiat-Shamir transcript operations in EXACTLY the same order.

Args:

vk: The multi-AIR verifying key. proof: The complete STARK proof. fri_params: FRI protocol parameters.

Raises:

VerificationError: If any verification check fails.

Reference:

stark-backend/src/verifier/mod.rs (MultiTraceStarkVerifier::verify + verify_raps, lines 38-430)

protocol.stark.prove_stark(vk: protocol.proof.MultiStarkVerifyingKey, traces: list[list[list[primitives.field.Fe]]], public_values_per_air: list[list[primitives.field.Fe]], fri_params: protocol.proof.FriParameters, preprocessed_traces: list[list[list[primitives.field.Fe]] | None] | None = None, cached_main_traces: list[list[list[list[primitives.field.Fe]]]] | None = None, air_ids: list[int] | None = None) protocol.proof.Proof[source]#

Generate a multi-AIR STARK proof.

Prover counterpart to verify_stark. Reproduces the same Fiat-Shamir transcript operations so that the resulting proof is accepted by the verifier.

Args:

vk: The multi-AIR verifying key. traces: Per-AIR common main trace matrices (list of rows). public_values_per_air: Per-AIR public values. fri_params: FRI protocol parameters. preprocessed_traces: Per-AIR preprocessed trace matrices (None if absent). cached_main_traces: Per-AIR list of cached main trace matrices. air_ids: Maps proof index to VK AIR index. If None, assumes identity

mapping (all VK AIRs have data).

Returns:

A Proof matching the Rust prover output.

Reference:

stark-backend/src/prover/coordinator.rs prove