December 02, 2024 - 5 min read
Sidechains and Layer-2s are both ways to add scalability to Ethereum. However, while Layer-2s inherit the security of the Ethereum mainnet, sidechains do not. A Layer-2 is a blockchain built directly on top of the Ethereum mainnet. Popular Layer-2s include Optimism, Arbitrum, and Base. In contrast, an Ethereum sidechain is a blockchain network running parallel to the Ethereum mainnet. These chains are connected to the Ethereum mainnet via a “two-way peg” system, which permits assets to be exchanged between Ethereum and the sidechain. Polygon and Gnosis Chain are two of the most popular examines of Ethereum sidechains.
While most sidechains add scalability to the Ethereum blockchain, Bitcoin sidechains, most notably Rootstock, have also been created.
In this article, we’ll explore sidechains and Layer-2s in more detail so you can understand the difference as a developer, a potential investor in sidechain tokens, or just a blockchain or crypto enthusiast who wants to learn more.
Both sidechains and Layer-2s were developed for essentially the same reasons: to give additional scalability, speed, and flexibility to Layer-1 blockchains while reducing transaction costs (i.e., gas fees) and blockchain congestion.
Both sidechains and Layer-2s batch transactions to achieve this. Generally, Layer-2s use cryptographic proofs like Zero Knowledge Proofs (ZK-Proofs) and Optimistic Rollups to achieve this. Transaction batching typically operates somewhat differently for sidechains, but some sidechains, like Polygon’s zkEVM, released in 2022, also use ZK-Proofs to batch transactions.
Typically, most Layer-2s host a wide array of dApps, and some sidechains, like Polygon, also host many decentralized applications. However, unlike most L2s, some sidechains are designed to host only a single dApp– and these are generally referred to as Appchains. Developers typically create an Appchain when they want a lot of flexibility or specific performance characteristics that may not be available on a Layer-1 or even a Layer-2 blockchain.
For example, some DEXs need very high transaction speeds and very low gas fees to accommodate high-frequency or algorithmic crypto trading. Likewise, some blockchain games need storage space and higher transaction speeds to accommodate interactive worlds with high-quality graphics.
However, sidechains are not the only type of Appchain. Layer-3 blockchains, which are built on top of Layer-2 chains like Optimism or Base, may also be Appchains. In addition, the Polkadot network allows for the creation of independent parachains, and the Cosmos network is designed to permit the creation of relatively autonomous Cosmos Zones, both of which often function as appchains.
As previously mentioned, Sidechains utilize a two-way peg bridge to transfer assets back and forth from the sidechain to the parent chain. Smart contracts on both blockchains must facilitate this.
When utilizing a two-way peg bridge, a user locks the L1 asset (typically ETH) on a smart contract on the mainchain. Next, the sidechain’s smart contract is notified, which allows it to unlock the same amount of the sidechain asset on the sidechain. The user can then access these coins using their wallet. For example, a user could utilize the Polygon Portal bridge to bridge their ETH (or any other ERC-20 asset on the Ethereum blockchain) to unlock an equivalent amount of Polygon-bridged ETH on Polygon. They could then use this bridged ETH to transact on DEXs and other dApps on the Polygon network.
Users can then use the same bridge to effectively reverse the transaction to bridge their assets back to the mainnet.
Below, we list some pros and cons of Layer-2s vs. sidechains:
Layer-2s Pros:
Layer-2 Cons:
Sidechain Pros:
Sidechain Cons:
As we previously mentioned, sidechains have significant potential security risks that can make them vulnerable to hacks and other forms of manipulation. One of the most visible hacks involving a sidechain was the 2022 Ronin bridge hack. For those who may not know, Ronin is the name of the Ethereum sidechain utilized by the popular blockchain game Axie Infinity. This hack did not directly impact the sidechain itself but instead targeted the bridge (where user funds were held). The hack resulted in the theft of between $615-$650 million in user funds.
Attackers breached Ronin Network security by gaining access to private keys used to forge fake withdrawals. Later that year, the FBI attributed the hack to a group of North Korean hackers. While Layer-2s and Layer-3s also utilize bridges, the Ronin hack is a potent reminder that sidechain bridges can be a significant point of vulnerability.
While sidechains and Layer-2s (as well as Layer-3s) can effectively give developers more flexibility and scalability when developing their dApps, they’re not the only solution. Specifically, Supra, a new Layer-1 blockchain, has developed Containers, a way for developers to have their own isolated blockspace on Supra’s L1.
Supra Containers allow for the use of any gas token, allow customizable fees, complete governance control, require no new validators, and have zero network congestion, making them a potentially superior alternative for all kinds of dApp developers.
To learn more about Supra Containers, click here to read our whitepaper or watch an in-depth video that explains the core elements of Containers and their benefits for next-gen dApp developers who want lower fees, higher speed, and, most importantly, the flexibility and independence to do things their way.
RECENT POSTS
Suscríbete al boletín de Supra para recibir noticias, actualizaciones, análisis de la industria y más.
©2024 Supra | Entropy Foundation (Suiza: CHE.383.364.961). Todos los derechos reservados