Maker Minds Hub — What is a Rollup?
Welcome to another edition of Maker Minds Hub! I’m absolutely thrilled to have you here for a new edition. Today, we’re taking a quick dive into the concept of Rollups.
Before I start, I invite you to share this with your friends and family!
The problem we encountered was that around 2020, Ethereum was clogged because the calls for smart contracts completely exploded and its limit of 15 transactions per second was no longer sufficient to meet all the requests. From 15 transactions per second on the network, the fees start to explode and we arrive at transactions with totally aberrant amounts. This is where Rollups come into play to relieve the main Ethereum blockchain.
The concept of Rollup dates back to 2014 and it was first described by Vitalik Buterin. It is important to know how the system works.
But what is a Rollup?
A Rollup is an off-chain aggregation of transactions within a smart contract e.g. Ethereum that reduces fees and congestion by increasing the throughput of the blockchain. The transactions will be burned into the blockchain later perhaps ten days, or fifteen days later. The rollup publishes just enough blockchain information for any observer to reconstruct the state, i.e. account balances, and detect the possible invalidity of a transaction. Rollups aim to solve the scalability problem encountered by Ethereum.
Layer 2 Protocols
The main protocols aimed at solving the Ethereum blockchain's scalability problem through a second layer are state channels, Plasma, and Rollups. The first two solutions are "complete" representations of Layer 2.
Indeed, Plasma and state channels try to move data and computations off-chain, but this poses security problems, as these transactions do not benefit from the security offered by the Ethereum main chain.
Rollups, on the other hand, are a "hybrid" layer 2 representation. That is, they move the calculation off-chain while keeping some data per transaction on the chain. Thus, in addition to exporting part of the calculation and validations outside the chain, the information kept on the chain is compressed to reduce its size and gas consumption.
Consequently, knowing that a classic transaction costs on average 45,000 Gwei on the main Ethereum chain, it costs only 300 Gwei when it is transported and compressed thanks to a Rollup.
How does a Rollup work?
Like other blockchains, especially Ethereum, rollups work through Merkle trees. Thus, all the data of a rollup must potentially be contained in a Merkle tree which acts as a reference for the rollup state.
Each rollup solution thus benefits from a smart contract that can be found on the main chain of the network, which contains the root state of the rollup, itself concretely constituting the contract code. This state, which is considered valid, serves as a basis for evaluating future states.
Optimistic Rollups vs ZK Rollups
Optimistic Rollups use fraud proofs in the event of a challenge: the rollup contract keeps track of its entire history of state roots and the hash of each batch. If anyone discovers that one batch had an incorrect post-state root, they can publish proof to the chain, proving that the batch was computed incorrectly. The contract verifies the proof and reverts that batch and all batches after it.
ZK Rollups use validity proofs: every batch includes a cryptographic proof called a ZK-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge), which proves that the post-state root is the correct result of executing the batch. No matter how large the off-chain computation, the proof can be very quickly verified on-chain.
And that’s a wrap-up! If you enjoy what I do, don't forget to like, it gives me the strength to keep going!
And keep in mind, if you're hungry for more news, we delve into every detail in my weekly newsletter!
Tony.
Click here to connect on Twitter.
Have a nice week!