paint-brush
Which Layer 2 Solutions Are Helping Ethereum Scale?by@rpchamria
458 reads
458 reads

Which Layer 2 Solutions Are Helping Ethereum Scale?

by Ravi ChamriaOctober 26th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Blockchains are struggling to keep up with demand and transaction times. Gartner Research predicts that the business value generated by blockchain will grow rapidly, reaching $176 billion by 2025 by 2025 and $3.1 trillion by 2030. As the complexity of the technology increases, so does the need for competent developers who understand how to build and deploy applications on top of blockchain networks. In this blog post, I'll explore some of the most common layer 2 scaling protocols for Ethereum and explain how they are valuable for enterprise applications.

People Mentioned

Mention Thumbnail
Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coins Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Which Layer 2 Solutions Are Helping Ethereum Scale?
Ravi Chamria HackerNoon profile picture

Blockchain technology is quickly evolving, and enterprises are starting to take notice. Many businesses are investigating how they can use blockchain to improve their operations.

Gartner Research predicts that the business value generated by blockchain will grow rapidly, reaching $176 billion by 2025 by 2025 and $3.1 trillion by 2030.


However, as the complexity of the technology increases, so does the need for competent developers who understand how to build and deploy applications on top of blockchain networks.

In this blog post, I'll explore some of the most common layer 2 scaling protocols for Ethereum and explain how they are valuable for enterprise applications.


But before I dive into that details, let’s take a look at exactly what ‘Scalability’ is, why it matters, and how Layer2s come into the picture.


I'll also provide some tips for how to get started with layer 2 deployment. So if you're interested in learning more about Ethereum scaling solutions, keep reading!

We must find a workaround to solve the Scalability Trilemma for Blockchain

First coined by Vitalik Buterin, blockchain trilemma refers to the difficulty that blockchains face in acquiring security, scalability, and decentralization at the same time. As we continue to evolve, one of the key challenges that blockchain developers are struggling to solve is the ability of a blockchain network to handle an increasing volume of transactions without compromising security or performance.


With the growing popularity of cryptos and decentralized applications, it is clear that blockchain networks are currently struggling to keep up with demand. As a result, transaction fees have skyrocketed, and transaction times have slowed to a crawl. The chart below shows the transaction fees on Ethereum continued to spike even when the price went down.


(Source: Binance Research Report 2022)


The good news is, instead of such a high transaction cost and low processing speed, we have seen 4.5X more transactions happening on Ethereum than on VISA in 2021. But there is no point in denying that these issues need to be addressed if blockchain has to reach its full potential.

There are a number of reasons why scalability is so important:


  1. High transaction fees and slow transaction times make it difficult for ordinary people to use crypto and decentralized applications. This limits blockchain's potential audience and makes it more difficult for new projects to get off the ground.

  2. Blockchain projects that are unable to scale quickly enough will likely be outcompeted by those that can. This could lead to consolidation in the blockchain industry, which in turn can be bad news for innovation.

  3. Finally, scalability issues could ultimately limit the ability of decentralized systems to challenge traditional ones. For example, the Bitcoin blockchain can only handle around seven transactions per second. Ethereum, at the moment, can only process 15 transactions every second. In comparison, Visa can handle about 24,000 transactions per second.


This has a direct impact on blockchain adoption, as businesses and individuals are less likely to use a blockchain if it cannot meet their needs in terms of speed and capacity. Now, you could argue that the Ethereum merge could fix this, but there are several risk factors associated with this. It’s more like changing your car’s engine from gas to electric but keeping the speed the same. Jack Niewold has described this beautifully in his recent thread.


However, there are some promising solutions in the works which could help blockchain scale up to meet global demand. But…


A one-size-fits-all blockchain scalability solution doesn’t exist:

When it comes to blockchain scalability, there is no one-size-fits-all solution. There are multiple ways to scale a blockchain. For example:

Improving the Consensus Mechanism:

The consensus algorithm is one of the key components of a blockchain that determines its scalability.


For instance, Bitcoin and Ethereum use Proof-of-Work (PoW) consensus algorithm, which is energy intensive and slow. This has led to the development of several projects that aim to improve blockchain scalability by upgrading the consensus mechanism.


Take the example of Solana. They use an innovative Proof-of-History (PoH) consensus algorithm, which is much faster and makes it process 50000 transactions per second. But the problem of consistently going down raises questions about its decentralization.


