Skip to main content
Vela uses an optimistic execution model with a ZK-based fraud proof mechanism. State transitions are assumed correct by default; any party with access to the data availability layer can independently verify them and generate a fraud proof if a discrepancy is found.

Optimistic vs. ZK-Validity

There are two approaches to verifiable off-chain computation: Vela uses the optimistic approach because:
  1. The proving cost of a ZK-validity proof per batch would be prohibitive at Vela’s throughput (57k+ ops/sec)
  2. The fraud window provides sufficient security for exchange use cases
  3. Deterministic execution (fixed-point arithmetic, single-threaded engine) makes fraud proof generation tractable
The “ZK” in “optimistic-ZK” refers to the fact that fraud proofs can be made succinct using ZK techniques. In the current implementation, fraud proofs are computational proofs without ZK succinctness — the ZK component is on the roadmap.

Architecture

ZkvmInput Structure

Each batch published to the DA layer contains a ZkvmInput:
The requests vector contains every order placement, cancellation, and other state-modifying operation in the batch, in the exact order the engine processed them.

verify_execution()

The verify_execution() function is the heart of the fraud proof system:
Key properties:
  • The re-execution is deterministic: identical inputs (same requests, same pre-state) always produce the same outputs
  • The engine used in the prover is the same codebase as the live engine — there is no separate “provable” implementation
  • The first divergence is identified at the request level, not just the batch level, making fraud proofs maximally specific

FraudProof Structure

Current Status

The zkvm prover currently runs locally. In the full architecture, any third party with access to the DA layer can run the prover and submit fraud proofs to the on-chain verifier contract. This is the M7 milestone.

Determinism Guarantees

Fraud proofs only work if the prover’s re-execution is bit-for-bit identical to the original. Vela achieves this through:
  1. Fixed-point arithmetic — no floating-point, no platform-dependent rounding
  2. Single-threaded engine — no nondeterministic scheduling
  3. BTreeMap for ordered iteration — no HashMap with randomized iteration order on the hot path
  4. Canonical serialization — all state is serialized with deterministic field ordering
  5. Same codebase — the prover uses the exact same engine crate as the live system
Any code change to the engine that affects execution results must also be reflected in the DA batch format, or old batches become un-provable. This is managed through the batch schema version field.