What is Layer 2 Ethereum: Definition and Types

Ethereum’s Layer 2 Rollups Reduce Costs, but the Risks Are Underappreciated

Get to know Layer 2 Ethereum, a solution developed to address the drawbacks of the Ethereum blockchain around scalability, but without compromising on decentralization and security

The blockchain concept that Bitcoin first introduced in 2009 can basically be interpreted as a highly secure decentralized database technology. Of course, this definition is no longer relevant, because as Ethereum has proven, blockchain can now also act as the foundation for various decentralized apps (dapps).

But Ethereum itself is not without its drawbacks — network problems and gas fees, aka exorbitant transaction fees, are two common problems that Ethereum often encounters, not to mention the fact that Ethereum network operations consume massive amounts of energy due to the use of a proof-of-work consensus mechanism.

The Ethereum 2.0 update which is scheduled to roll out soon is believed to fix most of these problems. However, this update, which is also known as "The Merge", is not the only solution that can be applied, because Ethereum also has a Layer 2 (L2) solution.

What is Layer 2 Ethereum? Why is Layer 2 needed, and what benefits can it bring to Ethereum? How does Layer 2 Ethereum work? What is the difference between Layer 2 and sidechains? I will try to answer all of that in this article.

Ethereum Layer 2 definition

Before we discuss Layer 2 further, it's a good idea to agree on the meaning of Layer 1. In the context of blockchain, the definition of Layer 1 here refers to the main network (mainnet) of a blockchain that can operate independently. Ethereum, Bitcoin, Solana, are all Layer 1 blockchains that can process transactions on their respective networks without the help of external parties.

Layer 2 on the other hand is described as a separate blockchain that serves to extend the Ethereum network. According to the Ethereum Foundation, one important characteristic that every Layer 2 must have is a security system that is inherited directly from the Ethereum blockchain itself. This is important to note because Ethereum also has a sidechain (which will be explained further later).

Why is Layer 2 needed?

The ideal blockchain criterion is one whose network is decentralized, secure, and scalable (easily expandable). Unfortunately the practice is not that easy. Often times, a blockchain can only focus on two of these three criteria. If you want the blockchain to be secure and decentralized, then inevitably the scalability must be sacrificed.

One of the initiators of Ethereum, Vitalik Buterin, called this condition the “Blockchain Trilemma,” and Ethereum ultimately chose to prioritize aspects of decentralization and security over scalability. If Ethereum wasn't as popular as it is now, this decision probably wouldn't be a problem. But in reality, Ethereum can handle up to 1 million transactions every day.

Layer 2 is here to fix the problems around scalability that Ethereum is experiencing. One of the main functions of Layer 2 is to increase the speed of transactions on the Ethereum network. If you often hear news about exorbitant fees that must be paid when someone performs NFT mining activities, it is usually due to the relatively small transaction capacity of the Ethereum network.

Technically, Ethereum is currently only able to process as many as 15 transactions per second. For context, Visa is capable of processing around 24,000 transactions per second. With such a small transaction capacity, the Ethereum network is easily congested when the demand for using it is high. When that happens, the fees that must be paid for each transaction also increase.

One extreme example is when Yuga Labs (creators of Bored Ape Yacht Club), launched an NFT for its metaverse project, Otherside, in early May. Given the high demand for Otherdeed (the name NFT Otherside), some buyers were faced with unusually high gas fees — one buyer even admitted having to pay a $14,000 gas fee for minting 4 Otherdeed NFTs. 200+ million rupiah for transaction fees only!

With Layer 2, problems like this can be avoided.

How Layer 2 blockchains work

How does Layer 2 work to cut transaction fees on the Ethereum network? The short answer is to process transactions elsewhere, because as previously mentioned, Layer 2 exists on a separate blockchain.

After processing around hundreds of transactions, the Layer 2 blockchain will 'bundle' them into a single transaction which is then deposited onto the Ethereum main network. This is done periodically to ensure that all transactions are guaranteed by the decentralized aspects and security system of Ethereum.

Illustration of bundling transactions on a Layer 2 blockchain and depositing them into Ethereum / Ethereum Foundation

Among developers, this process of bundling is known as rollup, and this is also the main reason why blockchainLayer 2 can keep gas fees down to 100x lower than if all transactions were executed individually on Ethereum. Even so, not all Layer 2 apply the same rollup technique.

Optimistic rollup vs zero-knowledge rollup

