Sidechains vs. Layer-2s: What’s The Difference?

December 02, 2024 - 5 min read

Sidechains and Layer-2s are Both Popular Blockchain Scaling Solutions 

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. 

Why Sidechains and Layer-2s Were Developed 

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. 

Sidechains as Appchains 

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. 

Sidechain Two-Way Pegs: How Do They Work? 

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. 

Pros and Cons of Layer-2s vs. Sidechains 

Below, we list some pros and cons of Layer-2s vs. sidechains: 

Layer-2s Pros: 

  • Easier governance 
  • Generally more secure, as they inherit security from the L1 blockchain  

Layer-2 Cons: 

  • Less development flexibility 
  • Potentially less scalability 
  • May have lower transaction times and higher gas fees than sidechains 

Sidechain Pros: 

  • More development flexibility 
  • More flexibility with governance, as they have their own validators (for example, sidechains can use proof-of-stake or delegated proof-of-stake consensus mechanisms) 
  • May be more interoperable than Layer-2s

Sidechain Cons: 

  • Potentially less secure, as they do not directly inherit security from the L1 blockchain 
  • Setting up governance may be more complex and expensive due to the need for sidechain validators 
  • May be more centralized due to fewer validators 
  • Can be more difficult to set up from a development perspective 
  • Sidechains may have bugs that are easier to exploit than L1 bugs, potentially leading to hacks and the loss of user funds 

Sidechain Security Risks and Hacks

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. 

Sidechain and Layer-2 Alternatives 

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. 

twitterlinkedinfacebookmail

RECENT POSTS

Recibe noticias, información y más.

Suscríbete al boletín de Supra para recibir noticias, actualizaciones, análisis de la industria y más.

PrivacidadCondiciones de usoUso de datos del sitio web y cookiesRevelación de bugs (errores)Política de privacidad de la información biométrica

©2024 Supra | Entropy Foundation (Suiza: CHE.383.364.961). Todos los derechos reservados