A typical Yoruba Nigerian party always includes souvenirs and a variety of food to share with guests. When it's time to share, it often becomes chaotic and time-consuming, with biases, and in the end, food and souvenirs still don't reach all the guests.
My neighbour's wedding came with high expectations and careful planning. In her words, "I want all my guests to be well-fed, and souvenirs must go around." She budgeted for 500 guests, even though invitations were sent out for only 200. You can see she planned it well and was ready to satisfy everyone.
The day arrived like any other. The hall was beautifully decorated, the caterer was prepared, and the souvenirs for 500 guests were sorted out. Everything was going smoothly until I heard, "Food has finished." I looked around the hall, and 40% of the guests had not been served. Immediately, I alerted my mom about the incident.
Like a lioness ready to defend her den, my mom rose and questioned the caterer about how the food ran out. To be honest, the caterer was nervous because she knew the consequences. She said, "Mrs. Adelanke, please don’t be angry. The guests kept coming and asking for food, and I thought everyone had been served." Immediately, more food was prepared, and the rest of the guests were taken care of.
The same issue happened with the souvenirs; only 50% of the guests received them. The bride wasn’t happy, even though there were no complaints (some were left), because most of the guests left angrily due to the food distribution problem.
After the celebration, I sat down and analyzed the incident. I realized that we could have used servers and ushers to manage the distribution of food and souvenirs.
This scenario can be likened to Ethereum’s scalability problem. Ethereum faces challenges in efficiently processing transactions. As the network grew, it struggled to handle multi-transactions, leading to congestion and high gas fees. Layer 2 solutions were developed to address this issue, which acts like servers and ushers in managing the distribution at the party.
This article will reveal how the Ethereum L2 solution has evolved from Earlier solutions like State Channels and Plasma Chain to Rollups and zkEVM, including how these solutions work and their advantages over another.
The adoption of layer 2 scalability solutions in the Ethereum network can be traced to the earlier development of State Channels and Plasma in 2015 and 2017, respectively.
State channels are a scaling technology solution that Ethereum developers have explored since the blockchain first launched in 2015. State channels are peer-to-peer (p2p) protocols that allow two entities to securely transact with one another off-chain while minimizing the interaction with the Ethereum mainnet.
Participants exchange cryptographically signed messages(transactions), and any proposed state update is only valid if it is signed by all involved parties. Once the interaction is complete, the final state is settled on-chain, reducing gas fees and transaction latency.
For more understanding, See State channel as a private board room located out of a company (Ethereum), where managers and department leads hold meetings(transactions), and once the meeting is completed, the secretary closes the meeting and submits the summary to the company.
State channels are likened to an access card in a hotel. You use this card to open your room, enjoy your stay, and then lock it with the card when it's time to check out.
A State channel involves participants, a multi-sig smart contract, a channel, and a blockchain(Ethereum), and it goes through this process:
Due to the shortcomings of State Channel, Plasma chains were first popularized back in 2017 as a scaling solution to off-load data and computation from the Ethereum mainnet. Plasma chains are independent child chains to a parent chain (Ethereum); they operate with their block validation mechanisms and are managed by smart contracts deployed to the parent chain.
You can compare these chains to a mother and her child, where the mother manages and secures the child's life with rules and regulations. The child relieves the mother of the stress of house chores (congestion and computational burden) in her way while staying under her mother’s protection.
State channels and Plasma chains provided initial solutions to reduce transaction execution time and congestion on the Ethereum mainnet, but they have limitations in terms of usability and security. These limitations led to the rise of Rollups.
State Channels require participants to be online and involved in every transaction which means that it can’t be used for border use cases in terms of processing transactions offline. Plasma chains, on the other hand, use their consensus mechanism that doesn’t tally with the parent’s mechanism. Plasma chains also faced challenges with complex exit protocol, data availability issues, complex user experience, and security.
Rollups use more advanced and reliable techniques to process transactions off-chain and then “roll” them up to a single transaction that is submitted to the Ethereum mainnet.
Let's use an analogy to explain Rollup using the examination process. Ethereum is the teacher who sets the questions, and the students’ answer booklets are the transactions. It is time-consuming if the students have to submit their answer booklets to the teacher individually. Instead, the teacher employs invigilators (Rollups) to supervise the examination process, collect the answer booklets on behalf of the students, remark the scripts, and submit the students’ scores to the teacher (Ethereum).
There are two types of rollups, each with its own way of processing transactions off-chain. They are Optimistic and Zero-knowledge rollups.
This is an approach to scaling Ethereum that involves moving computation and state storage off-chain. It uses compression techniques to reduce the amount of data submitted to the Ethereum mainnet. They are considered “optimistic” because they assume off-chain transactions are valid and don't publish proofs of validity for transaction batches posted on-chain. Instead, it uses Fraud proving scheme to detect incorrect transaction calculations.
Optimistic Rollups comprise two parts:
ZK rollups work similarly to optimistic rollups. The only difference is that ZK rollups prove each batch of transactions correct by having a validity proof (zero-knowledge (ZK) proof) submitted on-chain for every batch of transactions.
Zero-knowledge proof is a cryptographic protocol that allows one party to convince another that a statement is true without revealing any additional information.
The ZK-rollup's state is also controlled by a smart contract deployed on the Ethereum network. To update this state, ZK-rollup nodes must submit a validity proof for verification. The validity proof is a cryptographic assurance that the state change proposed by the rollup is the result of executing the given batch of transactions.
calldata
does not affect Ethereum's state, making it a cheap way to store data on-chain.Rollups enhance Ethereum scalability while still maintaining trustlessness by :
Prominent L2 rollup Projects include Optimism, Arbitrum, zkSync, Starknet, Canvas Connect etc.
Zero Knowledge Ethereum Virtual machine(zkEVM) is now the new kid in the Block. It represents the next evolution in Ethereum’s Layer 2 scaling solution. It is a virtual machine that executes smart contract transactions in a way that’s compatible with both zero-knowledge-proof computations and existing Ethereum infrastructure. This enables them to be part of zero-knowledge rollups, layer-2 scaling solutions that increase transaction throughput while lowering costs.
Initially, zk-rollups did not have the capability for smart contract execution, thereby focusing specifically on general token payments and exchanges., In this case, zkEVMs empowers zk-rollups to offer support for dApp development on Ethereum and also allows smart contracts to execute off-chain with cryptographic guarantees of correctness.
From the name, zkEVM comprises two main components, namely: Ethereum Virtual Machine(EVM) and Zero Knowledge Proof(ZKP).
Secure Scalability: zkEVM doesn’t have to adhere to Ethereum’s consensus protocol, but zkEVM still strictly verifies all layer 2 transactions on it. This means that despite optimizing speed, there is no security compromise.
Low cost: Some L2 rollups still struggle with high gas fees because they post all transaction data on-chain. In contrast, zkEVMs only need to publish final state changes on-chain, as the zero-knowledge proofs ensure the validity of all transactions in the batch. This reduced cost benefits applications and end users of the zkEVM.
Fast Finality: In the case of zkEVMs, the transactions posted on Ethereum are finalized immediately with verifiable proof of validity. As a result, the Ethereum mainnet could ensure faster implementation of state updates.
Examples of zkEVM include Polygon zkEVM, zkSync Era, Nethermind’s Warp, Scroll etc.
From my observation, the evolution of Layer 2 solutions from State Channels and Plasma chains to Rollups and zkEVM shows that the Ethereum network is here to stay. As the network continues to grow, more scaling solutions with low fees will emerge, making it more efficient for dApps to thrive in the ecosystem.