Buy Crypto
Markets
Contract
Spot
Earn
Web3 new
Learn
Academy > Crypto Insights > What is a Sidechain: The Most Versatile Layer 2 Solution? >

What is a Sidechain: The Most Versatile Layer 2 Solution?

2021-10-26 09:34:59

Main blockchains (mainchains), such as the Bitcoin (BTC) and Ethereum (ETH) blockchains, process a huge amount of information to store, process, and validate transactions in a secure manner. This process requires many different aspects and is very data-heavy, which means that as more information needs to be managed, it becomes congested and thus slower.

Many blockchains work at about 7-15 transactions per second (tps), compared to Visa’s 100,000 tps — and this looks to become slower as the blockchains become more clogged-up, as is currently happening to Ethereum (ETH).

To solve this, new systems are being created on the blockchains to speed up the process and improve scalability. However, in employing these new systems, blockchains risk becoming less secure to outside attack. To address this issue, developers have come up with various layer 2 scaling solutions.

sidechain

What is a Layer 2 Solution?

Layer 2 solutions are scaling solutions built to allow protocols to build applications and carry out transactions with faster transaction capacity and lower gas fees. They are called layer 2 because they are not written into a code that affects the main blockchain. Instead, they are built using outside tools or factors that allow the transactions to scale through them and into the main blockchain. Every layer 2 solution is different and built for different blockchain requirements, but all work to make the main blockchain more efficient.

layer 2 scaling solutions
Different types of layer 2 scaling solutions: channels, rollups, plasma, and sidechains. (Source: academy.ivanontech.com)

Most layer 2 solutions work alongside the main blockchain, processing data and transactions outside but still utilizing the blockchain’s security. Examples of this type of layer 2 solution can be found in:

  • Rollups:These layer 2 scaling solutions roll up a group of transactions into one single transaction and then feed it back into the main blockchain. This frees up the blockchain by taking lots of data processing away from the main blockchain. There are two types:
    • ZKrollups:Very fast and efficient. Work by combining many actions that a user will want to do on the blockchain into one simple action or article. The downside is that they cannot use smart contracts.
    • Optimistic rollups:These rollups can use smart contracts, but they are slower and less efficient than ZKrollups.
  • Channels:These are quite simple and work to achieve speed. They work by locking up assets and trading them for a virtual version that is stored on a much faster network. This is similar to how when you use a Visa card you are spending virtual money. Because the assets are already in their virtual form and ready-to-use, they can be spent instantly without as much processing or as high gas fees as would be required on the mainchain. However, channel solutions only work with transactions, and cannot utilize smart contracts or virtual machine code.
  • Plasma: The most confusing of the layer 2 scaling solutions, Plasma, creates a series of childchains(or secondary chains) that assist the mainchain with verifications. They are linked to the mainchain by smart contracts known as root contracts, which allow the mainchain to guide the plasma childchains. These plasma childchains use the mainchain as an arbitration layer, meaning that they can rely on its security, but it is slower. The main plasma childchains also have their own childchains, with the work being sifted through in order of importance to maintain security.
  • Another type of layer 2 solution, which differs from the others in that it has its own security and protocols, and can deliver more functionality than the others, is the sidechain.
get free crypto by just watching videos

What is a Sidechain?

Sidechains are a permanent solution to blockchain scalability. They are smaller blockchains that work separately but alongside the mainchain to add functionality and increase efficiency. One thing to note is that despite them being independent blockchains, they cannot operate without their parent chains (the mainchain). Mainchains, on the other hand, can work without sidechains.

Sidechains are quite complex, having their own validators or miners, and even having their own consensus algorithms, such as proof-of-stake (PoS) or proof-of-work (PoW). This means that once established, they can be quite difficult to change. By having their own infrastructure, however, the sidechains remain separate from the main blockchain and can therefore ensure the mainchain’s security. This is important since sidechains tend to be more centralized than mainchains. However, trading a little security for extra speed can be okay so long as it’s kept separate from the main blockchain. Moreover, the information that is outsourced to the sidechain can be selected to maintain blockchain security, with the most sensitive information remaining on the mainchain.

How is a Sidechain Structured?

