Bitget App
Trade smarter
MarketsTradeCopyBotsEarnWeb3Spot OTC

The Pros and Cons of Hitch-Hiking on the Ethereum Layer-2 Highway for An Optimal Scaling Solution

iconShare
2023-11-27
The Pros and Cons of Hitch-Hiking on the Ethereum Layer-2 Highway for An Optimal Scaling Solution

In the blockchain-DeFi ecosystem, the Ethereum network continues its march on improving its trilemma of decentralization, scalability, and security. Of the three components of this trilemma, scalability stands out as the area where competing scaling solutions vie for m arket adoption. Scaling solutions, conveniently known as Layer-2 (L2) solutions, play a sizable role in driving value to the Ethereum blockchain network. Hence, there is a dynamic debate in the market today on L2 rollups.
The Ethereum blockchain's Ethereum Virtual Machine (EVM) is a crucial protocol feature of the network where smart contracts are executed. It is, therefore, a pillar of the blockchain ecosystem.
The primary function of rollup scaling solutions is to scale the network at the base layer. L2 solutions offer better and cheaper service for dapps by buying block space and bundling transactions at much greater speeds and quantities on the L2 of the Ethereum technology stack. Once transactions are complete, they hand them off to the base layer, or Layer-1 (L1). It is worth noting that many dapps were built on L1, where a significant amount of computational power is consumed, leading to further network saturation.

L2 Tech schools of thought

The competition for L2 dominance has just begun, which has clearly led to the formation of two schools of thought about approaches to overcoming Ethereum’s trilemma, with transaction finality at the core of their rivalry. The two are Optimistic Rollups and Zero Knowledge (ZK) Rollups.

Proof of transaction finality: Optimistic vs. ZK-rollup

Optimistic rollups derive their security from the mainnet and do not publish proofs of validity. On the other hand, zero-knowledge rollups publish proofs of validity and cryptographic assurance. So, how does that work in each tech approach?
Optimistic rollups rely on fraud proofs. Fraud proof is essentially when a person accuses another of lying. They go to court to prove their innocence with counterproofs or be sentenced. In practice, this requires a "challenge period," where anyone can submit counterproofs. Back to rollups: if the original data is proven fraudulent, the network takes corrective action. This could involve reversing a transaction, penalizing malicious actors, or other measures to ensure data integrity.
The advantage is obvious: since not every participant needs to validate every transaction, it is very computationally efficient and can scale. The downside is that withdrawing funds from an optimistic rollup can take multiple days; alternatively, the user can tap into a secondary market for instantaneous withdrawals using alternative bridges for a fee. The main issue these days is that not a single optimistic rollup that is currently live has permissionless fraud proofs in production, where anyone can challenge the state.
ZK rollups, on the other hand, are more computationally expensive but do not require fraud proofs as everything is proven mathematically. Within ZK rollups, you can have a normal rollup architecture or a validium, where data is stored off-chain. With ZK rollups, you can withdraw funds immediately, while it takes nearly a week with Optimistic rollups. For that reason, ZK rollups are computationally more expensive than their Optimistic counterparts.

A brief look at Optimism’s recent update

Optimism’s recent update does not change much regarding its current status because it is not production-ready yet as it is still being tested on the testnet. It is a full-fledged fraud-proof system and, true to their word, very modular to allow for other chains leveraging the Optimism stack to switch out modules at will, thereby customizing the proof system. The modular change speaks to the heart of decentralization enthusiasts as it introduces the concept of proof diversity—there won’t be a single way to prove correctness but rather multiple ways, including ZK proofs! This makes the network vastly more resilient.
Depending on your security needs, you select from the various options available to you. A financial application that needs the highest security assurance should choose a rollup.
If your security needs are not as critical as, say, a social media application, then perhaps you should opt for a validium. Validium is a scaling solution that enforces the integrity of transactions using validity proofs like ZK-rollups. However, validiums don't store transaction data onchain. This method of scaling significantly increases scalability and TPS, especially given that it can be hosted on top of an L2, as an L3 solution. Any other solutions than these are a return to the status quo of centrally owned backends, whether or not they are distributed.
For instance, Sandclock and Opus are financial protocols. Sandclock offers a versatile wealth management platform with the option for users to stream their yield, while Opus is a cross-margin credit protocol that automates monetary policy and risk management using control theory. Both protocols represent a cutting-edge in financial technology, designed to safeguard millions of dollars. This ambitious scale necessitates stringent security guarantees, and, as such, StarkNet was chosen for all future deployments. To further this commitment to security, Lindy Labs has developed Aegis, a Cairo formal verification framework. They have not only used this tool to strengthen the security of protocols, but also to enhance the security of other projects in the StarkNet decentralized finance ecosystem.

On zkSync and its pros and cons

