A fraud proof is a cryptographic demonstration that the exchange operator produced an incorrect state transition. Anyone with access to the DA layer can generate a fraud proof for any batch where the engine deviated from the deterministic matching rules.Documentation Index
Fetch the complete documentation index at: https://docs.vela.monolithsystematic.com/llms.txt
Use this file to discover all available pages before exploring further.
When Fraud Proofs Matter
The matching engine is deterministic — given the same inputs (pre-state and requests), it always produces the same outputs (fills and post-state). If the operator publishes a batch claiming a certainpost_root, but an independent prover computing the same batch gets a different post_root, the operator has either:
- Applied the wrong matching logic
- Applied requests in a different order than claimed
- Fabricated fill data
- Made an accounting error in balance updates
Fraud Proof Lifecycle
Batch published
The engine commits a batch and publishes
ZkvmInput { pre_root, requests, expected_post_root } to the DA layer. Any observer can download this.Prover re-executes
An independent prover (anyone running the zkvm crate) fetches the batch from the DA layer and calls
verify_execution():Divergence detected
If the prover’s computed
post_root differs from the expected_post_root published by the engine, the prover has found fraud. The divergence is pinpointed to the specific request where the results first differ.Fraud proof generated
The prover generates a
FraudProof struct identifying:- Which batch (sequence number)
- Which request in the batch (index)
- What diverged (fill amount, balance delta, state root)
- The state snapshot before the divergent request (to allow on-chain re-execution)
On-chain submission (roadmap)
The fraud proof is submitted to the on-chain verifier contract. The contract:
- Fetches the batch data from the DA layer commitment
- Re-executes the specific divergent request from the provided state snapshot
- Compares the result to the operator’s claimed result
- If fraud is confirmed: slashes the operator’s bond and halts new batch acceptance
What Can Be Proved Fraudulent
| Fraud Type | Detectable |
|---|---|
| Incorrect fill price | Yes — price-time priority is deterministic |
| Incorrect fill quantity | Yes |
| Missing fill (order that should have matched didn’t) | Yes |
| Phantom fill (fill reported for non-existent counter-order) | Yes |
| Incorrect balance update | Yes |
| State root forgery | Yes |
| Batch ordering manipulation | Partially (requests within batch are ordered; batch ordering between batches requires additional work) |
| Signature acceptance forgery | Yes — prover verifies all signatures |
What Is Not Yet Trustless (Beta)
In the current beta, the on-chain verifier contract has not been deployed. This means:- Fraud proofs are generated by the zkvm crate
- Fraud proofs are logged locally
- Fraud proofs are not submitted on-chain
- The operator is not penalized on-chain for fraud
Running the Prover Yourself
The zkvm crate is included in the open-source repository. To run the prover against the current beta’s published batches:VALID (batch is correct) or a detailed FraudProof struct identifying the specific divergence.
Fraud Proof Size
The proof size depends on the complexity of the divergence:| Proof type | Approximate size |
|---|---|
| State root mismatch (entire batch) | ~50 KB + state snapshot |
| Single request divergence | ~5 KB + local state snapshot |
| With ZK succinctness (roadmap) | ~2 KB (constant size) |