layer 2

Rollups

Improving Ethereum Scalability

Himanshu Nishal
Coinmonks
Published in
5 min readOct 2, 2022

--

Ethereum, one of the most popular blockchain, after transition to PoS still faces scalability issues. Even though it was very clear the merge wont help with scalability, many people were still believed so. Even after Ethereum’s price being at a low, it still isn't accessible by many. Now what is a Rollup? How would it improve Ethereum Scalability? Let’s talk about Rollups and their types.

Scaling what? trilemma what?

I’ve talked about Ethereum scalability and blockchain trilemma in detail in other post [The Article]. But to give you a brief, Scaling refers to the system’s capability to handle a growing amount of work, or to scale. Scaling of a blockchain trickles down to increasing the block confirmation time and increasing transactions per seconds(Throughput). Scalability of Ethereum has been a hot topic for a while now, the network struggled a lot during the NFT and DeFi boom. Which led to extremely high gas prices, in some cases gas fees costing more than the actual asset being exchanged. Trilemma states that you can only achieve two out of either decentralization, scalability, or security simultaneously, but never all three. Hence solution were proposed to improve scaling of Ethereum network.

What are Rollups?

Rollups basically roll-up or bundle-up transactions and execute them off-chain. Rollups are Ethereum scaling solution which take the load off of layer 1(Ethereum mainnet) and after executing storing the data back on layer 1. Due to this rollups are categorised as layer 2 solution. And unlike other layer 2 solutions like sidechains rollups derive their security from Ethereum mainnet. Rollups reduce computation on the Ethereum mainnet by processing transactions off-chain which significantly improves the transaction speeds and cost. Rollups promise to improve scalability upto 100x.

Executing transactions off-chain allows us to execute more transactions and store them on a block on layer-1, as now instead of the whole transactional data only a small part of it has to fit into a block. In order to achieve this, rollup transactions are executed on a completely separate chain. Following steps are followed:

  1. Executing transactions
  2. Taking the data from the transactions
  3. Compressing the data
  4. Rolling the data up to the main chain in one single batch

Rollups are crucial because they reduce the gas fees(transaction executed off-chain and compressed data is being stored on block) and increase the tps(transaction per second) of ethereum. But an important question arises now, as rollups enable Ethereum nodes not to process every transaction in-order to verify their validity, then how do we know the rolled up transaction being stored on blocks is valid?

These rollup’s generate proofs and these proofs helps us verify the validity of transactions. Rollups deploy a set of smart contracts on Layer 1 which is responsible for processing deposits, withdrawals as well as verifying proofs. Now verification of these proofs is rollup dependent and brings a distinction between rollups:

  1. Optimistic rollups — fraud proofs
  2. ZK rollups — validity proof(zk proofs)

Optimistic rollups

Optimistic rollups work on the scheme of “innocent till proven guilty”. These post data to layer 1 assuming it is correct, hence justifying the name being — ‘optimistic’. In best case scenario, when all the transactions are valid, no action is to be taken. Thats the optimistic scenario, however when there are invalid transaction there is a dispute resolution mechanism. e.g. Optimism, Arbitrum.

When there are invalid transactions, the system is able to identify it and recover to its correct state and penalises the fraud actor by taking away their bond. Optimistic rollups have a dispute resolution mechanism which is able to verify fraud proofs, detecting the bad transactions as well as punishing the bad actors from submitting both invalid transaction and false fraud proofs.

While submitting a transaction(party a)to layer 1 most of the optimistic rollups require you to fill a bond/stake fee in form of ether. If some network participant(party b) spots an incorrect transaction within a specific time period(challenge period), they submit a fraud proof along with some bond ether. The system enters Dispute resolution mode. Now the suspicious transaction is executed again on mainnet this time. If the execution indeed turns out to be fraudulent the responsible bad actor(party a) is penalised by slashing their bonded ether. If in turn the fraud proof turns out to be false and transaction is valid. The bonded ether of bad actor is slashed(party b). This prevents participants from submitting fraudulent transactions as well as false proofs.

Due to this optimistic rollups are implemented in such a way that when it enters dispute resolution mode, the system is able to recall a transaction with the exact state that was presented when the transaction was originally executed. There are certain smart contracts which are responsible for maintaining and restoring the state of the rollup. These contracts solve the Data availability problem. This system is able to detect fraud even when there is only one good actor submitting fraud proofs.

ZK Rollups

Zero-Knowledge rollups, unlike optimistic rollups, don’t have dispute resolution mechanism. Thanks to the use cryptographic Zero-knowledge Proof. Along with changes required to represent all the transactions ZK rollups also produce ZK proofs to prove the correctness of these changes. The ZK-rollup’s state is maintained by a smart contract deployed on the Ethereum network. To update this state, ZK-rollup nodes must submit a validity proof for verification. Thus unlike optimistic rollups, ZK-rollups only need to provide validity proofs to finalise transactions on Ethereum instead of storing all transactional data on-chain. e.g. Starknet, zkSync.

In ZK proofs, two sides don’t need to exchange core information such as the transactional constraints. It’s like showing someone you completed a game without revealing the steps or spoiling the game. So contrary to Optimistic rollup, in ZK rollup while verification whole transaction isn’t executed again on mainnet.

ZK-Rollups batches up a collection of transactions into a single transaction. It then submits a SNARK (succinct non-interactive argument of knowledge) back to the main chain as proof of validity. SNARK proves that the post-state root(change representing transactions) is the correct result of executing the current batch of transaction. SNARK proves that this series of transactions is correctly approved and signed by the users and that the update of the account balance is correct from the previous sate to new state.

In depth about SNARKS/STARKS in coming posts🚀

New to trading? Try crypto trading bots or copy trading

--

--

Himanshu Nishal
Coinmonks

Web3 is evolving with your every breath. Being involved in this booming technology, I speak about blockchain, cryptocurrency, startups, ed-tech and much more.