zkSync, formerly known as zkSync Lite, is a scaling rollup solution with very limited use cases, like transferring balances between accounts. However, zkSync Era by Matter Labs is a special type of zk-rollup that enables every smart contract to be easily deployed and executed on an Ethereum Virtual Machine (“EVM”) compatible platform. As a result, deploying contracts requires minor modifications. Failure to understand the differences between mainnet Ethereum and zkSync can result in stuck funds. Recently, a DEX on zkSync lost nearly $1.7 million worth of ETH because the transfer function was used incorrectly. Clearly, this is due to security malpractices, and, unfortunately, there is no lack of such incidents in the L2 ecosystem, especially when get-rich-quick developers simply port existing projects to EVM-compatible platforms.

On code correctness

Currently, when compiling Solidity or Vyper code on zkSync, it is first converted to Yul, an intermediate representation; then, an LLVM backend compiles it to zkEVM bytecode. To our knowledge, zkSync has never been formally verified. Formal verification is important to confirm adherence to the EVM specifications. This would guarantee that it behaves similarly to the EVM in all scenarios outlined in the specification. Unfortunately, the assurances provided could be better.

A brief look at StarkNet

StarkNet is also a ZK-rollup, developed by StarkWare Industries, an Israeli company. StarkNet was launched in 2022 as a fully permissionless and decentralized L2 network that allows developers to develop dapps using Cairo, its own native programming language.

Pros of StarkNet

STARKs are quantum-resistant, and can handle larger proof sizes, and, therefore, are more scalable. They also don’t require a trusted setup, thereby mitigating the introduction of central points of trust. The Cairo language is gaining popularity among developers as it is rust-like and becoming stable. StarkNet decided not to aim for EVM compatibility, which proved a smart move. Today, a whole range of rust developers can quickly pick up Cairo. There are also projects looking to recreate the EVM as L3 on top of StarkNet.
The developer community seems enthused about the ecosystem as we see more attempts at innovation than on other chains—likely an outcome of not being able to port-and-deploy existing EVM projects with a single click.

Neither flawless nor yet trustless

Beyond these pros and cons, choosing between the various ZK rollups is ultimately a matter of betting on your favorite team and community. Not even Aztec, a highly ambitious and preproduction ZK-rollup that allows private and public states, can escape from this because, despite their incredible offerings, privacy will come to all in due time. ZK rollups are simply starting from different ends: StarkNet is prioritizing scalability, zkSync EVM compatibility, and Aztec on-demand privacy. Based on the needs of the developers, these rollups will morph and borrow new features from each other until they become indistinguishable from one another to the average user.
Ultimately, the technology is still maturing for optimistic and zero-knowledge rollups alike. They are neither flawless nor yet trustless, but the promise is there. We just need to trust the teams and the communities we support.

Impact of L2 Scaling Solutions on DeFi Products

L2 scaling solutions are making their impact felt in the DeFi market. Their growth and adoption are further solidifying Ethereum as the de facto settlement layer for Web3. This is most starkly evident in the staking ecosystem. Optimism and Arbitrum, the two largest L2 blockchains, have surpassed heavyweight L1s like Solana in Total Value Locked (TVL).
The DeFi market is experiencing record high staking rates, with transaction activity shifting from the Ethereum L1 mainnet to the above Ethereum L2 scaling solutions, resulting in a staking yield of 4.5% in Q3 2023, ETH's lowest yield on record ( Staked: The State of Staking, Q4 2023).
As a testament to the high growth in transaction activities migrating from Ethereum L1 to L2s, the Ethereum staking rates reached 22% in Q3, whereas the average staking rate for the top 35 proof of stake (PoS) protocols reached an all-time high of 52.4% in the same quarter.
With higher throughputs (TPS) and cheaper transaction costs, we can expect more sophisticated strategies for institutional investors to offer DeFi products.

Conclusion

Hitch-hiking on the Ethereum highway for optimal scaling solutions is bound to continue with different options for your ride. A rollup that’s optimistic today could become a validium or a zk-rollup tomorrow. Optimism’s move makes a lot of sense because of its Superchain Vision, as this modular architecture allows it to cater to almost anyone once they have ZK proofs. StarkNet, on the other hand, would rather be purely a ZK rollup and have the modularity of L3 chains on top of it. These are architectural choices, and only time will tell who was right and who executed their go-to-market strategy more effectively. Ultimately, the aforementioned rollups seem to have incredible technical teams and awesome philosophies, so they are all worth keeping an eye on.
Guest post by Reza Akhlaghi and the research team at Lindy Labs
Disclaimer: The views, information, or opinions expressed in the report are intended for informational and educational purposes only. It is not intended or offered to be used as legal, tax, investment, financial, or other advice. Under no circumstances are Bitget, our employees, agents, partners, and/or co-operations responsible for any decision made, action taken, or result obtained from or in reliance on the use of the information herein. Any investment or trading ideas, strategies, or actions should never be taken without first taking into consideration each individual's personal and financial situation and/or without consulting financial professionals.