How lambdaclass/cairo-vm works
Project type and purpose
• This is a compiler/interpreter–style project: a complete, production-grade implementation of the Cairo Virtual Machine (VM) in Rust.
• It exposes a CLI (cairo-vm-cli), a tracing UI (cairo-vm-tracer), a Cairo-1 runner (cairo1-run), a fuzzing harness (fuzzer), benchmark drivers (bench), and library crates (vm, corelib, etc.).
• Its goal is to load and execute Cairo programs (compiled JSON), process hints via pluggable hint-processors, and produce outputs/traces/air inputs for proof generation.
File structure
Top-level crates and directories:
• vm: the core VM library
• cairo-vm-cli: command-line interface
• cairo-vm-tracer: web-based trace visualizer
• cairo1-run: runner for Cairo-1 programs
• fuzzer: fuzz-testing harness
• bench: Criterion and IAI benchmarks
• corelib: standard Cairo builtins library
• -no_std: no_std compatibility demo
• examples: custom hints, hyper-threading, WASM demo
• docs, scripts, install-scripts, tests, CI workflows
– program loading & serde
– CairoRunner (execution engine)
– HintProcessor (builtin & Cairo-1 implementations)
– memory & segment manager
– builtin runners (bitwise, hash, ecdsa, keccak, etc.)
– tracing, AIR input/output, context & decoding, error types
README for additional insights
• It describes the user-facing workflow: compile .cairo → JSON → run via CLI → optional flags for trace, memory dump, proof_mode, AIR inputs.
• Explains the HintProcessor interface for extending hints.
• Mentions WebAssembly demo, dynamic layouts, testing and benchmarking workflows.