This is the 3rd part of our series of blog articles explaining blockchain scaling solutions. If you haven’t read the first 2 parts, follow the link mentioned below.
As we discussed earlier, mainly there are two ways to scale a blockchain ecosystem – either by increasing the transaction capacity of the blockchain itself or moving the bulk of the activity off-chain to a second layer, thus reducing the traffic on the main blockchain.
Now, as we discussed earlier, there are multiple ways to increase the throughput of a blockchain. In part-2, we discussed doing these tasks through sidechains that include having their own consensus mechanism independent of the main chain. Thus compromising on the security as they are not relying on the security of the main chain.
Hence, the concept of rollups emerged as yet another 2nd layer scaling solution without sacrificing the main chain’s security. In our today’s blog post, we’ll be discussing this 2nd layer blockchain scaling solution called rollups.
What are 2nd Layer Rollups?
Rollups are scaling solutions that involve executing the transactions off-chain but posting the transaction data on-chain. Thus relying on the security of the main chain while increasing the transaction throughput. Similar to a PoS consensus mechanism, rollups require operators that stake a given amount in the rollup contract, thus ensuring the right incentives and discouraging any malicious activity.
So, here’s how blockchain scaling works with rollups:
- First of all, rollups transactions are executed on a separate chain by operators.
- Once the transactions are executed, all of the transactions are batched together are posted on the main chain (Ethereum).
Now, the question arises, how can we make sure that the transaction data posted on the main chain (Ethereum) is valid and hasn’t been compromised by a malicious operator. Well, that depends on the type of rollup implementation. Rollups essentially requires a smart contract on the main-chain which has two tasks –
- Processing deposits and withdrawals from on-chain to off-chain
- Verifying proofs and making sure that everything happening off-chain is following the rules.
Types of Rollup Implementation
As we discussed the two main tasks of smart contracts, the difference between types of rollup implementation comes from the 2nd task – verifying the proofs. As of now, there are mainly two types of rollup implementations –
- Zero-Knowledge Rollups (ZK Rollups)
- Optimistic Rollups
As the name suggests, optimistic rollups only run the computations on the 2nd layer and assume the transaction data submitted by operators on layer 1 to be correct. In case of a challenge, the optimistic rollup verifies the validity of transaction data through fraud-proof. Thus reducing the fees for users and increasing the transaction throughput.
However, in case, if an honest node spots an incorrect transaction, the given node can submit a fraud-proof and the system will enter a dispute resolution mode. Once the system enters the dispute resolution mode, it executes the suspicious transaction again, this time on the main chain (Ethereum). If the transaction is indeed proved to be fraudulent, it will be reversed and the system will slash the bonded Eth staked by the operator.
Now, let’s get to another type of roll-up called zero-knowledge rollups.
In this type of rollup, the ZK rollup smart contract executes bundles and executes the transactions on the 2nd layer and generates a cryptographic proof, known as SNARK, which is then posted on the main chain. Hence, rather than posting the transaction data on the main chain, ZK rollups only need cryptographic validity proof.
That’s all for today, in the next blog post, we’ll understand the concept of Zero Knowledge Proofs itself, which will help us to understand how a true statement can be proved without revealing any data.