That’s not the case only with Solana. Centralization remains the common tradeoff between layer1 blockchains that tried to become more scalable. Thus, while upgrading the consensus algorithm can improve blockchain scalability, it can also affect privacy and decentralization.

One potential solution could be Sharding:

Here the blockchain is divided into multiple shards or smaller pieces. There are a few different ways to implement sharding, but one common approach is to use “sharded chains.”


In this setup, each blockchain node only stores a copy of the shards that it is responsible for. This helps to reduce the amount of data that needs to be exchanged between nodes and also allows nodes to process transactions in parallel. Ethereum 2.0, the successor to the current Ethereum blockchain, is taking this route. Two other prominent examples of sharded chains are Polkadot Parachains and Zilliqa.


However, sharding does have some limitations, such as the need for additional communication between shards and the possibility of inconsistencies if shards fail to reach a consensus.


Another option for scaling blockchain is to use Layer2 chains:

These are separate blockchain protocols that interact with the main blockchain but are designed to handle a much higher volume of transactions. By moving some of the computationally intensive processes off-chain, Layer2 solutions can greatly increase the number of transactions a blockchain can process.


Hence, the primary benefit of using a Layer2 solution is that you get hundreds if not thousands of transactions per second by simply delegating computational tasks to a second layer while keeping verifiable proofs on the main chain. As a result, Layer2 solutions have the potential to provide near-instant transaction speeds without sacrificing security or decentralization.


There are a number of different Layer2 solutions that are being developed, each with its own strengths and weaknesses. For the rest part of the blog, we will focus on multiple Layer2 technologies that are now in use and protocols that are being developed on them.


Breaking down popular types of L2 scaling solutions:

The TVL of the entire Ethereum ecosystem is around $39.29B, whereas the total value locked combining all Layer2 technologies is currently around $6.04B, which is roughly 15%. And it has been on a continuous rise. The below chart shows how the Layer2 landscape has evolved over the last few years:


(Source: L2 Beat)


Here are all the Layer2 technologies that made up this $6.04B value:

Rollups:

Rollups are a type of Layer2 solution that has become very popular in recent years. In fact, data suggests that they currently hold over 95% of the Ethereum Layer2 market share.


Rollups work by batching many small transactions into a single compressed transaction, which is then submitted to the roll-up smart contract on the Layer1 chain. When this is done, the State for all the transactions is updated. This can be thought of as similar to how zip files work, where multiple files are combined into a single file in order to save space.


They have three main features that make them valuable:

  1. Computations are done off-chain, increasing speed

  2. Proof of transactions and data stays on Layer1 maintaining security

  3. Rollup smart contract on Ethereum ensures transactions are done correctly on L2 using the data on L1


This allows for increased throughput while still retaining all of the security and decentralization of the Layer1 blockchain. The below graphics explain how unnecessary data is ignored and, with the help of Merkle roots roll-up system working:

Source

The two major types of Rollups, Optimistic and Zero-Knowledge (ZK) do this differently. While optimistic rollups use fraud proofs, Zk rollups do this with validity proofs.

Optimistic Roll-up:

This is the most used rollup at the moment comprising over 80% of total Rollup transactions. The reason being they are easy to deploy. As the name suggests, they assume all transactions are correct when submitted, and a window of 7 days is given for raising disputes. If no fraud proofs are published within that time, assets are released. In case of a successful dispute, the last correct state is restored.


Because of economic incentives and also disincentives for the bad actors, fraudulent activities are rare. Hence, the transactions are processed very fast. However, to withdraw it back to L1, one must wait until the fraud-proof publishing window ends.

ZK- Roll-up:

They are more computationally intensive and hard to execute on a technical level. But it is more privacy-focused. It can prove the validity of a transaction without revealing its content.


For example, assume you want to enter a bar, and they ask for your ID to prove you are over18. Now, you can use the ZK rollup to prove this. How? Well, it can use the Verifiable Certificates issued by the Election Conducting Authority to prove, as you have voted in the last Presidential election of the United States, you must be above 18 years. Without revealing your name, where you live, and other additional details that your original card might have, you just entered the bar.

Along with the transaction batch, validity proof for the same (a ZK-Snark) is also submitted to L1. Now, as transactions are already verified, assets can be withdrawn almost instantly.


