protocol.stark_info#

STARK configuration parser.

This module provides two key configuration classes:

StarkStruct (from starkstruct.json):

Protocol-level parameters that define the STARK proof system structure. Includes: domain sizes (n_bits, n_bits_ext), FRI configuration (fold steps, blowup factor), Merkle tree parameters (arity, last_level_verification), and security parameters (n_queries, pow_bits).

StarkInfo (from starkinfo.json):

AIR-specific metadata that defines the constraint system and polynomial layout. Includes: polynomial maps (cm_pols_map, const_pols_map), evaluation map (ev_map), challenge derivation (challenges_map), and memory layout (map_sections_n).

The distinction: StarkStruct is reusable across AIRs with the same domain size, while StarkInfo is specific to each AIR’s constraint polynomial structure.

Attributes#

Classes#

FriFoldStep

FRI recursive folding layer configuration.

StarkStruct

Core STARK protocol parameters.

StarkInfo

STARK configuration loaded from starkinfo.json.

Module Contents#

protocol.stark_info.HASH_SIZE = 4[source]#
class protocol.stark_info.FriFoldStep[source]#

FRI recursive folding layer configuration.

domain_bits: int[source]#
class protocol.stark_info.StarkStruct[source]#

Core STARK protocol parameters.

n_bits: int[source]#
n_bits_ext: int[source]#
n_queries: int[source]#
verification_hash_type: str[source]#
fri_fold_steps: list[FriFoldStep] = [][source]#
merkle_tree_arity: int = 16[source]#
merkle_tree_custom: bool = False[source]#
transcript_arity: int = 16[source]#
last_level_verification: int = 0[source]#
pow_bits: int = 0[source]#
hash_commits: bool = False[source]#
class protocol.stark_info.StarkInfo[source]#

STARK configuration loaded from starkinfo.json.

stark_struct[source]#
name = ''[source]#
n_publics = 0[source]#
n_constants = 0[source]#
n_stages = 0[source]#
proof_size = 0[source]#
custom_commits: list[primitives.pol_map.CustomCommits] = [][source]#
cm_pols_map: list[primitives.pol_map.PolMap] = [][source]#
const_pols_map: list[primitives.pol_map.PolMap] = [][source]#
challenges_map: list[primitives.pol_map.ChallengeMap] = [][source]#
airgroup_values_map: list[primitives.pol_map.PolMap] = [][source]#
air_values_map: list[primitives.pol_map.PolMap] = [][source]#
custom_commits_map: list[list[primitives.pol_map.PolMap]] = [][source]#
ev_map: list[primitives.pol_map.EvMap] = [][source]#
opening_points: list[int] = [][source]#
boundaries: list[primitives.pol_map.Boundary] = [][source]#
q_deg = 0[source]#
q_dim = 0[source]#
c_exp_id = 0[source]#
fri_exp_id = 0[source]#
map_sections_n: dict[str, int][source]#
map_offsets: dict[tuple[str, bool], int][source]#
map_total_n = 0[source]#
map_total_n_custom_commits_fixed = 0[source]#
air_values_size = 0[source]#
airgroup_values_size = 0[source]#
classmethod from_json(path: str) StarkInfo[source]#

Load StarkInfo from starkinfo.json file.

get_offset(section: str, extended: bool) int[source]#

Get buffer offset for a section.

get_n_cols(section: str) int[source]#

Get number of columns in a section.

get_column_key(name: str, index: int = 0) tuple[str, int][source]#

Get the (name, index) key for a column.

Args:

name: Column name (e.g., ‘a’, ‘im_cluster’) index: Index for array columns (default 0)

Returns:

Tuple (name, index) for use as dict key

has_challenge(name: str) bool[source]#

Check if a challenge with given name exists.

get_challenge_index(name: str) int[source]#

Get the index of a challenge by name.

build_column_name_map() dict[str, list[int]][source]#

Build mapping from column names to their pols_map_id indices.

Returns:

Dict mapping name -> list of pols_map_id values e.g., {‘a’: [0], ‘im_cluster’: [16, 17, 18, 19, 20, 21]}