Rollups are one type of solution that have been devised to help solve the scalability problem that has plagued the Ethereum ecosystem.
As noted by Ethereum, when the network gets busy, transaction speeds suffer making the user experience poor for certain types of dApps. As the network gets busier even further, gas prices increase as transaction senders aim to outbid each other. This can make using Ethereum expensive.
As a way of freeing up the possible load on the network, rollups are solutions that perform transaction execution outside the main Ethereum chain (layer 1). However, rollups post transaction data on layer 1, which means they still inherit the security properties of the main chain.
Properties of rollups:
Transactions are executed outside the main chain (layer 1)
Optimistic rollups sit in parallel to the main Ethereum chain on layer 2. They can offer improvements in scalability because they don’t do any computation by default. Instead, after a transaction on layer 2, they propose the new state to Mainnet or “notarise” the transaction.
As computation is the slow, expensive part of using Ethereum, Optimistic rollups are reported to be able to offer up to 10-100x improvements in scalability dependent on the transaction.
Optimistic rollups treat all transactions as legitimate by default, but utilize fraud proofs to verify this.
If a validator notices a fraudulent transaction, the rollup will execute a fraud-proof and run the transaction’s computation using the available state data. This means you may have longer wait times (several days) for transaction confirmation than a ZK-rollup because the transaction could get challenged.
Zero-Knowledge (ZK) Rollups
ZK-rollups leverage complex mathematical proofs which allow the Ethereum network to quickly verify and accept the legitimacy of a given transaction batch.
They bundle (or “roll-up”) hundreds of transfers off-chain and generate a cryptographic proof known as a SNARK (succinct non-interactive argument of knowledge). This is known as a validity proof and is posted on layer 1.
With a ZK-rollup, there are no delays when moving funds from layer 2 to layer 1 because the validity proof accepted by the ZK-rollup contract has already verified the funds.
In a nutshell, rollups free up the mainnet by computing trasactions off-chain, on layer 1. While optimistic rollups utilize fraud proofs to confirm credibility of trasactions to be written to the mainnet, ZK-rollups employ validity proofs to quickly verify transactions batches.