As per Vitalik, Though Zk-rollups constitute a very small part of total roll-up transactions today, the future for Zero Knowledge technology is promising. Here’s what he wrote in his blog post:


“…my own view is that in the short term, optimistic rollups are likely to win out for general-purpose EVM computation and ZK rollups are likely to win out for simple payments, exchange, and other application-specific use cases, but in the medium, to long term ZK rollups will win out in all use cases as ZK-SNARK technology improves.”


Plasma:

Plasma chains work by using child chains that are anchored to the main chain. Transactions are then offloaded to these child chains when the mainnet suffers congestion. These child chains can produce their own independent blockchains, giving them a tree-like structure.  Each of these chains can serve specific contexts and business needs.



Source


The child chain and main chain can have different consensus mechanisms. Like, an optimistic rollup, it also has a fraud-proof mechanism to validate the plasma chain. Each child chain can have its own consensus mechanism for validating blocks.


As it can’t run smart contracts, only basic operations like token transfer and swapping are possible. Also, Plasma chains publish minimal information about the state of child chains. The data availability is off-chain. Hence, they are less secure because the mainnet can not effectively verify transactions conducted on child chains.

Validium:

Both ZK-Roll-up & Validium are L2 protocols that post validity proofs to the mainchain, to be verified by an on-chain verifier contract.


While zk-rollups use on-chain data availability on L1 to store data, Validium stores data off-chain due to scalability limitations on the L1 chain.


Here, block producers don't publish the transaction data on-chain but provide a cryptographic commitment to prove the availability of the data.


Both Validium and Plasma take this approach to separate data availability from consensus and execution. While both Optimistic and ZK- Rollups use Ethereum L1 for storing the final data. The below chart makes this distinction clear.



Sidechain:

A sidechain is simply a separate blockchain that is attached to the main blockchain via a two-way peg. This peg allows for assets to be transferred back and forth between the two chains. And when the asset is withdrawn, it is released on the Ethereum Main chain.


One major advantage of sidechains is that they offer greatly increased scalability. Because transactions are no longer confined to the main chain, they can be processed much more quickly once moved to the side chain using a bridge. This could potentially allow for thousands or even millions of transactions per second.


One thing to note here is that once an asset is on the side chain, they no longer depend on the consensus of the main chain. With benefits, this also has some risks: The risk of centralization. Who are the validators? How they are chosen? How does the consensus work? Is the bridge even secured? Etc.


Polygon PoS is one of the most successful examples of Ethereum Side Chains.


Multiple L2 Protocols Emerging to Increase TPS and Lower Fees:

Layer2 protocols are starting to emerge as a solution to both high transaction fees and slow transaction times. By using Layer2 protocols, users can take advantage of the speed and security of the underlying Layer1 protocol while also benefiting from increased throughput and reduced fees.



Here are some of the most promising Layer2 protocols based on their market dominance, user adoption as well as potential future applications.

Arbitrum:

Arbitrum is a Layer2 scaling solution for Ethereum that uses optimistic rollups to process transactions off-chain. It is currently the leading L2 scaling solution with $2.62B in TVL and controls the L2 market share of 43.45%.


According to Layer 2 data aggregator L2 Fees, arbitrum allows for 40,000 transactions per second, with gas fees ranging between $0.11- $0.18 for sending ETH and Swapping tokens.

One big advantage of Arbitrum is its own Arbitrum Virtual Machine. Though this is similar to EVM, it works independently from it and allows fraud proofs to be executed.


dApps originally written for EVM can automatically be translated to AVM. All ERC-20 tokens can also be directly used on Arbitrum.


One more good about Arbitrum is that it only sends the suspicious part of the transactions back to EVM and not the entire one. It uses multi-round fraud proofs and executes small parts of the transactions until the fraud is detected. This makes Arbitrum faster.


And, it’s no wonder because of these features, it is adopted by top protocols such as Uniswap, Sushiswap, Aave, curve, Balancer, and many more.


Also, it is currently the only L2 with the most centralized exchanges supporting direct withdrawal.

  • Crypto.com

  • Binance

  • Huobi

  • MXC

  • FTX

  • OKX


All of them support Arbitrum. One disadvantage is, that it takes around 2 weeks to withdraw funds using Arbitrum.


