protocol.simple_pilout#

Multi-AIR proving coordination for the Simple pilout.

The Simple pilout contains five AIRs: SimpleLeft, SimpleRight, U8Air, U16Air, SpecifiedRanges. C++ proofman proves all five simultaneously and derives the global_challenge by element-wise accumulating each AIR’s Poseidon2 lattice contribution before any AIR advances to Stage 2.

prove_simple_pilout() implements the full protocol, producing byte-identical proofs to C++ proofman.

Usage:

from protocol.simple_pilout import AIRProveData, prove_simple_pilout

proofs = prove_simple_pilout({
    'SimpleLeft': AIRProveData(air_config=..., trace=..., ...),
    ...
})
# proofs['SimpleLeft'] is the full proof dict for that AIR

Attributes#

Classes#

AIRStage1Data

All data needed to commit Stage 1 for one AIR in the Simple pilout.

SimplePiloutStage1Result

Stage-1 results for all five Simple AIRs.

AIRProveData

All data needed to fully prove one AIR in the Simple pilout.

Functions#

prove_simple_pilout(→ dict[str, dict])

Prove all Simple pilout AIRs with the shared multi-AIR global challenge.

prove_simple_pilout_stage1(→ SimplePiloutStage1Result)

Commit Stage 1 for all Simple pilout AIRs and derive the multi-AIR global challenge.

Module Contents#

protocol.simple_pilout.LATTICE_SIZE = 368[source]#
protocol.simple_pilout.TRANSCRIPT_ARITY = 4[source]#
class protocol.simple_pilout.AIRStage1Data[source]#

All data needed to commit Stage 1 for one AIR in the Simple pilout.

air_config: protocol.air_config.AirConfig[source]#
trace: numpy.ndarray[source]#
const_pols: numpy.ndarray[source]#
const_pols_extended: numpy.ndarray[source]#
class protocol.simple_pilout.SimplePiloutStage1Result[source]#

Stage-1 results for all five Simple AIRs.

verkeys: dict[str, list[int]][source]#
stage1_commitments: dict[str, list[int]][source]#
global_challenge: list[int][source]#
class protocol.simple_pilout.AIRProveData[source]#

All data needed to fully prove one AIR in the Simple pilout.

air_config: protocol.air_config.AirConfig[source]#
trace: numpy.ndarray[source]#
const_pols: numpy.ndarray[source]#
const_pols_extended: numpy.ndarray[source]#
public_inputs: numpy.ndarray | None = None[source]#
protocol.simple_pilout.prove_simple_pilout(air_data: dict[str, AIRProveData]) dict[str, dict][source]#

Prove all Simple pilout AIRs with the shared multi-AIR global challenge.

Implements the full C++ proofman VADCOP protocol:
  1. Commit Stage 1 for all AIRs (exactly once per AIR).

  2. Compute each AIR’s Poseidon2 lattice contribution from (verkey, root1).

  3. Accumulate contributions element-wise → shared global challenge.

  4. Run Stage 2+ for each AIR using the shared challenge.

Args:

air_data: Dict mapping AIR name → AIRProveData for all five Simple AIRs.

Returns:

Dict mapping AIR name → proof dict (same structure as gen_proof() returns).

protocol.simple_pilout.prove_simple_pilout_stage1(air_data: dict[str, AIRStage1Data]) SimplePiloutStage1Result[source]#

Commit Stage 1 for all Simple pilout AIRs and derive the multi-AIR global challenge.

Implements the C++ proofman pattern from challenge_accumulation.rs:
  1. For each AIR: build const tree (verkey) and commit Stage-1 witness (root1).

  2. For each AIR: compute Poseidon2 lattice contribution from (verkey, root1).

  3. Accumulate all contributions element-wise (mod Goldilocks prime).

  4. Hash accumulated contribution with publics → global_challenge.

The Simple pilout has n_publics=0 and no proof_values_stage1, so only the five AIR contributions enter the challenge hash.

Args:
air_data: Dict mapping AIR name → AIRStage1Data for all five Simple AIRs.

Keys must include: ‘SimpleLeft’, ‘SimpleRight’, ‘U8Air’, ‘U16Air’, ‘SpecifiedRanges’ (order determines accumulation order).

Returns:

SimplePiloutStage1Result with verkeys, stage1_commitments, and global_challenge.