#explain-card
## What is Rollup?
Rollup is a scaling solution for Ethereum that bundles or "rolls up" multiple transactions into a single transaction on the Ethereum mainnet. These rollup transactions are executed on an off-chain rollup network. To inherit Ethereum's security, the rollup network regularly submits transaction data to the Ethereum mainnet. Once the data is uploaded and stored on Ethereum, reverting a rollup transaction requires reverting the Ethereum transaction. This mechanism allows the single transaction fee on Ethereum to be distributed among many transactions in the rollup network, reducing the overall transaction cost.
## Types of Rollup
There are two main types of rollup solutions: Optimistic Rollup and ZK Rollup. They differ in how they handle off-chain transactions execution verification.
### Optimistic Rollup
Optimistic Rollup assumes that transactions are valid by default. The rollup transactions are executed once received, and the execution result is available in the rollup network. The rollup operator then batches these transaction data regularly and submits them to the Ethereum mainnet as calldata or blobs. Optimistic Rollup relies on a fraud-proving mechanism to detect incorrect transactions. There is a challenge period during which users can submit fraud proofs to challenge incorrect rollup transactions. If the fraud proof is valid, the rollup network re-executes the transactions and updates the rollup's state accordingly, penalizing the malicious operator. If no fraud proof is submitted during the challenge period, the rollup transactions are considered valid, and the state change is accepted by Ethereum. See [Optimistic Rollups](https://ethereum.org/en/developers/docs/scaling/optimistic-rollups/) for more details.
### ZK Rollup
ZK Rollup relies on validity proofs to verify that changes in the rollup network follow the rules. The validity proof is a succinct cryptographic commitment based on the Merkle root of the state tree that proves the correctness of the batched rollup transactions. It is generated by the rollup operator and submitted to the Ethereum mainnet. The smart contract on Ethereum verifies the validity proof and updates the state of the rollup network. Unlike Optimistic Rollup, ZK Rollup does not require all the batched transaction data to re-execute the transactions for verification. Therefore, ZK Rollup does not need to publish much transaction data on-chain for validation. However, storing transaction data on-chain is still important for the permissionless and decentralized nature of rollup operators. See [ZK Rollups](https://ethereum.org/en/developers/docs/scaling/zk-rollups/) for more details.
## Optimistic rollup vs ZK rollup
| Criteria | Optimistic Rollup | ZK Rollup |
| :---: | --- | --- |
| Costs | Major cost comes from submitting batches to Ethereum | Major cost comes from generating zk proofs |
| Ethereum Compatibility | Highest smart contract compatibility with Ethereum; supports any contracts without modification | Lower smart contract compatibility; requires developers to change or rewrite contracts with dedicated tools |
| Security | Relies on chain monitoring within the challenge window | No monitoring required, but relies on a trusted setup assumption |
| Latency | Lower latency for transaction confirmation, but higher latency for finality due to the challenge mechanism | Higher latency for transaction confirmation due to zk proof generation, but lower latency for finality |