The below analytics from Coin98 shows the giant Arbitrum ecosystem:



(Source: Coin98 Analytics)

Optimism:

It’s the second most used Layer2 protocol, again built on Optimistic roll-up technology. Currently, it has around $1,84B in TVL with 32.56% L2 market dominance.

Optimism can process 2000 transactions/second. According to L2 Fees data, It takes around $0.18 to send ETH and $0.26 for swapping tokens.


The key advantage of Optimism over other Layer2 solutions is that it offers near-instant transaction finality.


To deal with suspicious transactions, Optimism sends the entire transaction through EVM. Hence, it’s instant but at the same time, costs more gas compared to Arbitrum.

In the future, Optimism will use interactive fraud proofs to ensure a state of correctness. But this feature is currently under development.


Optimism’s ‘Citizens House’ is another plus in their governance structure. With the launch of ‘Soul-Bound’ non-transferable citizenship NFTs and making ‘$OP’ a gas token but not a governance token, Optimism aims to keep a balance between Token Holder (Token House) and Non-token holders’ (Citizen House) interest.


Even Vitalik advocates for the governance structure of optimism:

Read Entire Conversation


Major exchanges like:

  • Binance

  • Crypto.com

  • Huobi


Also supports Optimistic rollups for deposit and withdrawal purposes.

It also has a widespread deployment of dApps in all major categories, including DEXes, lending, bridges, yield protocols, NFT space, and many others. There are over 150+ dApps and integrations running on the Optimism network. Get the entire list here.

Zk-sync:

zkSync uses the ZK Rollup construction, which preserves the security of data availability that is essential for Layer1 blockchains while allowing Layer2 scalability. Presently it has a total asset-locked value of $66.1M and constitutes 1.17% of the L2 market.


zkSync can process over 10,000 transactions per second and has low fees ($0.05-$0.12) even when congested. With their zkPorter update, it will be able to process 20K+ TPS with another significant reduction in fees.


Unlike optimistic rollups, finality can be reached in 10 minutes using zkSync, which means all assets can be moved between the L1 chain and rollup cost-effectively and quickly.

Its current functionality includes:


  • Quick and cheap token transfer
  • Atomic swaps and limit orders for exchange protocols
  • Native Layer2 NFT support.


(Source: Coin98 Analytics)

More details on the zkSync ecosystem can be found here.

Loopring:

Loopring is a Layer2 scaling solution for Ethereum that uses zkRollups to process transactions off-chain. It has the lowest transaction fees among all L2 protocols. Loopring holds around 3.5% of the total L2 market with $198M in TVL.


Loopring protocol provides the tools developers need to build non-custodial, order book-based decentralized exchange. Unlike Uniswap or Sushiswap, which were built directly on L1 chains, The Loopring team developed the first ever zkRollup-powered DEX on L2– The Loopring Exchange. Available data suggests It can settle 2025 trades per second and the settlement cost per trade is roughly 450-800 gas on L1, which is 0.15 to 0.3% of most L1 dex protocols.


Using Loopring L2, ERC-1155 NFTs can be minted for under $1. Per their Quarterly Update Report (Q1/2022),  over 3 million NFTs were already minted on Loopring L2 following their official launch of open minting.


In a recent announcement, ‘Game Stop’ shared they are building their upcoming NFT Marketplace on Loopring Layer2.

Metis:

Metis Andromeda is a Layer2 solution that uses optimistic rollups to process transactions in a few seconds, with just a couple of cents in gas.


It is also referred to as the first "Smart L2" because it leads the way with SoulBound Tokens for on-chain governance. The on-chain social score and credit system (RPS Matrix) will make use of these tokens.


Instead of relying on external storage solutions, Metis plans to integrate an IPFS-based storage layer benefitting its roll-up structure. An added benefit is this can further reduce gas fees to just cents.


The biggest issue with its ecosystem is, by far, liquidity. Hopefully, it will be solved with the Metis Marathon campaign, which is a $100M incentive campaign spread over 26 weeks for projects to build on Metis.


Sushi Swap is the first beneficiary of this fund. ChainLink and Aave also confirmed their entry into the Metis ecosystem. With the bear market kicking in, this $100M incentive program can make builders flock to the Metis system.


