Before explaining what Rollups are, it is important to understand the Blockchain Trilemma. The concept explains the three problems every blockchain needs to solve to be successful. Decentralization, Security and Scalability are the three problems. The trilemma exists due to the fact that solving one of these problems may be at the detriment of one or both of the other problems.
Scalability refers to the efficiency of a blockchain at processing transactions. The ability of the blockchain to process and confirm transactions fast.
The Ethereum blockchain current has 15 TPS (Transactions Per Second). This has led to congestion in the network when there is a high level of activity. To solve this congestion, the network needs to be scaled. Scaling Layer 1, building Sidechains — which are built on the side of a Layer 1 — and scaling with Layer 2 are the current solutions available. Layer 1 is a term used to refer to the underlying main blockchain architecture. While Layer 2 is the term used to refer to solutions built on top of Layer 1. In simple terms, Layer 1 is the land, Layer 2 is the structure built on the land.
Scaling Layer 1 would involve building specialized nodes or having bigger blocks to handle the increased workload on the network. The drawback here is that it leads to higher centralization which reduces security. This form of Layer 1 scaling alone will be disadvantageous to the users as the decentralization of the network— which is the ethos of cryptocurrency —will be eliminated.
Scaling Layer 2, on the other hand, would produce more benefits. Layer 2 processes transactions off-chain while leveraging the security and consensus model of Layer 1. Examples of Layer 2 scaling solutions are Channels, Plasma and Rollups
Rollups processes transactions outsider Layer 1 and then post the transaction (TX) data on Layer 1. They take the computation and storage of transactions off-chain but retain some data per transaction Layer 1.
Rollups bundles or “rolls ups” transactions into a batch, compress the data and posts on the Ethereum Layer 1. Rollups help scale the network by processing transactions off-chain which reduces pressure on the Ethereum network.
As impressive as this sounds, you will naturally ask how the solution protects against fraudulent people who may submit false transactions to the rollup for their benefit.
You probably wonder how the rollup confirm if the batched transactions are correct. This query is very important because there are two types of solutions to this problem and these two form the two types of rollups
Let's look at the two types of rollups
Optimistic Rollups
Optimistic Rollups use fraud proofs.
It allows the batch to be posted assuming it is correct — in good faith. In a case, it is correct and there is no fraud, the rollup has no work to do.
However, if the batch is false, the system begins processes to identify and punish the perpetrator.
Optimistic Rollups make use of a dispute resolution system. This system validates fraud proofs and executes punishments. There are usually two parties in a dispute resolution system; the user submitting the batch and the suspecting user who submits the fraud proof. They both provide a bond in ETH, this bond will be slashed in the event of misbehaviour by any of them.
For instance, a user submits a batch of transactions and it is posted, if another user suspects the batch of transactions to be false, they submit a fraud proof. The system will re-execute the transaction on Layer 1, it does this while maintaining the current state of the network when the batch was initially posted.
If the batch is found to be fraudulent, the user who submitted the batch of transactions will have their ETH slashed. On the flip side, if the batch of transactions is valid, the user providing the fraud proof with have their ETH slashed. This is to discourage users from spamming the network with false fraud proofs.
It appears as if no one posts a fraud proof, false transactions will be posted. However, the system is built to work as expected and be able to detect fraud if there is only one honest user that monitors the rollup and submits fraud proof if or when needed.
Optimistic Rollup Projects include Optimism, Arbitrum, Boba Network and so on.
ZK Rollups
ZK (Zero-Knowledge) Rollups make use of validity proofs.
Essentially, every batch includes a cryptographic proof called a ZK-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge).
ZK-SNARK allow users to send transactions across a blockchain in a completely encrypted manner. These transactions cannot be read by anyone, however, it at the same time signifies the transactions are legitimate and valid.
For example, Zero-knowledge proof allows Tunde to prove to Chinedu that a statement is true without providing any information more than the validity of that statement. Imagine verifying to someone that you are the owner of a social media account without providing the username and password. This is how ZK-SNARKs work.
They automatically prove that the batch submitted is valid as soon as it is submitted. The proof can be verified quickly on Layer 1, no matter the size of the computation.
ZK Rollup Projects include Hermez, Immutable X, DeversiFi, zkSync, Aztec, Loopring and so on.
Optimistic VS ZK Rollups
The following are the differences between Optimistic and ZK Rollups:
Both types of Rollups have their uniqueness which forms their advantages and disadvantages. Some people believe ZK Rollups are superior due to their speed, however, they are very complex to create and are not easy to make compatible with EVM (Ethereum Virtual Machine). Optimistic Rollups may be slower — takes almost a week to confirm — but it is less complex to build and more EVM-compatible.
Vitalik Buterin has this to say about these rollups:
In general, my own view is that in the short term, optimistic rollups are likely to win out for general-purpose EVM computation and ZK rollups are likely to win out for simple payments, exchange and other application-specific use cases, but in the medium to long term ZK rollups will win out in all use cases as ZK-SNARK technology improves.
Conclusion
Rollups are very useful in scaling Layer 2 Ethereum, they are explained to be key in the future of scaling the network. Even with the coming of Eth2, Rollups will still be useful as the network will still need the help of Layer 2 solutions to process and confirm transactions quickly.
Sources and Further Readings:
- An Incomplete Guide to Rollups
- Rollups — The Ultimate Ethereum Scaling Solution
- Privacy Coins and zk-SNARKs: How Do They Work?
- A rollup-centric ethereum roadmap
Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing