Validium is a scaling solution that stores data and processes transactions off-chain to improve throughput.
Deposit - User sends funds to our on-chain smart contract. The contract broadcasts a deposit event, which is then picked up by the off-chain node and the user's off-chain balance is credited with an amount equal to their deposit.
Withdrawal - To withdraw funds, the user initiates a withdrawal transaction and submits it to an off-chain Operator, who validates the withdrawal request. The off-chain Operator then generates a zkSNARK attesting to the integrity of the data batch and sends it to the on-chain verifier. Once the zkSNARK is verified, the fund is released and the user can call the contract to complete the withdrawal.
Merkle Root
In order to achieve maximum efficiency, data is stored in a Merkle tree structure. It is to repeatedly hash different subsets of data, a hash is sent instead of sending the data that is not needed. A tree data structure is illustrated below:
The Merkle root hash (RT1, RT2) is the only part that needs to be stored on chain. To prove a certain value, you provide all the hashes that need to be combined with it to obtain the root. For example, to prove b1 you provide b2, hash2, and hash6.
By using Merkle root, it allows us to only store one Merkle root on-chain regardless of how many changes are made to the balance values of b1 to b8, the Merkle root will reflect them all so it largely reduces the number of transactions required to be submitted on-chain.