Apart from that, their Builder Mining Program is another plus, where they give back 30% of transaction revenue collected every month to the dApps deployed on Metis Andromeda.

Projects built on Metis include DeFi, DAO, dApps, NFTs, payment solutions, stablecoins, etc. The top 10 Metis projects, according to TVL, are shown below.



Get the list of all projects here.

Polygon:

Instead of a single scaling solution provider, Polygon works as a solution aggregator. The platform has already launched multiple solutions that aim to improve user experiences in terms of privacy, scalability, decentralization, and transaction fees. That’s why often it’s called the Swiss Army Knife of Ethereum scaling solutions.


Polygon envisions a roll-up-centric Ethereum future. They are exploring Ethereum scaling solutions from virtually every angle. Though they are exploring both Optimistic and Zk-Rollups, they have more focus on the Zero Knowledge Technology. Even they have a dedicated $1B fund for ZK-based solutions.


Below are the 4 ZK-Rollup products Polygon is working on:

  • Polygon Nightfall (Mainnet Beta) brings decentralized private transactions to enterprises. It uses optimistic-zero knowledge technology that allows businesses to operate in a private network.

  • Polygon Miden (Under Dev) is a STARK-based EVM compatible rollup that will support arbitrary logic and transactions using its core component - Miden VM.

  • Hermez 2.0 /Polygon zkEVM (Under dev) leverages zero knowledge technology with ‘Plonky2’ while giving users and developers the complete EVM opcode equivalence.

  • Polygon Zero (Under Dev) is also a ZK-Rollup with the speed of plonky2. It generates SNARK proof with 45kB within only 0.17s, and it took only 20s to verify them on L1.


However,  it’s unlikely that all of their products will become successful. Still intriguing to see which one will become groundbreaking. Here’s a list of all other projects Polygon is currently working on, along with information on their status, and the technologies they use:



Blockworks Research shows that the Polygon PoS side chain currently has 10X the number of daily transactions than that of Arbitrum and Optimism combined.  Also, the latest data from Alchemy shows that almost 37000+ dApps have been built on Polygon.


Polygon’s PoS chain can actually work as a top-of-funnel customer acquisition channel for its entire suite of solutions. Popular Web2 names like Meta, Reddit, Dolce & Gabbana, Stripe, Addidas, and Prada have already announced their Web3 journey with Polygon.


Layer2 protocols are still in a very nascent stage. As the technology matures, the protocols will likely become increasingly popular, providing a scalable solution for many of the industry's most pressing challenges.


In their recent research report, Binance mentioned:


“L2 development appears to be on track to become more and more ubiquitous as we enter the second half of the year and it would not be surprising to see most, if not all, of the top-ranked dApps being deployed on some form of L2”


And I don’t think there will be any ‘Winning L2’.

There is no “one to rule them all”

There is no ‘the best, at least for now. Also, we don’t think there will be just one winner. The future will be one of different L2s solving the scalability issues together.


But which one is good for your business? It depends on your priorities and the functionalities that matter most for your project. Evaluate its:

  • Ecosystem Size

  • Transactions Handling Capacity

  • Asset Withdrawal  Time

  • Etc.


For example, if you are building a dApp that needs high TPS with ETH-level security, maybe Arbitrum or Optimism is a good choice. But if you need to withdraw assets fast, without waiting for weeks, these two might not suit your needs. Similarly, if you are building a game or NFT project, the Polygon PoS chain might be the right one. If you are building something complex and need a comprehensive toolset, again, Polygon can be the go-to option. If you are already a business and want to expand, consider expanding to Loopring, Metis, zk-Sync, or Polygon.

Apart from financial transactions and minting NFTs, there can be many more areas where cheap crypto transactions will be paramount for adoption. Here’s what Vitalik said about Layer2s in the ‘Korea Blockchain Week’ event:


“...Scalability isn’t just like some boring thing where you just need like cost numbers go down. Scalability, I think actually enables and unlocks entirely new classes of applications. You need to actually send a transaction to create a DNS name, you need to actually send the transaction to recover your account, and you need to actually send a transaction to meet some of these adaptations. If doing each of those operations costs like $11, then people are not going into it…”


Hence, whichever path you take, it's critical to keep blockchain scalability in mind as you develop your project. With the right planning, you can meet the needs of even the most demanding Web3 users.


Also posted here.