Skip to main content

Module snark

Module snark 

Source
Expand description

SNARK verification integration for the node.

This module integrates the SNARK verification state machine with the node’s Redux store, enabling verification of:

  • Block proofs: Consensus-layer proofs validating block production
  • Transaction proofs: Ledger proofs for transaction validity (SNARK work)
  • User commands: Signatures and zkApp proofs for user transactions

§Architecture

The module re-exports mina_snark and provides the [redux::SubStore] implementation that connects the SNARK state machine to the node’s global state.

Verification runs in dedicated threads to avoid blocking the main Redux loop:

  • Block verification: Single dedicated thread (block_proof_verifier)
  • Work/command verification: Rayon thread pool with FIFO scheduling

For the underlying verification implementation, see mina_snark and [ledger::proofs::verification].

Modules§

block_verify
block_verify_effectful
Block Verification Service Layer
snark_effects 🔒
user_command_verify
user_command_verify_effectful
work_verify
work_verify_effectful

Structs§

BlockVerifier
Verifier index for block proofs (consensus layer / block selection). Lazily initialized and cached globally.
SnarkConfig
SnarkState
TransactionVerifier
Verifier index for transaction proofs (execution layer / transaction confirmation). Lazily initialized and cached globally.

Enums§

SnarkAction
SnarkEvent

Traits§

SnarkStore

Functions§

calc_merkle_root_hash
Computes the root hash of the merkle tree with an account and its merkle path
get_srs
Returns the Structured Reference String (SRS) for SNARK verification. Delegates to ledger::verifier::get_srs with Fp field type.
snark_effects
srs_from_bytes
srs_to_bytes
verifier_index_from_bytes
verifier_index_to_bytes

Type Aliases§

SnarkActionWithMeta
SnarkActionWithMetaRef
VerifierIndex
VerifierSRS