StarkEx supports two data availability modes: ZK-Rollup and Validium. Each application can choose the mode it prefers. Below, we describe the two modes, and discuss the advantages and disadvantages of each.
In the ZK-Rollup mode, all the relevant data that is used to recover the L2 balances Merkle Tree is published on-chain as calldata. This is enforced by the Cairo program; the output of a Cairo program in ZK-Rollup mode includes, in addition to the proven new state, the complete list of differences of the users' balances from the previous state.
The advantage of the ZK-Rollup mode is that it is trustless. All the data needed to reclaim user's funds on an escape event is right there on the blockchain - there are no additional trust assumptions.
Note: There is an additional cost for trustlessness: in ZK-Rollup, there is a cost per vault that has changed in the batch (gas cost of calldata). In practice this means, that for batches that changed a few thousand vaults or more, the majority of the gas spent in a state update event will be spent on the ZK-Rollup data availability solution, and not on the verification of the proof itself.
In Validium mode - the balances of the users are not published on-chain, but rather sent to several well known and trusted parties, also known as committee members. A state update is valid and accepted on-chain only if at least a quorum of the committee members sign a state update. Specifically, they sign that they know all the new vault balances such that they determine to the new state, as enforced by the availability verifiers.
One advantage of Validium is its cost: the payment for on-chain data is not required with this mode. State update costs only the gas for verifying the proof.
Another advantage is privacy: users' balance information is stored privately with a committee of trusted parties and not publicly on the blockchain.