At Crypto Explained, we are on the mission of making crypto easy for everyone.
If you appreciate our effort, don’t forget to subscribe to receive our weekly Newsletter directly in your email!
This is a Part 2 of 2 on the Type of Layer 2 Scaling Solutions.
The previous week, we introduced the different types of Layer 2s. If you missed out, here is the full article.
Today, we’ll zoom into one of the Layer 2 solutions: Rollups.
The reason Rollups are relevant and therefore worth doing a dedicated article on it, is mainly because they seem to have the best of both worlds: it’s a general-purpose scaling solution, while still fully relying on the security of Ethereum, therefore achieving scalability without compromising on security.
Now, let’s do a quick recap of what Rollups are:
It’s literally a rollup of a group of transactions: it bundles them into one single transaction that is submitted to the base layer.
Rollups should be ready to scale Eth from 15tps to 1000-4000tps (transactions per second).
Each rollup deploys a set of smart contracts in Layer 1 that are responsible for processing deposits and withdrawals and verifying proof.
Based on the kind of proof that a rollup uses, it can be split into 2 types:
If a rollup uses “validity proof”, it’s what we known as “Zkrollup”
If a rollup uses “fraud proof”, then we are talking about an “Optimistic Rollup”.
Side note… for those of you who enjoy philosophy, the difference between the 2 types of rollups is essentially the crypto representation of Hobbes vs Locke's view on human nature.
If you know, you know.
Ok, coming back.
The TLDR is:
Zk-Rollups are faster, more efficient, but because they validate the transactions before posting on the mainnet (Validity Proof), they are technically more complex so they are not EVM compatible. This means developers probably need to rewrite their applications’ code in order to use this kind of rollups, requiring higher effort.
Optimistic Rollups are EVM compatible, so it’s very convenient for smart contracts to adopt. However, because they use a Fraud Proof system, they are normally slower to finalize transactions because they need to wait to see if there is any dispute.
Now, let’s zoom in!
Zk-Rollups
Zk-Rollups is short for Zksnark Rollup, which stands for “zero-knowledge succinct non-interactive argument of knowledge”.
A mouthful, indeed.
Let me break this down for you:
zero-knowledge: means the mainnet does not need to see all the transactions data.
succinct: it’s short
non-interactive: the mainnet does not need to deal with people who verified their work.
argument of knowledge: proof that they provided that their transactions are good.
So when you connect all these words, what you get is essentially every Zk-Rollup posted on Layer 1 includes a cryptographic proof (aka zksnark), that is called a “Validity Proof”, which means someone already went through all the transactions of a specific rollup and found that there are no fraudulent transactions (a bit similar to how PoW works).
This can then be quickly verified by the mainnet’s smart contract when the transaction batch is submitted.
Additionally:
Zk-Rollups are fast and don’t have a withdrawal time issue,
however, their downside is that given its complexity, it’s much harder to create an Ethereum Virtual Machine-compatible Zk-rollup, which makes it more difficult to scale general-purpose applications without having to rewrite the app logic.
It is also more computational heavy, which means the entry barrier is higher.
In conclusion, it is faster and more efficient, but does not provide an easy way for existing smart contracts to migrate to Layer 2.
Some examples of well-known Zk-Rollup projects are: loopring, zktube, aztec, starkware, zksync.
Optimistic Rollups
Optimistic Rollups believe all transactions are good and valid by default (hence “optimistic”). It will only investigate when this assumption is challenged.
Therefore, instead of using Validity Proof, they use “Fraud Proof”.
So everything that an Optimistic Rollup posts in the mainnet is fact-checkable by other network participants, and since this involves people’s money, there is a reasonable assumption that there will always be people checking, hence the system would work.
Fraud Proof and Dispute Resolution system
Fraud Proof is essentially the proof that someone submits when a fraudulent transaction is found.
The Dispute Resolution System is in place to help verify fraud proofs and disincentivize bad actors.
If a transaction is proved fraudulent, then it is reverted and the block validator is slashed, which means part of their staked crypto will be taken away for putting the network at risk, and the slashed amount will be used to reward the network participant who spotted this.
Now, if the transaction ends up being true and valid, then the one who gets slashed is the validator who submitted the Fraud Proof.
Given this incentive mechanism that involves penalizing by slashing staked crypto, the dispute resolution is designed to be more of an exceptional situation.
Additional points:
Optimistic Rollups run on OVM (Optimistic Virtual Machine), which is EVM compatible, meaning they can execute the same smart contracts as the main chain, but they are slower and less efficient.
However, due to the dispute resolution process, Optimistic Rollups have to give enough time to all the network participants to submit their fraud proofs before finalizing a transaction on Layer 1 and this period can be long, which leads to longer withdrawal times. And when we say longer, we are speaking of days.
Final Thoughts
Rollups are still in the early stage of development, but it has received a large amount of excitement and support from the Ethereum community because they can allow for easy migration of existing applications.
If you are interested in going deeper into Rollups and the technicalities of how they work, I’ll leave you with an interesting article published by Vitalik Buterin.
.
Lastly, just reiterating this channel’s message: crypto winter is here, so keep educating yourself, and continue to do your own research.
Thanks for making it this far! If you enjoyed it, make sure to like, subscribe and share, so more people can find us!