Ethereum – the one blockchain we all know and love has a problem. Its main competitive advantage over other blockchains, amazing and rich ecosystem of developers and dApps, could be a harbinger of its downfall. Although this may sound a bit overly dramatic, we can see teams and projects migrating to other blockchains and people talking about “Ethereum killers.” The keyword here is scalability, and that’s where Layer 2 solutions come into play.
Why do we need Layer 2 anyway? Well, let’s start with the source of the problem.
As Ethereum’s popularity grew, more dApps and users joined the ecosystem. This all caused network congestion since the miners couldn’t process the ever-increasing amount of transactions, which led to abnormally high gas fees threatening to make Ethereum a “whale chain.”
So, why don’t just increase the block size, introduce PoS, sharding and other fancy scalability features? Well, if you’ve been around long enough to remember the philosophical reason for the Bitcoin Cash fork, you probably understand that scaling the Layer 1 blockchain isn’t a long-term solution. The number of users and dApps is only going to increase – do we scale the L1 one every time we can’t afford to do a simple swap on Uniswap?
The Need for Layer 2
Since the latest crypto bull run and the all-time-high gas fees, the urge for an effective Layer 2 solution has become greater than ever. That’s why we can see numerous new projects and technologies aiming to solve Ethereum’s scalability challenges. The main idea is to transfer a portion of congestion from Ethereum’s chain to other chains to prevent the clogging of the main chain. Some of the most common solutions that are created to do this are:
- State Channels
Let’s briefly go over each one of them.
I know some people are now ranting about how Sidechains aren’t a Layer 2 – and they are right. We just need to include them since they are one of the possible solutions for Ethereum scaling. Sidechains are independent blockchains relying on their own consensus mechanisms and security properties, contrary to Layer 2 solutions.
Sidechains run alongside the main chain and are communicating with it. Interoperability is achieved through the Ethereum Virtual Machine (EVM).
If you want to move assets between the chains, you need a smart contract on Ethereum. You lock the assets in the smart contract and mint them on the sidechain. You do the opposite if you want to move assets from the sidechain to the main chain.
While they are significantly reducing the cost of transactions, sidechains rely on their own consensus mechanism and nodes, which raises security concerns since they are not battle-tested and as robust as Ethereum. One of the most prominent examples of sidechains is xDai.
State Channels are one of the first Layer 2 solutions and they provide a way to conduct off-chain transactions an unlimited number of times while only submitting only two transactions to the main chain. The base idea is this: Let’s say that Alice and Bob want to send transactions to each other on a daily basis. They both lock their assets in a multi-sig contract – that’s the first entry on the main chain. Then, whenever they make a transaction with each other, they sign an off-chain transaction. If Alice wanted to withdraw her assets from the channel, she unlocks them from the smart contract – that’s the second and the last entry on the main chain.
Although very useful, State Channels are very limited due to the inability to send assets to non-participants. One of the projects that use State Channels on Ethereum is Raiden.
Plasma is a Layer 2 scaling solution that leverages the power of Merkle Trees and smart contracts, which enable the creation and communication of smaller versions of the Ethereum chain. These smaller chains are called child chains or Plasma chains, and the Ethereum chain is the parent chain. Child chains can also be built on top of other child chains, making a tree-like structure.
These child chains periodically interact with the parent chain, usually settling disputes and reporting dishonest nodes through Fraud Proofs.
Although it reduces fees and amount of data on the parent chain and it’s compatible with other scaling solutions such as sharding, Plasma requires long waiting withdrawal periods (7-14 days) and has a poor user experience overall. You can check out OMG Network to see the possibilities of Plasma.
Rollups are a bit younger than other Layer 2 solutions. They compress transactions and roll them up in a single batch that is submitted on the main chain. When a user publishes a batch with the new state root with processed transactions, an on-chain smart contract with things like the account balances and contract code inside the Rollup switches the old state root to the new state.
There are two types of Rollups: ZK-Rollups and Optimistic Rollups.
The Zero-Knowledge Proof Rollups use validity proofs. This means that every batch includes a Zero-Knowledge Proof (SNARK) – a cryptographic proof that proves the post-state root is correct after it executes the batch. Operators must generate a SNARK for every state transition, which is then verified by the smart contract on the main chain.
When an operator rolls up transactions and posts the data to the main chain with a signature, everyone assumes the state transition is correct. But when an incorrect state transition gets published, operators and users can revert the incorrect block and slash any malicious operator’s bond. Also, to prevent operators from censoring anyone, the smart contract accepts transactions directly from users.
One more big advantage of Optimistic Rollups is they can run an EVM-compatible Virtual Machine called OVM (Optimistic Virtual Machine), which allows for executing the same smart contracts as can be executed on Ethereum. This makes it possible for developers to migrate their dApps to Rollups without any new code.
Which Layer 2 Projects Are Competing for the Title?
There are many. As we could see, there are four main technologies and numerous projects building on each one of them. Let’s take a look at some of the leading projects in the Layer 2 race.
Loopring is an Ethereum Layer 2 scaling protocol. It allows for building high-throughput, low-cost, non-custodial AMMs, order-book exchanges, and payment applications on Ethereum by leveraging Zero-Knowledge Proofs.
With ZK-Rollups, Loopring claims its exchanges can offer faster settlements for traders. Rather than settling trades on the Ethereum blockchain directly (as other decentralized exchanges do), ZK-Rollups enable Loopring exchanges to complete key computations off-chain.
Users must first send their funds to a smart contract managed by the Loopring protocol. Then, Loopring exchanges move the computation necessary to complete trades off of the main Ethereum blockchain. This includes information such as a user’s account balances and order histories.
Loopring then settles transactions on the Ethereum blockchain to finalize trades between users that were first matched off-chain. These trades are batched to reduce cost and increase speed. Loopring claims it can perform over 2,000 trades per second with this technique.
The team recently announced a new initial token issuance mechanism – Initial Wallet Offering (IWO), a novelty in the crypto space. Also, they are constantly working on integration with other projects, such as OpenOcean.
Optimism is one of the most prominent projects that utilize Optimistic Rollups as a Layer 2 scaling solution.
They’ve been announcing partnerships with other famous projects left and right. Optimism “soft launched” its solution earlier this year — the Optimistic Virtual Machine (OVM) — with decentralized exchange Synthetix. Optimism said Synthetix users have already been enjoying speed and cost savings. Around $10 million have been saved on fees across more than 100,000 transactions, said Optimism.
Another major decentralized protocol set to integrate with Optimism is Uniswap. We already wrote about the much-hyped Uniswap v3. Although the Layer 2 deployment had to be delayed due to “lack of community preparation” for Optimism mainnet, they already deployed a testnet demo – Unipig.
The OMG Network (formerly known as OmiseGo) is a decentralized, public network that allows high throughput, low-cost peer-to-peer transactions. It leverages Layer-2 Plasma architecture to provide high throughput and strong safety guarantees for third parties who wish to build scalable, decentralized payment apps on the Ethereum Network.
The OMG Network can process thousands of transactions per second and reduce operating costs on Ethereum by one-third. Its native OMG token can be used to pay for transaction fees and staking when the platform launches its proof of stake protocol.
The explosive DeFi industry in 2020 pushed up the price of the project’s native token after investors started seeking Layer 2 solutions amid soaring Ethereum transaction fees. The project completed a $25 million initial coin offering back in 2017 after securing $17.5 million in Series B funding from venture capital investors.
They’ve recently announced the launch of a public testnet of OMGX with Enya. OMGX is a Layer 2 platform that supports Ethereum Virtual Machine (EVM) compatible smart contracts, token staking and streamlined cross-chain liquidity.
You’ve probably heard about this one a lot in the last few days. It’s one of the most popular Layer 2 projects aiming to create “Ethereum’s Internet of Blockchains.”
Polygon (previously Matic) is a protocol and a framework for building and connecting Ethereum-compatible blockchain networks. They are aiming to achieve this by exploring and leveraging a long list of technologies and scalability solutions – Matic Plasma, ZK-Rollups, Optimistic Rollups, Validium Chains, but also through standalone chains – Matic PoS Chains, Sidechains and Enterprise Chains.
Both Polygon and Matic were very successful before the integration. Now, with combined technologies and engineers, they aren’t betting on just one Layer 2 solution but all of them.
They managed to bring some of the most famous players in the field on their side – Aave, 1inch and SushiSwap, just to name a few. This was all reflected in Polygon’s native token (MATIC) parabolic growth and left only 0.6% of the total supply on exchanges just a few days ago.
We are also firm believers in Polygon’s vision and potential. Our Web3 incubator 3327 is working on some interesting stuff with them. Make sure to check out our Discord community and join the conversation.
Will Layer 2 Save Ethereum?
Layer 2 solutions will relieve Ethereum of some stress and urgency to solve the main chain’s problems, that’s for sure. But there are a couple of hurdles. Currently, different Layer 2 solutions aren’t interoperable. dApps on one Layer 2 cannot easily communicate with another dApp on another Layer 2. This breaks one of the best properties of DeFi – composability.
Another problem is a lack of liquidity. As we could see, many projects are trying to get their piece of cake in the Layer 2 race. If all (or many) of them succeed, we’ll be in a situation where all the liquidity that currently exists on Ethereum will be split across Ethereum and various Layer 2 solutions. If the interoperability problem isn’t solved, we might end up with a market that’s not very liquid and incredibly volatile.
This problem must be solved to achieve the true potential of Ethereum’s Layer 2 ecosystem. Whether it’s going to be done through bridges or some cross-chain solutions like Polkadot remains to be seen. However, in an unlikely scenario that only one Layer 2 project takes all the money, this won’t be a problem.
Is Ethereum 2.0 a Competitor to Layer 2?
Phase 2 of Ethereum 2.0 is announced to launch sometime this year. It’s going to be improved in terms of efficiency, transactions throughput and parallel processing through sharding. However, this advancement isn’t going to be enough to handle the expansion of DeFi and the entire Web3 ecosystem. The growing number of users, and therefore transactions, will possibly overwhelm even the improved Ethereum 2.0 chain. So, we can pretty much be sure that Layer 2 is here to stay. It’s just that the transition from Layer 1 to Layer 2 might go a bit slower. Even Mihailo Bjelic, the Co-Founder of Polygon said it himself – Ethereum scaling platforms ARE Ethereum.
Ethereum is growing faster than ever. In order to keep growing, it needs high-performing Layer 2 solutions. It’s not very probable that one such solution will beat all others since there are many, many more users and assets to join the ecosystem. Also, different Layer 2 technologies solve different problems and there is no one-size-fits-all solution. What might happen is: Layer 2 solutions are going to build an ecosystem around Ethereum, and dApps and other specific-purpose applications and chains will build an ecosystem on top of them.
One thing is sure – it’s going to be magnificent.