Expand description
STARK-based primitives for proof generation and verification over AIRs.
Modules§
- air
- Building blocks for defining AIRs.
- ir
- Base types, enums, and structs for the constraint compiler.
- operations
- Common AIR operations used across SP1.
- prover
- Prover components.
- septic_
curve - Elliptic Curve
y^2 = x^3 + 45x + 41z^3over theF_{p^7} = F_p[z]/(z^7 - 3z - 5)extension field. - septic_
digest - Elliptic Curve digests with a starting point to avoid weierstrass addition exceptions.
- septic_
extension - A septic extension with an irreducible polynomial
z^7 - 3z - 5. - shape
- Utilities for working with shapes
Macros§
- chip_
name - Macro to get the name of a chip.
Structs§
- AirOpened
Values - The opening values for a given table section at a random point.
- Chip
- An Air that encodes lookups based on interactions.
- Chip
Dimensions - A specification of preprocessed polynomial batch dimensions.
- Chip
Evaluation - The evaluations for a chip
- Chip
Opened Values - The opening values for a given chip at a random point.
- Chip
Statistics - Statistics about a chip.
- Constraint
Sumcheck Folder - A folder for the zerocheck sumcheck poly.
- Debug
Constraint Builder - A builder for debugging constraints.
- Generic
Debug Public Values Constraint Folder - A folder for verifier constraints.
- Generic
Verifier Constraint Folder - A folder for verifier constraints.
- Generic
Verifier Public Values Constraint Folder - A folder for verifier constraints.
- GkrProver
Impl - TODO
- Interaction
- An interaction for a lookup or a permutation argument.
- Interaction
Builder - A builder for the lookup table interactions.
- Interaction
Data - The data for an interaction.
- Interaction
Layer - An interaction layer of the GKR circuit (
num_row_variables== 1). - LogUp
Evaluations - The data passed from the GKR prover to the zerocheck prover.
- LogUp
GkrCpu Layer - A layer of the GKR circuit.
- LogUp
GkrOutput - The output of the log-up GKR circuit.
- LogUp
GkrVerifier - Verifier for
LogUpGKR. - Logup
GkrCpu Circuit - A trace generator for the GKR circuit.
- Logup
GkrCpu Trace Generator - A trace generator for the GKR circuit.
- Logup
GkrProof - The proof for the log-up GKR circuit.
- Logup
GkrRound Proof - The proof for a single round of the log-up GKR circuit.
- Logup
Round Polynomial - Polynomial representing a round of the GKR circuit.
- Machine
- A STARK for proving RISC-V execution.
- Machine
Proof - A complete proof of program execution.
- Machine
Shape - A shape for a machine.
- Machine
Verifier - A verifier for a machine proof.
- Machine
Verifying Key - A verifying key.
- Merkle
Proof - A Merkle tree proof for proving membership in the recursion verifying key set.
- Poseidon2
Koala Bear Config - SP1Recursion
Proof - An intermediate proof which proves the execution of a Hypercube verifier.
- SP1Verifying
Key - The information necessary to verify a proof for a given RISC-V program.
- SP1Wrap
Proof - An intermediate proof which proves the execution of a Hypercube verifier.
- Shard
Context Impl - The canonical type implementing
ShardContext. - Shard
Opened Values - The values of the chips in the shard at a random point.
- Shard
Proof - A proof for a shard.
- Shard
Verifier - A verifier for shard proofs.
- Testing
Data - Data required for testing.
- VcsError
- The error type for Merkle proof verification.
- Word
- An array of four u16 limbs to represent a 64-bit value.
Enums§
- GkrCircuit
Layer - A layer of the GKR circuit.
- Interaction
Kind - The type of interaction for a lookup argument.
- Logup
GkrVerification Error - An error type for
LogUpGKR. - Machine
Verifier Error - An error that occurs during the verification of a machine proof.
- Opening
Shape Error - An error that occurs when the shape of the openings does not match the expected shape.
- Polynomial
Layer - A layer of the GKR circuit for the
LogupRoundPolynomial. - Shard
Verifier Error - An error that occurs during the verification of a shard proof.
Constants§
- DIGEST_
SIZE - The digest size.
- MAX_
CONSTRAINT_ DEGREE - The maximum constraint degree for a chip.
- NUM_
SP1_ COMMITMENTS - The number of commitments in an SP1 shard proof, corresponding to the preprocessed and main commitments.
- PROOF_
MAX_ NUM_ PVS - The maximum number of elements that can be stored in the public values vec. Both SP1 and recursive proofs need to pad their public values vec to this length. This is required since the recursion verification program expects the public values vec to be fixed length.
Traits§
- Hashable
Key - A trait for keys that can be hashed into a digest.
- Machine
Record - A record that can be proven by a machine.
- Shard
Context - A shortcut trait to package a multilinear PCS verifier and a zerocheck AIR. Reduces number of
generic parameters in the
MachineVerifiertype andAirProvertrait.
Functions§
- debug_
constraints - Checks that the constraints of the given AIR are satisfied, including the permutation trace.
- debug_
constraints_ all_ chips - Checks that the constraints of all the given AIRs are satisfied on the proposed witnesses sent
in
mainandpreprocessed. - debug_
interactions - Debugs the interactions of a chip.
- debug_
interactions_ with_ all_ chips - Calculate the number of times we send and receive each event of the given interaction type, and print out the ones for which the set of sends and receives don’t match.
- indices_
arr - Get an array
xssuch thatxs[i] = i. - inner_
perm - Get the inner perm
- koalabears_
to_ bn254 - Convert 8
SP1Fieldwords into aBn254Frfield element by shifting by 31 bits each time. The last word becomes the least significant bits. - log2_
ceil_ usize - Compute the ceiling of the base-2 logarithm of a number.
- next_
multiple_ of_ 32 - Returns the internal value of the option if it is set, otherwise returns the next multiple of 32.
- pad_
rows_ fixed - Pad to the next multiple of 32, with an option to specify the fixed height.
- vec_
to_ string - Converts a vector of field elements to a string.
- verify_
merkle_ proof - Verify a Merkle proof.
- words_
to_ bytes_ be - Utility method for converting u32 words to bytes in big endian.
Type Aliases§
- Debug
Public Values Constraint Folder - A folder for verifier constraints on public values.
- InnerSC
- A type alias for the shard contexts used in all stages of SP1 proving except wrap. Generic only in the AIR (allowing this SC to be used for the Risc-V and the recursion AIRs).
- Machine
Verifier Config Error - Derive the error type from the machine config.
- OuterSC
- A type alias for the shard contexts used in the outer (wrap) stage of SP1 proving. Generic only in the AIR.
- SP1Basefold
Config - The basefold configuration (field, extension field, challenger, tensor commitment scheme) for SP1.
- SP1Inner
Pcs - The PCS used for all stages of SP1 proving except for wrap.
- SP1Merkle
Tree Config - The Merkle tree configuration for SP1.
- SP1Outer
Pcs - The PCS used for wrap proving.
- SP1Pcs
- The Multilinear PCS used in SP1 shard proofs, generic in the
IopCtx. - SP1Pcs
Proof - The PCS proof type used in SP1 shard proofs.
- SP1Pcs
Proof Inner - The proof type for all stages of SP1 proving except for wrap.
- SP1Pcs
Proof Outer - The proof type for wrap proving.
- SP1SC
- A type alias assuming
SP1Pcs(stacked Basefold) as the PCS verifier, generic in theIopCtxand the AIR. - Shard
Context Proof - The
ShardProoftype generic inGCandSC. - Shard
Verifier Config Error - Derive the error type from the jagged config.
- Verifier
Constraint Folder - A folder for verifier constraints.
- Verifier
Public Values Constraint Folder - A folder for verifier constraints on public values.