Explain the difference between Ethereum sidechain and L2

Explain the difference between Ethereum sidechain and L2

With millions of users joining every day and new applications constantly being launched, Ethereum is now severely limited by the number of transactions it can handle. Ethereum's ability to process transactions, its transaction throughput, is limited to 15 transactions per second, causing it to become increasingly expensive and overcrowded, making it unusable for many people.

The Ethereum network is the main chain, and all transactions that occur directly on it are "on-chain", while any other transactions are considered "off-chain". Some off-chain solutions such as sidechains and L2 can help Ethereum scale up, increase transaction speeds, and increase the number of transactions the network can handle. In this article, we will show what sidechains and L2 solutions are, and how they can help achieve scalability.

Sidechains and L2 Ethereum solutions help solve Ethereum's scaling problem. Attempts to improve on-chain performance often result in trade-offs in Ethereum's decentralization or scalability - this is known as the scalability trilemma.

Sidechains and L2 solutions allow for continued and incremental innovation, improving Ethereum for everyone while maintaining security and decentralization.

The main difference between sidechains and Ethereum L2 solutions is that L2 inherits the security of the Ethereum main network, while sidechains rely on their own security.

An Ethereum sidechain is an independent blockchain network that runs in parallel with the Ethereum mainchain. The sidechain is connected to the mainchain through a two-way peg system, allowing assets to be exchanged between sidechains.

There are two basic types of sidechains, those that are interdependent and those that are independent of each other.

When a chain depends on another chain (such as Ethereum), it can be considered a child chain of this parent chain. Typically, the child chain does not create its own assets, but obtains assets from the transfer of the parent chain.

Sidechains have their own consensus protocols and are usually designed for specific types of transactions, with the goal of making transactions faster and more affordable. However, this also means that they usually do not inherit the security properties of Ethereum, and when using a sidechain, we only rely on the security of the sidechain, including the nodes participating in its own consensus protocol.

Sidechains reduce congestion on the main chain, lower costs for everyone, and increase the usability and scalability of the Ethereum ecosystem. Developers can also use sidechains to explore and test new features and use cases that are not available on the main chain.

Popular sidechains include Polygon PoS, Skale, and Rootstock. Ethereum 2.0 has its own variant of sidechains, called shard chains, which are connected to the recently launched beacon chain, which aims to eventually become the Ethereum main chain based on proof of stake (PoS).

The sidechain is connected to the mainchain through a two-way peg system or bridge. On the mainchain, we can send our Ethereum to an exit address that acts as a lockbox so that we cannot use it elsewhere.

Once that transaction is complete, and the “race period” has passed (for added security), a receipt called “Simple Payment Verification” (SPV) is provided. This triggers the release of the same value from a lockbox on the sidechain via a smart contract. When “transferring” from the sidechain to the mainchain, the exact same process occurs, only in reverse.

Sidechains are based on the Ethereum Virtual Machine (EVM), which is Ethereum's computing engine. This compatibility with the Ethereum Virtual Machine means that developers do not need to make any changes if they want to use their applications in sidechains. It is just a matter of deploying the same code, because they all share the same solidity software layer and can be accessed through the same Web3 API!

L2 protocols are chains that exist within the Ethereum chain, but are able to achieve greater scalability through a secondary framework. Congestion on the main layer is reduced by handling a large amount of activity on L2. Unlike sidechains, L2s generally inherit the security properties of the main chain.

Layer 1 is the underlying blockchain. Ethereum is a layer 1 blockchain because it is the underlying foundation on which various L2 blockchains are built. Simply put, L2 compresses transaction packages and submits them to the Ethereum main network.

L2 scaling solutions include channels, rollups, and plasma. Here is a breakdown of these individual solutions:

Channel

Through channels, users conduct transactions directly off-chain and reduce on-chain transactions to only the most important information. Specifically, a portion of the blockchain is locked through a smart contract, so before updating it, the participants involved in the transaction must fully agree.

