Layers
- Cairo1 user layer: your module uses
hdp_cairoAPIs. - Bootloader layer (Cairo0): loads and executes the compiled Cairo1 class.
- Verification layer (Cairo0): validates MMR/MPT/Patricia proofs (see Verification model).
- Hint processors (Rust): bridge Cairo VM execution with proof decoding and data handling.
- Orchestration layer (Rust): runs
dry-run,fetch-proofs, andsound-run.
Data flow
Cairo1 and Cairo0 boundary
- Cairo1 module code requests data through
hdp_cairo. - Under the hood this uses VM syscalls routed to HDP handlers.
- In dry run, handlers query RPCs and record accessed keys.
- In sound run, handlers read from already-verified memorizers (offline path).
Syscall model (high level)
- Main selector for HDP data access:
CallContract - Hashing selector used by runtime:
Keccak
- special contract addresses for internal handlers,
- plus chain-id-aware dispatch for EVM vs Starknet access paths.
Why this architecture matters
- You write simple module logic once.
- HDP separates discovery, proof retrieval, and deterministic replay.
- The final execution is reproducible and ready for proof workflows.