So far, there have been two types of rollup techniques or protocols used by Layer 2 blockchains: optimistic and zero-knowledge, with the main difference being the way each deposits its transaction data into Ethereum.

In the optimistic rollup, all transactions that are deposited to Ethereum will always be considered valid, but can be reviewed in case of suspicious transactions. Meanwhile, in the zero-knowledge rollup, all transactions will first be validated by each Layer 2 blockchain, before finally the data is deposited into Ethereum in a compressed state.

Each rollup protocol certainly has its own advantages and disadvantages. According to CoinDesk's explanation, optimistic rollups are usually chosen because they are fully compatible with the Ethereum Virtual Machine (EVM), meaning anything that is possible to do on the main Ethereum network can be replicated on a Layer 2 blockchain. Zero-knowledge rollups on the other hand are chosen when efficiency is a priority, because all stages of the transaction are processed directly on the Layer 2 blockchain.

Layer 2 vs sidechains

After learning how Layer 2 blockchains work, we can now discuss how they differ from sidechains. Like Layer 2, sidechains also exist to address the scalability issues that Ethereum is experiencing. The difference is, sidechains completely operate independently and do not depend on Ethereum.

The sidechain has its own consensus mechanism, and the sidechain does not deposit its transaction data into Ethereum at all. This means that the sidechain does not inherit Ethereum's security system at all. The only sidechain connection to Ethereum is when users move assets between the two blockchains.

If you need an example, you can look at the game Axie Infinity. In mid-2020, Sky Mavis as the game developer launched a sidechain called Ronin with the aim of speeding up the NFT marketplace transaction process while drastically reducing the cost per transaction (gas fee).

Ronin allows Axie Infinity players to move assets to and from the Ethereum/Chrome Web Store

Ronin can operate completely independently. But as a sidechain, Ronin still has a connection with Ethereum, and this is useful when Axie Infinity players want to move their assets to and from Ethereum. The Ronin also relies on its own security system — which unfortunately failed in March, before being updated recently.

Types of Layer 2 blockchains

Layer 2 blockchains exist, and Ethereum's permissionless nature means anyone can create their own Layer 2 solution. So instead of going too long to cover everything, we're just going to focus on some examples of popular Layer 2 blockchains here.

Polygon

Of the many Layer 2 blockchains, Polygon is perhaps the most popular. Most of us have probably heard the name mentioned all over the place: Instagram supports it, fintech giant Stripe uses it, and several local NFT platforms like Bolafy and Netra also use Polygon. To date, it is estimated that there are 19,000 dapps built on top of Polygon.

Interestingly, we cannot immediately classify Polygon as a Layer 2 blockchain, because in fact Polygon develops a lot of solutions that can be used by dapp developers in the Ethereum ecosystem. Polygon even has a solution that combines optimistic protocol rollup and zero-knowledge rollup at the same time, and they also have a very popular sidechain with the ability to process up to 7,000 transactions per second.

Arbitration and Optimism

Arbitrum and Optimism are two examples of popular Layer 2 blockchains that both use optimistic rollups. Even though the protocol used is the same, each has a different way of dealing with problematic transactions during the validation process. Even so, both of them are designed to be as similar as possible to Ethereum — the advantage of using optimistic rollups — and both of them also facilitate massive transactions every day.

StarkNet

StarkNet is one of the popular Layer 2 blockchains that uses a zero-knowledge rollup protocol. As previously explained, zero-knowledge rollups excel in terms of efficiency because transaction validation takes place before the data is deposited into Ethereum. Among developers, StarkNet is known for having a very safe and efficient validation method.

Alongside Arbitrum and Optimism, StarkNet is one of the Layer 2 blockchains that will be supported by local NFT marketplace Artpedia.

Loopring

Another example of Layer2 with a fairly large market share of zero-knowledge rollup is Loopring. By its developers, Loopring is claimed to be able to handle up to 1,000x more transactions than Ethereum, but at the same time users only need to pay a 0.1 percent fee per transaction.

Recently, Loopring became a byword when it was believed to be a Layer 2 solution that powers GameStop's NFT marketplace.

Immutable X

Lastly, there is Immutable X which is specifically developed to facilitate NFT, especially gaming projects. The developer claims Immutable X is free of gas fees, and the network is quite efficient with the ability to process up to 9,000 transactions per second. Popular NFT games built on Immutable X include Gods Unchained, Illuvium, Guild of Guardians, and Ember Sword.

source: hybrid.co.id/post/apa-itu-layer-2-ethereum-pengertian-dan-jenis