Today we will explore why scaling layer 1 blockchains is hard and why rollups play an important role in this process
The DCS trilemma
Technology often comes with tradeoffs and triangles are usually a good way to represent these tradeoffs. Take the scope triangle for instance. It illustrates the tradeoffs present in any project. Project managers have to decide how they will balance time, quality and cost of the project. Usually one of these factors such as time is fixed while the other two variables would vary inversely with each other. Here’s how this looks like for decentralized trustless computation. There’s decentralization, consistency and scalability. You can have any two of these but not all three.
Bitcoin and Ethereum for example are fully decentralized and consistent but not scalable because they can only process 7 to 15 transactions per second while the demand is way beyond that. Well then how does one go about scaling ethereum or any other blockchain? There are three ways to do this. The first one is to scale the blockchain itself and it can be called layer 1 scaling. The next one is to build on top of this layer 1 - layer 2 scaling and the last one is to build sidechains. Outside of layer 1, rollups are currently the best general purpose scaling solution. A rollup helps scale blockchains like ethereum by executing transactions outside of layer 1 and then posting the transaction data on layer 1. All these transactions are processed in batches and then added to the main layer 1 chain. In that case how does the layer 1 blockchain know that the transactions processed by the layer 2 solution are legit? Let’s find out!
Each rollup deploys a set of smart contracts on the the layer 1 blockchain that process deposits, withdrawals and validate proofs. The method of validation of these proofs can vary across rollups and fall broadly under two categories: Optimistic rollups and zero knowledge rollups.
Optimistic and zero knowledge rollups
Optimistic rollups use fraud proofs. They post data to the layer 1 blockchain and assume it is correct. This means that no additional effort needs is required in the case of an optimistic scenario. However they incorporate a dispute resolution system. This system penalizes bad actors and disincentivizes fraudulent behaviour. The user submitting batches of transactions to the blockchain, say ethereum, has to sign a bond pledging their eth. Any other network participant can submit a fraud proof if they spot an incorrect transaction. These participants would also be penalized for submitting incorrect fraud proofs. Once a fraud proof is submitted, the system enters a dispute resolution mode and the transaction in question is executed once again but on the layer 1 blockchain directly.
ZK rollups use validity proofs. Here, every batch of transactions posted on the layer 1 blockchain includes a proof called a zk-SNARK (Zero Knowledge - Succinct Non-interactive Argument of Knowledge). The layer 1 blockchain can now verify this proof and determine straight away if the batch of transactions is valid.
ZKPs essentially let someone prove that they know or have something without giving up any information about what they know or have
What is the big difference?
In a dispute resolution situation as in the case of optimistic rollups, enough time needs to be given to the network participants to submit fraud proofs. This can cause a delay in withdrawals to layer 1. On the other side, ZK rollups aren’t entirely the best because of the complexity of the underlying technology. The math behind zero knowledge proofs are so tricky even cryptographers call it ‘moon math’. They are also computationally heavier than optimistic rollups. Both these scaling solutions make a big difference to ethereum’s scalability. They can scale ethereum from 15 - 45 transactions per second to about 1000 - 4000 transactions per second.