Sidechains work like small, independent blockchains. What differentiates them from the mainchains is that they tend to be smaller, faster, and more centralized. Their main job is processing and validating data for the mainchain or adding functionality, such as running smart contracts for blockchains that are unable to do that, like Bitcoin. To do this, they communicate with the mainchain in the following ways:

  • First is the use of a two-way peg, creating pegged sidechains. These have two parts and use simple payment verification (SPV) to ensure ownership of the coins:
    • Locking up:This peg is for the movement of coins or tokens from the mainchain to the sidechain. To do this, the coins are locked up in an output address to avoid a presence of free coins on both chains. Once the coins are securely locked up to avoid them being spent elsewhere, the equivalent amount is minted on the sidechain. These are then sent to a wallet or smart contract on the sidechain, which is controlled by a machine or code, as opposed to by a human. To retrieve the coins, a particular action must be carried out.
    • Releasing:This peg is used when an individual wants to retrieve their coins or tokens from the sidechain and unlock them in the mainchain. This is a harder process than locking up. To retrieve these, the representational coins on the sidechain must be destroyed, thereby releasing the coins on the mainchain and avoiding ever having duplicates.
  • Second is the presence of a federation, though this is not present in all sidechains:
    • Federations are the middlemen in charge of the locking and releasing functions between the sidechains and mainchains. They are sometimes thought of as a threat to centralization; however, they are very useful in maintaining the integrity of the transactions between the chains. Some are machine-based, meaning that they are made-up from code, while others are made-up by the sidechain’s representative organization.
    • The federation will ensure that the minted representative coins exactly match the coins locked up on the mainchain before authorizing any transaction or the “release” of any coins from one chain to another. If there is any discrepancy between values, the federation will block the transaction. This means that the sidechain will never hold more value than the mainchain.
sidechains and parentchains
Two-way pegs between sidechains and their parentchains. (Source: Whiteboard Crypto)

By using a sidechain to process transactions and verify data, the mainchain’s scalability improves and transactions can be processed faster. For this reason, users will often move their coins to the sidechain in order to complete tasks or run smart contracts faster, after which they will return them to the mainchain.

An Example of a Sidechain: Bitcoin 2.0 Release and The Rootstock (RSK) Sidechain

Bitcoin 2.0 refers to the expanding of the Bitcoin protocol beyond its capacities via sidechains. BTC is considered the king of cryptocurrency and the most stable of the stablecoins. However, the Bitcoin protocol is slow and cannot support many other functions. By adding sidechains to its protocol, it can improve scalability, efficiency, and add new functionalities.

Bitcoin 2.0 structure
Bitcoin 2.0 structure. (Source: xbt.net)

Rootstock (RSK) is a sidechain that is revolutionizing the Bitcoin protocol, though it is not the only one it uses. Up until recently, Bitcoin has mostly processed transactions, while Ethereum has allowed for the building of smart contracts and new protocols. But by pegging the RSK sidechain to its blockchain, Bitcoin can employ it to use smart contracts, thereby broadening its functionality.

RSK essentially adds an Ethereum-like layer to the Bitcoin protocol. BTC is first locked in the Bitcoin protocol, and then minted via its own two-way peg, known as the Bitcoin bridge, into sidechain coins — in this case RSK versions of BTC. These RSK versions of BTC can then be used for building and executing smart contracts. This process is all overseen by the RSK federation, which is formed of 25 of the biggest blockchain exchanges on the net. Through this, Bitcoin can improve its offering and scalability, while maintaining security and not compromising its own blockchain.

Conclusion

The main difference between sidechains and most other layer 2 solutions is that while sidechains are their own blockchains, connected to the mainchain, most layer 2 solutions are built as an extension of the mainchains themselves and therefore rely on their security structure. They layer on top of the main blockchain, neither completely separate, nor completely integrated, to provide a faster, cheaper service with mainnet-level security.

Both options are great ways to improve scalability, but they differ substantially. A sidechain can offer more functionality than most layer 2 solutions, as for example, RSK can enable the Bitcoin protocol to build DApps using smart contracts.

However, by often being more centralized than other layer 2 solutions, as well as having its own security features, such as consensus algorithms and validator nodes or miners, it could be considered less secure. Moreover, though sidechains offer a huge advantage to users by providing a faster and more efficient service, they can often have high fees when transferring assets from the mainchain to the sidechain. Additionally, the presence of a federation makes some users uneasy and adds to the possibility of not being able to transfer one’s assets back from the sidechain to the mainchain.


For any inquiries contact us at support@phemex.zendesk.com
Follow our official Twitter | Join our community on Telegram
Trade crypto on the go: Download for iOS | Download for Android
Phemex | Break Through, Break Free
giftRegister to get $180 Welcome Bonus!
Email
Password
Invitation code (Optional)
  • Facebook
  • Twitter
  • LinkedIn
  • Telegram
  • Discord
  • Youtube
Subscribe Phemex

Register on Phemex and begin your crypto journey today

Get $180 to Sign Up