Optimistic vs. ZK-Validity
There are two approaches to verifiable off-chain computation:
Vela uses the optimistic approach because:
- The proving cost of a ZK-validity proof per batch would be prohibitive at Vela’s throughput (57k+ ops/sec)
- The fraud window provides sufficient security for exchange use cases
- Deterministic execution (fixed-point arithmetic, single-threaded engine) makes fraud proof generation tractable
Architecture
ZkvmInput Structure
Each batch published to the DA layer contains aZkvmInput:
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()
Theverify_execution() function is the heart of the fraud proof system:
- 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:- Fixed-point arithmetic — no floating-point, no platform-dependent rounding
- Single-threaded engine — no nondeterministic scheduling
BTreeMapfor ordered iteration — noHashMapwith randomized iteration order on the hot path- Canonical serialization — all state is serialized with deterministic field ordering
- Same codebase — the prover uses the exact same
enginecrate as the live system