Current State and Scaling Problem of Ethereum
In the world of blockchain, there's a challenge known as the "Blockchain Impossible Triangle." Among various Layer 1 projects, none can simultaneously achieve decentralization, security, and scalability.
Decentralization: This relates to how spread out and numerous the nodes are in the network. More nodes mean greater decentralization.
Security: It concerns the network's resistance to hacking. Higher hacking costs mean increased security.
Scalability: This is about transaction speed and cost. Faster and cheaper transactions mean improved scalability.
In the blockchain space, decentralization and security take precedence, as they are the core tenets of blockchain tech. Ethereum, for example, is built on decentralization, offering neutrality, resistance to censorship, openness, data ownership, and strong security.
Ethereum faces severe congestion due to its growing popularity. For instance, the popularity of CryptoKitties in 2017 caused Gas Fees to skyrocket to hundreds of dollars. As more users join the ecosystem, Ethereum's primary network struggles to handle the increased demand. This results in ultra-high gas fees and painfully slow transaction speeds, akin to traffic jams, as numerous transactions compete for processing. Miners prioritize higher gas fees, exacerbating the problem. To send a $10 transaction, users must pay hundreds or even thousands of dollars in gas fees, highlighting the urgent need for improving the Ethereum scalability problem.
L2 is an off-chain scalability solution designed to address Ethereum's congestion issues by offloading some transaction processing from the Ethereum base layer to an independent Layer2 blockchain.
Ethereum Scaling Solutions
Scalability solutions in Ethereum fall into two categories: Layer 1 and Layer 2. To illustrate this, think of a congested road:
Layer 2 solutions are akin to constructing viaducts and subways alongside it, enhancing the existing infrastructure without altering the road itself.
Layer 1 solution involves a fundamental transformation of the congested road itself, representing a structural change aimed at tackling Ethereum's expansion challenges.
We will focus on L2 solutions in this article.
L2 Solutions
There are several types of Layer 2 solutions, including side chains, state channels, plasma chains, and rollups (optimistic rollups and ZK rollups). Among the range of scaling solutions on the market, rollups are the most promising one. Let’s go through them.
Side Chain
The side chain operates independently, falling between Layer 1 and Layer 2 solutions. It differs from Layer 2 by relying on its own security protocol, not Ethereum's security. Unlike Layer 1 chains, it assists Ethereum in processing excess capacity. To bridge assets, it employs two-way anchoring. Tokens aren't physically moved but mirrored on the side chain. Security is maintained through centralized or decentralized means, with SPV providing a decentralized option. Cross-chain transactions involve lock periods and competition periods, ensuring security.
Advantages:
Sidechains boost transaction speed, processing most transactions swiftly.
Transaction fees are drastically reduced, often costing only a fraction of a dollar.
They offer strong compatibility and smart contract support.
Limitations:
Sidechains have lower decentralization compared to the main chain.
They rely on their own security mechanisms.
State Channel
A state channel is an off-chain solution that maintains network security and immutability. Transactions within the channel are not immediately confirmed on the blockchain, saving on gas fees. It enables high-frequency, low-cost transactions between parties. Disputes can be resolved by submitting the final state to the blockchain after a waiting period.
How it works?
Opening the Channel: To initiate a state channel, the participants (let's call them A and B) create a channel by opening it on the blockchain. This opening transaction is recorded on the blockchain and typically incurs a small fee. It establishes the initial state and locks a certain amount of cryptocurrency from each participant into a smart contract.
Off-Chain Transactions: Once the channel is open, A and B can conduct multiple transactions off-chain. These transactions can be of any kind, such as sending cryptocurrency or interacting with smart contracts. Importantly, these transactions are not immediately recorded on the blockchain. Instead, A and B sign these transactions and keep a record of them.
Closing the Channel: When A and B are ready to settle their final balances or conclude their interactions, they close the channel. The closing of the channel involves submitting a closing transaction to the blockchain. This transaction reflects the latest agreed-upon state of the channel.
Blockchain Settlement: The closing transaction on the blockchain is where the smart contract enforces the final state of the channel. It verifies that the transactions conducted off-chain match the agreed-upon state. If everything checks out, the smart contract updates the participants' balances according to the final state.
Dispute Resolution: In case of a dispute or if one party behaves dishonestly, the state channel has a predetermined dispute resolution mechanism. Participants can submit their signed transaction history as evidence to the blockchain. The blockchain then validates the evidence to determine the rightful state and distribute the assets accordingly.
Withdrawal: After the channel is closed and the final state is established, participants can withdraw their funds from the channel to their personal wallets. This process can sometimes have a predefined delay for security reasons, during which any disputes can be resolved.
Advantages:
Scalability: State channels significantly increase the transaction throughput by keeping most transactions off-chain, making it suitable for applications with high transaction volumes.
Off-chain transactions do not require the same level of fees as on-chain transactions, resulting in substantial cost savings.
Privacy: Because most interactions happen off-chain, they are not visible to the public, offering enhanced privacy.
Finality: State channels provide immediate finality once both parties agree on a state, eliminating the need for confirmations.
Limitations:
Liquidity Requirements: Participants must lock funds in smart contracts, reducing liquidity, and making state channels less accessible for those with limited resources.
Complexity: Managing state channels can be complex, particularly in cases of dispute resolution.
State channels are most suitable for situations involving repeated interactions between a fixed set of participants over time. They may not be well-suited for one-time transactions or scenarios where participants frequently change.
Plasma
Plasma emerged to overcome the limitations of state channels in handling large and complex transactions while maintaining transaction speed and reliability. It extends the Ethereum main chain by creating multiple child chains, each with its own consensus, nodes, and rules, anchored to the main chain. Plasma balances security from the main chain with off-chain efficiency.
How it works?
Off-Chain Computing: Similar to state channels, Plasma relies on off-chain processing for speed and cost efficiency. Transactions are verified by a single "operator," enhancing transaction speed.
State Commitment: Unlike side chains, Plasma settles on the Ethereum main network to leverage its security. Regular "state commitments" in the form of Merkle roots are published by operators on the Ethereum chain, ensuring the integrity of the Plasma chain.
Entering and Exiting: Transferring assets into the Plasma chain is akin to side chains, with tokens locked on the main network and corresponding tokens issued on the Plasma chain by operators. Exiting the Plasma chain involves a "challenge period," where anyone can challenge withdrawal requests with a fraud proof. Honest behavior is incentivized through security deposits.
Advantages:
High throughput with low transaction costs.
Cost-effective for transactions between any users.
Customizable for specific use cases, reducing Ethereum mainnet load.
Moves computation and storage off-chain, improving scalability.
Limitations:
Limited to basic token transfers; smart contracts are not supported.
Requires continuous network monitoring or delegation for fund safety.
Relies on operators for data storage and availability.
Withdrawals have a delay for challenge periods.
High exit congestion on the Ethereum mainnet during peak usage.
Rollup
Rollup is the leading Layer 2 solution, often described as an improved version of Plasma. Like Plasma, rollup processes transactions outside Ethereum's main layer, bundles multiple transactions, and then uploads them to the Ethereum layer. However, Rollup has a distinct advantage—it submits transaction data to the main chain, enhancing security. Furthermore, Optimistic Rollup within the Rollup framework is gaining traction, achieving compatibility with Ethereum Virtual Machine (EVM). Several ZK Rollup projects, such as StarkWare and zkSync, are also working on implementing zkEVM, making it a highly secure and promising decentralized scaling solution.
How it Works:
State Root: Rollup maintains a state record through a series of contracts on the main chain, referred to as the State Root. This root is essentially a hash value stored at the top of a Merkle tree. Changes in any leaf of this tree lead to changes in the State Root. Comparing State Roots allows for confirming the consistency of underlying state information.
Batching: Rollup employs batching to optimize efficiency. Instead of updating the State Root on the main chain after each transaction status change, multiple transactions are packaged and summarized in batches. This significantly reduces gas fees compared to direct updates.
Compression: Rollup's ability to upload extensive transaction data hinges on compression. Smaller compressed transactions enable the batching of more transactions with each state root update and distribute gas fees evenly among them.
Data Availability: Rollup sets itself apart by also submitting transaction data to the Ethereum main chain, ensuring data availability. There are two types of solutions within Rollup: Optimistic Rollup and ZK Rollup.
Optimistic Rollup
Optimistic Rollup assumes all transactions are valid and real, submitting compressed data to the main chain. During a challenge period, anyone can challenge and prove data authenticity. If someone demonstrates that data in a compressed transaction is incorrect, Optimistic Rollup executes a fraud-proof and corrects the transaction using data available on the main chain. Currently, the fraud proof comes in two forms:
Non-interactive Fraud Proof: This verification method involves challenging a transaction on Layer 1 and re-executing it to detect errors. Challengers must pledge a deposit. The correct transaction is determined using Layer 1's high security, and the fraudulent party faces penalties, including deposit confiscation.
Multi-Round Interactive Type: In this approach, disputed transactions are placed on Layer 1 for re-execution, but the scope of the dispute is progressively narrowed down through multiple rounds of interaction. This reduces costs but extends the dispute resolution timeline.
ZK Rollup
Zero-knowledge proof allows one party (the prover) to convince another (the verifier) that they possess certain knowledge without revealing the actual information.
ZK Rollup incorporates zero-knowledge proof. Submitters include an extra "validity proof" with their Batch submission. This proof allows anyone on the main network to swiftly verify the accuracy of transactions in a specific ZK Rollup Batch. Unlike Optimistic Rollup, which may take a week or more for challenges, ZK Rollup speeds up transaction validation, enhancing user experience and sidestepping the need for at least one honest node.
Optimistic Rollup vs. ZK Rollup:
Speed: ZK Rollup significantly outpaces Optimistic Rollup. ZK Rollup wraps up transactions between Layer1 and Layer2 within minutes, offering a smoother user experience. Optimistic Rollup, on the other hand, requires lengthy challenge periods for Layer2 to Layer1 transitions.
Compatibility: Optimistic Rollup is EVM smart contract compatible, simplifying smart contract migration to Layer 2, making it more accessible and cost-effective. ZK Rollup, while currently not EVM-compatible, is working on EVM-equivalent solutions through projects like zkSync and Scroll.
Security: ZK Rollup boasts Layer1-level security, while Optimistic Rollup relies on at least one honest node to submit fraud proofs, rendering it slightly less secure.
Cost: ZK Rollup involves substantial computation for generating zero-knowledge proofs, resulting in higher transaction costs compared to Optimistic Rollup.
Advantages:
Enhanced Security: Rollup keeps transaction data on Layer 1, bolstering security, transparency, censorship resistance, and decentralization while achieving scalability.
Guaranteed State Validity
Guaranteed Data Availability
Limitations:
Slow Withdrawal Speed for Optimistic Rollup
ZK Rollup Complexity and Lack of EVM Compatibility
Validium
Validium is an evolution of ZK Rollup, prioritizing scalability over some aspects of security. It's more like a shift in focus than a pure improvement.
Unlike ZK Rollup, Validium doesn't require block producers to publish full transaction data; they only need to publish block headers. This distinction makes Validium an off-chain expansion protocol, unlike ZK Rollup, which is a Layer 2 protocol publishing data on the Ethereum main chain.
Users' funds in Validium are controlled by Ethereum smart contracts. Similar to ZK Rollup, Validium offers nearly instant withdrawals. After verifying withdrawal validity on the main network, users can withdraw funds by providing Merkle proof, ensuring their withdrawal transactions are part of a verified batch.
However, unlike ZK Rollup, Validium keeps data availability off-chain. While this boosts Validium's throughput, it also means Validium operators can freeze user funds and restrict withdrawals. If the operator doesn't provide users with off-chain state data, users can't access transaction data or calculate the Merkle proofs needed for withdrawals.
The key difference between Validium and ZK Rollup lies in data availability handling. Validium is more suited for fast transaction confirmation and user privacy protection, while ZK Rollup excels in high-security and scalability scenarios.
Validium stands out for its lower gas fees and faster transaction speeds, making it suitable for specific applications:
Decentralized Exchanges (DEX): Validium's off-chain data solution is ideal for DEX, preserving trader transaction privacy and reducing transaction costs, benefiting frequent professional traders.
Blockchain Games: Immutable solutions are a better fit for blockchain games, ensuring efficient transactions within gaming environments.
Advantages:
Speed and Lower Gas Fees: Validium offers quicker transactions and reduced gas fees.
Scalability: Validium exhibits exponential scalability growth, accommodating higher liquidity. It excels in specific use cases like DEX and blockchain gaming projects.
Limitations:
Security: Unlike ZK-Rollups, which rely solely on cryptographic security, Validium's security hinges on trust assumptions and economic incentives, making it less secure.
Data Availability Concerns: Validium's off-chain data management introduces risks, including the ability of operators to freeze funds and restrict withdrawals, posing a certain degree of centralization risk.
Overall, Rollup combines the strengths of other solutions while addressing some of their shortcomings. It offers improved security and scalability, making it the forefront choice for Ethereum's Layer 2 expansion.
