The Technology to Finally Fix Ethereum: Rollups
This is a beginners guide to Rollups technology, A Layer 2 solution to solve Ethereums scalability issues.
All blockchains face the same problem when being developed. Known as the blockchain trilemma, the problems are decentralization, security, and scalability. Every blockchain has only managed to solve 2 out of the 3. In the case of Ethereum, it is decentralized and secure, but lacks in the scalability department. Whether you participate in Ethereum or not, you may have heard of the term gas fees. Gas fees is essentially the fee you pay when executing a transaction and this payment is made to compensate for the computational energy used by your transaction. Currently, the Ethereum network has a limit of 15 transactions per second (TPS) which is nowhere near enough considering the sheer demand there is to use Ethereum and its flourish ecosystem of dApps. This scenario essentially creates a bottleneck where the network is clogged with transactions which sends gas fees skyrocketing. Everyone is fighting for their transaction to be validated and executed first and some people are willing to pay a higher gas fee than others to make sure of it, in essence meaning that the demand for having a transaction included in a block outweighs the supply of the space in the block by a lot and the result is prohibitively expensive gas fees. This creates a problem wherein you can only use Ethereum if you have significant capital. This is obviously not what the aim of Ethereum as a network is, it is meant to give unprecedented financial access to everyone in the world. It wants to level the playing field rather than being a playground for the rich. Hence, Ethereum requires scaling solutions and they need them quickly. Community consensus is that the best way to scale the blockchain is through something known as layer 2 scaling solutions. There are 3 broad categories of layer 2 scaling solutions: Plasma, State channels, and Rollups. For this article I will be going through Rollups.
If you don’t know what Layer 2 means you can look at it this way, Layer 1 is the original main blockchain where the consensus takes place and the applications are built, so when the Layer 1 gets congested you can have a smart contract that connects to a “layer 2” off the main chain (or off-chain) where the transactions can be processed and bundled up to be returned to the main chain where it can be validated/verified. Some thought has been given to solving scalability on the base layer (Layer 1) but that means that Ethereum would have to increase the limit of their blocks to allow more TPS. The result would be that the hardware required to become a miner/validator would be very expensive (i.e setting up a node) and eventually Ethereum would become increasingly centralized. Hence, layer 2 solutions are the preferred option.
Now that the basic premise of why rollups are necessary have been established, let’s look at what they are. Rollups are a very clever scaling solution; they essentially move the computation process off-chain onto separate chains called ‘rollup chains’. On these rollup chains, the transactions are executed after which the data is batched/aggregated and rolled up together and then transferred to the main chain where it is ready to be validated. Hence, the name rollup. The computation process is taken off-chain and the data that has to fit into the Ethereum blocks on the main chain is also reduced, both of which allow the reduction of network congestion. The intermediary of this process is a smart contract that connects the rollup chain to the main, and the main function of this contract is to facilitate transfers and verify that everything that is happening off-chain is done following the rules. The hypothesized benefits of this rollup technology is that it can increase TPS from 15 TPS to 1000 TPS while reducing gas fees per transaction from 45,00 GAS to around 300 GAS. Rollups have been discussed and debated heavily by members and developers of the Ethereum community. The debate stems from the two types of rollup technologies available. Optimistic Rollups and ZK-Rollups (Zero-Knowledge Rollups).
Optimistic Rollups
Optimistic rollups use something called fraud proofs, to understand this let’s look at the process. Optimistic rollups do not perform any computation because they simply run parallel to the main Ethereum chain and after the transactions are executed and batched, they simply post the data to the main chain and assume that it’s correct (hence the name optimism). The obvious question here is that how can they just assume that it’s correct? Doesn’t that make it easy for anyone to just exploit the chain? Well, that is where the fraud proofs element comes in. They have a mechanism named Dispute Resolution System. In the event that someone sends an invalid or fraudulent transaction from the rollup chain to the main chain, there needs to be a system to catch and penalize that person and it goes like this.
The party that wants to submit the batch of transactions to the main chain can only do so if they provide a bond as well. This bond is usually in $ETH. If other parties in the network spot an invalid or fraudulent transaction they can submit a fraud proof. By submitting this fraud proof the transaction is then run again but this time on the main Ethereum chain, and if it is found to be fraudulent then the bond is slashed and that person loses their money. This creates a system to disincentivize malicious behavior. It is important to note that this works both ways, even the parties that submit the fraud proofs have to submit it with a bond and if the transaction is not fraudulent then they lose their bond. This ensures that the network doesn’t get overloaded with multiple unnecessary fraud proofs.
Optimistic rollups have already been put to use through two main protocols. Optimism and Arbitrum. Both of these have launched on the mainnet in different ways to varying degrees of benefit. However, for this article I will not go into the details of these protocols. For a more detailed review on these projects I would recommend watching the Finematics Youtube video linked at the bottom of this article.
The main issue with optimistic rollups is the time. Before the transactions are validated on the main chain, there has to be sufficient time given for fraud proofs to be sent and to be absolutely certain that no fraudulent transactions are in the batch. So, let’s say that you submitted a transaction for a token swap on an optimistic rollup chain, you will have to wait for the batch that your transaction is in to go through the dispute resolution system and if there is a fraudulent transaction involved then it has to be solved and only then can the transactions be validated. This process can take days and sometimes 2 weeks which means you could be waiting for a long time before your transaction gets executed. Hence, there is a more sophisticated technology designed known as ZK-Rollups.
ZK-Rollups
ZK-rollups use something known as ZK proofs. It works by doing the computation and data storage process off-chain and the batches are sent to the Layer 1 chain where they are instantly verified or rejected. This can be done instantly because of this complex piece of cryptography called ZK proofs. To simplify it, think of the data as a secret message and the ZK proof as a tool that allows you to prove that you know the secret message without ever having to reveal what the secret message is (hence Zero Knowledge). All through the power of mathematics. The batches of transactions are a signed and sent to the main chain with just a header as an identifier after being processed off chain, so to make the verification process quicker and easier, the signatures are replaced with something known as a ZK SNARK (Zero Knowledge Succinct Argument of Knowledge) which is attached to every batch on Layer 1. Much like proofs, it is a way to show that you know some secret information without having to reveal it while also further reducing the data sent to the main chain. This zero knowledge proofing system is what allows for the instant verification or rejection of transactions.
This technology is extremely complex and what I have mentioned above is the very simple and basic overview of it. Take your time to re-read it because it is a very important piece of technology that most expect to be the long term solution to Ethereums scaling problems. It solves the gas fee issue while solving the transaction time issue and technology is designed in such a way that it is impossible for a party to submit fraudulent or malicious transactions.
However, ZK rollups also have their drawbacks. While it may seem like the better solution in comparison to optimistic rollups for scaling, it is not EVM-compatible. Not being EVM-compatible means that existing applications on the main Ethereum chain will not be able to easily move to the rollup chain. They will have either rewrite the code or rewrite the logic of the application. Recognizing this as major issue, the team at ZK sync has made significant advancement in making an EVM compatible ZK rollup chain. If they’re successful then ZK-rollups will truly be the game changer that Ethereum needs.
There are a ton of projects making use of ZK-rollups in different ways which I will simply mention, but for a more in depth review I would recommend going through the Youtube video below and their individual websites. The projects are Loopring, Hermez, ZK tube, Aztec, Starkware, and ZK sync. They’re all brilliant and very innovative, I recommend giving them a quick look.
Rollups and DeFi
The Ethereum ecosystem has hundreds of extremely useful DeFi protocols, all of which were being used heavily without rollups. So just imagine when rollups are fully implemented. It unlocks this secure world of DeFi products for literally anybody with an internet connection. Additionally, the low gas fees and reduced transaction times will itself lead to the creation of new projects that inherently depend on low fees and quick transactions to be successful. Hence, not only will thousands of new user be able to use the network, but also thousands of new developers will come to the network. It also means that you will not have to pay more in gas fees than you pay to mint a NFT. It also means gaming on Ethereum can become ten times better as transactions become quicker. Basically, everyone wins.
Concluding thoughts
The main thing to take away from this is that Ethereum can actually be the first blockchain to solve the blockchain Trilemma which means that possibilities will be endless and mass adoption will become even more likely. Most rollup chains have been partially launched on the mainnet where testing and experimentation is taking place and they will all be fully functional very soon. However, you can look at rollups as phase 1.5 because the launch of ETH2.0 is imminent which will make Ethereum even better than it is. I will be doing an in-depth guide to ETH2.0 very soon. Rollups will make cheaper and faster and really begs the question if any other chain will be able to meaningfully catchup to the level of Ethereum. Keep your eyes on the King. Big things are happening.
As always, if you enjoyed then please subscribe to the substack and follow the medium (ITS FREE)
Follow me on twitter @LeftsideEmiri
Thanks for reading.
Resources:
https://vitalik.ca/general/2021/01/05/rollup.html
https://ethereum.org/en/developers/docs/scaling/layer-2-rollups/
https://medium.com/interdax/ethereum-l2-optimistic-and-zk-rollups-dffa58870c93