Why three stages
You can only fetch proofs after you know which keys your module touched.So HDP first discovers keys, then fetches proofs, then replays computation offline.
Flow
Stage 1: Dry run
Purpose:- Execute module against live RPCs
- Collect every key used by EVM/Starknet/injected-state/unconstrained handlers
dry_run_output.json
Stage 2: Fetch proofs
Purpose:- Build proof payloads from keys found in stage 1
- MMR proofs for headers (via Herodotus Indexer)
- MPT/Patricia proofs for state (see Verification model)
- Injected-state proofs from the state server
- Unconstrained payloads (for example bytecode blobs validated later by hash)
proofs.json
--mmr-hasher-config <path>--mmr-deployment-config <path>
Stage 3: Sound run
Purpose:- Verify proofs
- Execute the same module offline (no RPC calls)
- Produce commitments for downstream verification and settlement workflows
task_hashoutput_rootmmr_metas
--proof_mode--cairo_pie <path>--stwo_prover_input <path>(when CLI is built with STWO support)
Consistency requirement
proofs.json must come from the matching dry_run_output.json for the same module and inputs.