Participants update their own state by creating and signing transactions that can be submitted to the blockchain. Once we want to stop using the channel, we exit and submit the last state update to the main chain, which will unlock the state again.

Rollup

Rollups execute transactions outside of the Ethereum mainnet blockchain, then batch multiple transactions together and send them back to the Ethereum mainnet. Rollups rely on proofs, allowing Ethereum to verify the correctness of transactions without processing them.

Two types of rollups

Generally speaking, there are two types of rollups: Zero-knowledge (ZK) rollup and Optimistic rollup.

Zero-Knowledge rollup (ZK rollup) uses validity proofs. Each batch of transactions contains a cryptographic proof called a SNARK, which is verified by a contract on the Ethereum main layer.

Since only the validity proof needs to be stored on the main chain, without storing a large amount of transaction data, this off-chain calculation saves a lot of processing time, making ZK-rollup faster and more efficient.

Optimistic rollups use fraud proofs. As the name suggests, they optimistically assume that all transactions are valid and submit batches without any initial proof. There is a challenge period during which others are able to detect and prove that some data is false.

If the batch is proven to be fraudulent, then Optimistic rollps executes the fraud proof and runs the correct transaction calculation using the available data on the Ethereum main chain. Participants are required to be rewarded or slashed based on their actions to incentivize good behavior.

Companies like Optimism are helping Ethereum scale by providing greater throughput, less latency, and lower gas fees. At the time of writing, Optimism’s gas fees are 10 times cheaper than Ethereum’s.

plasma

You can think of Plasma as a native sidechain for Ethereum, using a combination of smart contracts and Merkle trees to create infinite branches of child chains. These child chains are smaller copies of the Ethereum main chain with their own consensus mechanisms.

The bandwidth required for computation and transaction data is offloaded from the parent chain but is periodically submitted to the root chain. Each child chain relies on a fraud proof system for security, which is similar to a rollup, with a time period in which anyone can question its validity.

The key difference from other sidechains is that the “root” of each Plasma chain block is published to Ethereum, meaning it inherits the security of the main chain.

Companies like Polygon offer lower gas fees for developers and end users, resulting in faster transactions. These clear benefits make developing on Plasma very attractive, and it’s easy to see why they’re seeing explosive growth.

Alchemy currently supports Ethereum Layer 1 chains and Arbitrum L2 chains. Arbitrum is an independent chain built on Ethereum that supports faster transaction speeds, higher throughput, lower gas fees, and more benefits as a smart contract. Activities and transactions are ultimately relayed from Arbitrum to the Layer 1 chain via Optimistic rollup.

Massive adoption of scalability solutions like sidechains and L2 (channels, rollups, and plasma) takes the pressure off the Ethereum mainnet, thereby helping more users enjoy faster transaction times, lower high transaction fees, while still maintaining the same security (in L2 solutions) and decentralized applications.

Source: https://www.web3.university/article/sidechains-vs-layer2s

<<:  What will happen to cryptocurrencies if stablecoins collapse?

>>:  The continued decline of cryptocurrencies has caused concerns: What are the main factors affecting the market outlook?

Recommend

Your personality and fortune from your eyebrows

As the saying goes, appearance reflects the heart...

What does a triangle on the career line mean?

How to read the career line diagram on palmistry?...

How to tell if a woman has a lucky face

Blessings are something that everyone is pursuing...

What does a mole on a man's chest mean?

As the saying goes: have great ambitions. Of cour...

What about men with thick lips

What about men with thick lips? Are men with thic...

What kind of woman is good for her husband?

In fact, a woman can often be identified through ...

What kind of people will get married late?

Although marriage is largely the result of one...

How to read moles on the palm of your hand - graphic analysis

In fact, moles can also indicate our fortune. In ...

What kind of people will get rich in 2020?

Feng Shui changes over time. People who have good...