The Censorship Problem
In a purely off-chain exchange, the operator controls which transactions are processed. A malicious or compromised operator could:- Refuse to process orders from specific accounts
- Front-run users by delaying their orders
- Prevent users from withdrawing funds by ignoring withdrawal requests
The DelayedInbox
Vela implements aDelayedInbox pattern (inspired by Arbitrum’s design):
How it works:
-
A user submits a signed transaction (order, cancel, withdrawal) directly to the
DelayedInboxL1 contract by callingsubmitTransaction(bytes signedTx) -
The contract emits a
TransactionQueued(uint256 indexed seq, bytes signedTx, uint256 deadline)event -
The
deadlineisblock.timestamp + FORCED_INCLUSION_TIMEOUT(e.g., 24 hours) -
The Vela engine monitors the L1 contract for
TransactionQueuedevents and processes them automatically — including them in the next batch before the deadline - If the operator does not include the transaction before the deadline: Any party can submit a fraud proof to the on-chain verifier showing that the batch chain is missing the forced transaction. The verifier slashes the operator’s bond.
Forced Inclusion Timeout
The timeout is a security parameter. A shorter timeout provides faster censorship resistance but requires the engine to monitor L1 more frequently.In the current beta, forced inclusion is implemented in the engine codebase but the L1 contract has not been deployed. This feature activates at mainnet (M6).
Withdrawal Guarantee
Forced inclusion is particularly important for withdrawals. In a purely off-chain exchange, users cannot withdraw without the operator’s cooperation. With forced inclusion:- User submits
withdraw(asset, amount)to theDelayedInbox - Engine observes the L1 event and processes the withdrawal
- Engine updates the state to reduce the user’s balance
- The on-chain settlement contract (M6) releases funds to the user’s address
Relationship to Trust Model
Forced inclusion is one of the mechanisms that transitions Vela from a trust-based model to a trustless model:
See Trust Model for the full picture.