The Ethereum's scalability solution has created a dichotomy within its fellow community members. With members proposing different scaling solution like Rollsups, Sidechains, Plasma, Channels. Each ones comes with its merits and demerits and I plan to unravel it in this post.
Before we get into scaling lets us first understand the various layer of the Eth block chain. Eth fundamentally has 4 layers. For now I will only be talking about the first two layers.
- Layer 1
- Layer 2
So basically there are 2 ways to scale the ethereum block chain one way uses layer 1 and the other uses layer 2.
- Layer 1 scaling solution is to simply improve the throughput of the network by allowing more transaction capacity.
- Layer 2 scaling solution it to reduce the load on the main chain by moving most of the interaction off-chain.
Layer 1 scaling
One of the proposed way to improve the transactional throughput of the network is by increasing the the number of sophisticated nodes on network, but soon the eth team realized that this solution would lead to centralization as normal users of the network wont be able to afford a super computer to run these sophisticated nodes. To fix this the concept of sharding was introduced.
Sharding is the process of distributing the computing and storage workload into smaller parts called shards. This way each nodes no longer have to process the entire networks transactional load.
The concept of sharding works only when Ethereum moves from the proof of work consensus to proof of stake consensus. This in short is what the team has planned for layer 1 scaling of ethereum and is popularly know as Ethereum 2.0
Layer 2 scaling
Layer 2 scaling is all about moving most of the interaction off-chain instead of doing it on the main chain. The main chain will have smart contracts deployed on it with its role to just perform basic function like deposits/withdrawal and running proofs.
There are many layer2 solutions but we just need to know most widely discussed ones.
Plasma is framework wherein the idea is to create multiple child chains of the parent chain(ethereum). Smart contracts deployed on the parent chain allows the child chains to operate under the parent chain and have interaction with it whenever needed. The plasma uses the concept of merkle trees in its functionality and in this way major chuck of the transaction is offloaded onto the child chains thus allowing cheap and fast transaction. In my previous post I have explained the concept of merkle tree very briefly please do check it out here
One of the demerits of plasma is the long waiting period for withdrawal of funds out of the network.
Rollups function in the similar way to plasma but are slightly different. Rollups bundle up transactions into a batch and send them off to side chains to compute while maintaining the State root value on the main chain. If there are changes in the merkle tree then the state root is updated back on the main chain. This is made possible with the concept of merkle trees. The batches create scalability because they are not using Ethereum for any computation but just as a data storage system. Rollups also solve the game theory issue of data availability problem that exist in the plasma.
There are two types of rollups
- Optimistic Rollups
- Zk rollups
Optimistic Rollups is a mechanism in which when the state root that is submitted on main chain is by default assumed to be true unless challenged by someone. In an event of a fraud the challenger who challenged the batch is rewarded and the sequencer that submitted that batch will be punished by taking over his/hers staked Eth. This punishment is called slashing. For now the community has decided to go ahead with optimistic rollups as a layer two scaling solution.
Zk rollup on the other hand are fast compared to optimistic rollups. Zk rollups submit the batch the state root and a cryptographic proof that the state root is correct. Proofs can be verified on chain for a reasonable cost. Therefore there is no need of fraud proofs like optimistic rollups. Zk rollups are technically complex and does not allow an easy way for existing smart contracts to migrate whereas optimistic rolls do.
For now Ethereum has a long way to go in terms of scalability. With just the implementation of layer 1 scaling, the transaction per second is said to improve to 4k tps, with both layer 1 and layer 2 the tps is said to improve to 100k tps. All of the proposed scaling mechanism have some tradeoffs which will eventually evolve with time.
I have tried to keep this short and less technical, if you want a more detailed information on the above please check out vitalik's blog here
If you made it till here and found it helpful please do consider checking out my other posts
- Ethereums network will be scaled at two layers. Layer 1 and layer2
- Layer 1 scaling includes change from proof work to proof of stake and by sharding.
- In Layer 2 the scaling will be done through optimistic rollups.
- Scaling up with sharding and rollups at layer 1 and layer 2 respectively will improve ethereum's transaction per second from 14 to 100k transaction per second
Note: This post is completely my original work and is posted across various blogging platform.