

This off-chain VM is the execution environment for transactions on the ZK-rollup and serves as the secondary layer or "layer 2" for the ZK-rollup protocol. Off-chain virtual machine (VM): While the ZK-rollup protocol lives on Ethereum, transaction execution and state storage happen on a separate virtual machine independent of the EVM. Thus, Ethereum serves as the base layer or "layer 1" for the ZK-rollup. Another on-chain contract (the verifier contract) verifies zero-knowledge proofs submitted by block producers. This includes the main contract which stores rollup blocks, tracks deposits, and monitors state updates. On-chain contracts: As mentioned, the ZK-rollup protocol is controlled by smart contracts running on Ethereum. The ZK-rollup's core architecture is made up of the following components: This transaction record is immutable, much like the Ethereum blockchain, and forms the ZK-rollup chain. ZK-rollups execute transactions outside of Mainnet, but periodically commit off-chain transaction batches to an on-chain rollup contract. How do ZK-rollups interact with Ethereum?Ī ZK-rollup chain is an off-chain protocol that operates on top of the Ethereum blockchain and is managed by on-chain Ethereum smart contracts. On-chain data publication is a significant cost for rollups, so data compression can reduce fees for users. ZK-rollups use compression techniques to reduce transaction data-for example, accounts are represented by an index rather than an address, which saves 28 bytes of data. Information in calldata is published on the blockchain, allowing anyone to reconstruct the rollup’s state independently. calldata is where data that is included in external calls to smart contract functions gets stored. ZK-rollups write transactions to Ethereum as calldata. Conversely, withdrawing funds from optimistic rollups is subject to a delay to allow anyone to challenge the exit transaction with a fraud proof. There are no delays when moving funds from a ZK-rollup to Ethereum because exit transactions are executed once the ZK-rollup contract verifies the validity proof. This means that ZK-rollups only need to provide validity proofs to finalize transactions on Ethereum instead of posting all transaction data on-chain like optimistic rollups. As mentioned, the validity proof is a cryptographic assurance that the state-change proposed by the rollup is really the result of executing the given batch of transactions.
#USING VISUAL UNDERSTANDING ENVIRONMENT LAYER UPDATE#
To update this state, ZK-rollup nodes must submit a validity proof for verification. The ZK-rollup's state is maintained by a smart contract deployed on the Ethereum network. The validity proof demonstrates with cryptographic certainty that the proposed changes to Ethereum's state are truly the end-result of executing all the transactions in the batch. They also produce validity proofs to prove the correctness of their changes. ZK-rollup operators submit a summary of the changes required to represent all the transactions in a batch rather than sending each transaction individually. Off-chain computation reduces the amount of data that has to be posted to the blockchain. Zero-knowledge rollups (ZK-rollups) bundle (or 'roll up') transactions into batches that are executed off-chain. You should have read and understood our page on Ethereum scaling and layer 2. This summary data defines the changes that should be made to the Ethereum state and some cryptographic proof that those changes are correct. ZK-rollups can process thousands of transactions in a batch and then only post some minimal summary data to Mainnet. Zero-knowledge rollups (ZK-rollups) are layer 2 scaling solutions that increase throughput on Ethereum Mainnet by moving computation and state-storage off-chain.
