Documentation Index
Fetch the complete documentation index at: https://mintlify.com/provablehq/snarkvm/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The synthesizer is the core execution engine of snarkVM that handles program deployment, execution, and zero-knowledge proof generation for the Aleo blockchain. It bridges the gap between high-level Aleo programs and low-level cryptographic proofs.Architecture
The synthesizer crate consists of three main sub-crates:Process
The process module manages program compilation and execution:- Process: Top-level execution coordinator that manages stacks and the universal SRS
- Stack: Program-specific execution context containing register types, proving/verifying keys
- Trace: Records execution history and generates proofs
- Authorization: Encapsulates authorized function calls
Program
The program module defines Aleo program structures:- Program: Container for functions, closures, structs, records, and mappings
- Function: Executable program function with inputs, outputs, and optional finalize logic
- Closure: Reusable code block without state access
- Instruction: Individual operation (add, mul, hash, call, etc.)
- Finalize: On-chain state transition logic
VM
The VM module provides the highest-level interface:- VM: Virtual machine for executing transactions and managing blockchain state
- Handles deployment, execution, and verification of transactions
- Manages consensus storage and finalization
Key Concepts
Authorization
Before execution, function calls must be authorized with a private key. Authorization creates a signed request that proves ownership without revealing the private key.Execution
Execution runs the authorized function and generates zero-knowledge proofs:Deployment
Programs must be deployed before execution:Finalization
After execution produces transitions, finalization updates on-chain state:Type Parameters
Most synthesizer types are generic over:N: Network- The Aleo network (MainnetV0, TestnetV0, etc.)C: ConsensusStorage<N>- Storage backend for VM state
Consensus Versions
The synthesizer supports multiple consensus versions for network upgrades. Different versions may change:- Proof system parameters (Varuna V1 vs V2)
- Program validation rules
- Fee calculation methods
- Record formats
Error Handling
The synthesizer uses specialized error types:VmAuthError- Authorization failuresVmExecError- Execution failuresVmDeployError- Deployment failuresProcessExecError- Process-level execution errors
Performance Considerations
Parallel Execution
The synthesizer uses Rayon for parallel execution when theserial feature is disabled:
Circuit Caching
Proving and verifying keys are cached in the Stack to avoid recomputation:Universal SRS
The Universal Structured Reference String is shared across all programs:Testing
Synthesizer tests are slow due to proof generation. Run specific tests:Related Modules
- Console - Program types and cryptographic primitives
- Circuit - Circuit equivalents for constraint generation
- Ledger - Blockchain state and storage
- Algorithms - Cryptographic algorithms (Poseidon, Marlin, etc.)