Sidechain

The term sidechain refers to an independent blockchain that is connected to a main blockchain (also called the mainchain or main network) through a two-way peg. The main purpose of a sidechain is to extend the functionality and scalability of the main blockchain, allowing for faster and/or cheaper transactions and operations without overloading the main network.

How does sidechain work?

The key mechanism that enables the interaction between a sidechain and the mainchain is the two-way peg. It ensures that assets can be safely moved between the two networks. Here’s how it works, step by step:

Moving assets to the sidechain (Peg-in):

  • A user wants to use Bitcoin (BTC) on a sidechain that supports smart contracts, such as Rootstock (RSK).
  • The user sends an amount of BTC to a special address on the Bitcoin blockchain. This amount of BTC is locked on the mainchain and effectively becomes unusable there.
  • Once the transaction is confirmed on the mainchain, an equivalent number of tokens (e.g. Smart Bitcoin – RBTC on RSK) are issued or “unlocked” on the sidechain.
  • The user now has tokens on the sidechain that they can use for quick, cheap transactions or to interact with smart contracts on that sidechain.

Moving assets back to the mainchain (Peg-out):

  • When the user wants to move his assets back to the main blockchain, he initiates a transaction on the sidechain.
  • The equivalent amount of tokens is destroyed or “pegged” on the sidechain.
  • Proof of this action is transmitted to the mainchain, and the initial amount of Bitcoin is unlocked from the sidechaechain and returned to the user on the mainchain.

Who provides the security and transfer? Unlike Layer 2 solutions (such as Lightning Network or Rollups), which usually inherit their security directly from the main blockchain, a sidechain has its own consensus mechanism and its own validators. This means that the security of a sidechain depends on the security of its network of validators. If the sidechain’s validators do not act honestly or the network is not sufficiently decentralized, there are risks.

Advantages of sidechain

  • Scalability: By taking a share of the transaction volume, sidechains reduce congestion on the main blockchain, allowing more transactions per second at lower costs.
  • Flexibility: sidechains can have their own rules, consensus mechanisms (such as Proof-of-Stake, Proof-of-Authority, etc.), different block timings and unique features. This allows developers to experiment with new functionality and innovations without affecting the stability and security of the main blockchain.
  • Added functionality: A sidechain can offer functionality that the main blockchain does not have natively. For example, Rootstock adds smart contract capabilities to Bitcoin, which does not have complex smart contracts directly.
  • Interoperability: Sidechains facilitate the transfer of assets and data between different blockchains.

Sidechain disadvantages and risks

  • Independent security: This is the biggest disadvantage. Since sidechains have their own set of validators and consensus mechanism, they do not directly inherit the robust security of the mainchain. A sidechain with a small or centralized validator base is more vulnerable to attacks.
  • Complexity: Deploying and maintaining a sidechain, including the two-way peg, are complex tasks that require considerable technical expertise.
  • Additional costs: Although sidechain transactions are cheaper, peg-in and peg-out processes (moving assets between the mainchain and the sidechain) usually involve fees and waiting time.
  • “Federation” risk: Many early sidechains rely on a centralized or semi-centralized set of “federators” managing the two-way peg, which introduces a point of centralization and trust.

Notable Examples of Sidechains

  • Rootstock (RSK): a Bitcoin sidechain that brings Ethereum-compatible smart contract functionality to the Bitcoin network, allowing developers to build DeFi applications on Bitcoin.
  • Polygon PoS Chain (formerly Matic Network): often considered a sidechain of Ethereum, though now positioning itself as a hybrid Layer 2/sidechain solution. Provides fast transactions and low costs for DApps on Ethereum.

Sidechain vs. Layer 2 Solutions (Ex: Rollups, Lightning Network)

While both aim for scalability and improvement, there is a fundamental difference in the security model:

  • Sidechain: It is a separate and independent blockchain with its own security model. If compromised, the mainchain is not directly affected, but funds locked on the sidechain may be lost.
  • Layer 2 (e.g. Rollups, State Channels, Lightning Network): These rely on the security of the main blockchain. Transactions are processed off-chain, but the relevant data is eventually “anchored” or verified on the mainchain, benefiting from its robust security. In case of an attack on a Layer 2, the mainchain should be able to protect the funds.

Ready to buy or sell cryptocurrencies? We’ve got your back! Visit the “Cryptocurrency Price List” to stay up to date with real-time updated prices. And if you want to plan your strategy, our cryptocurrency profit calculator helps you anticipate your profit or loss at a glance, based on the bid, ask and allocated amount.