What are sidechains?

Eduardo Freitas
KogeCoin
Published in
6 min readFeb 15, 2022
Photo by: Investificar

Let’s say you want to cook some spaghetti. First off, this intro might be a little too complicated but you’ll learn how I make spaghetti. Now, this is what you would not do: you throw some spaghetti noodles, some sauce, and hamburger meat, all in a pan, and then wait for it to boil. That would just be some bad soup. Instead, you cook the noodles in a big pot and then you brown the hamburger meat in another pan.

Instead of doing them in the same thing, this way when the time is right, you can strain out the water and have just noodles, and then you can add in the cooked meat and the sauce. In a really weird sense, you outsourced the meat cooking to another pan, instead of trying to cook the meat in the same pot that the noodles were boiling.

You’ll see how this relates to side chains in a second. Today, I’m going to explain what side chains are, how do they work and why we need them if we want to scale to the moon.

Definition

So first off, side chains are separate blockchain that is connected to another blockchain through a two-way peg to help process some of the data from the main blockchain. Now, before we move on too much let’s go over a review of what a layer two scaling solution is and why we need them.

Layer 2 scaling solution

Main blockchains are slow and if we want to try to speed them up, they either aren’t as secure or they aren’t as safe. So we have to find a secondary method to make them faster. These solutions are called layer 2 scaling solutions. I’m working on an article about them at the moment, so stay tuned if you want to learn more!

Responsible for their own security

This may be our first important point of side chains: they are responsible for their own security. Now side chains attempt to take some of the work that the main blockchain needs to do and do it for them. Well, how do they do this? Most side chains are a little more centralized than the main chain, but this is okay because we will trade off security for speed, we just don’t want to do it on the main chain.

Own validators

Another point is that side chains need their own validators or miners. They can even have their own consensus mechanisms, meaning if they wanted to they could use proof of stake or proof of work or something as crazy as proof of space and time. Validators or miners usually earn rewards for their work in a side chain in the same manner that all other blockchains work.

Merge mining

Now I want to talk about merge mining because one of the coolest things about sidechains is that many of them allow what is called merge mining, and this is a term that means you can mine or validate two blockchains at once earning double the rewards with roughly the same amount of work.

Two-way peg

Photo by: The Merkle News

The next big point is to explain the two-way peg. It’s called a two-way peg because they are pegged moving on to the side chain and then pegged moving back to the main chain. We call these two processes locking up and releasing. Let’s go over locking up first.

Locking up

So when you move your coins and tokens from the main chain to the side chain, you have to lock them up, otherwise, you’d have a bunch of free tokens on both chains. Locking them up usually means they go to a wallet or a contract controlled by a machine or code, not a human, and you have to do something special to get them back. Nevertheless, when you lock up your coins on the main chain, you get your coins and tokens on the side chain. They’re the same thing, but this allows us to move things back and forth without allowing people to duplicate their coins.

Releasing

The second part of this peg is called releasing. So when you lock up your coins and tokens on the main chain, the protocol accepted them and meant you have free coins and tokens on the side chain that are representations of what you have on the main chain. Then, when you want to switch back, you destroy your coins and tokens on the side chain and you get to release your funds on the main chain.

So back to our crazy spaghetti analogy earlier, if you did all the transactions and data processing on the main chain, it would get super congested and backed up. Similarly, if we cook the spaghetti in water it was boiling in, the meat and the sauce all in one pan, it just wouldn’t work well. Instead, we split up multiple pans that have different purposes. In the case of a side chain, it is meant to be a bit more centralized but allows many more transactions so that the network can scale.

When users are ready to move back to the main chain, they just have to move their funds through the locking and releasing mechanism and hope that the federation lets them. This brings us to our next point: the federation.

The federation

Photo by: Elivate

A federation is a technical term for the middleman that is in charge of locking and releasing those funds and assets between the two chains. Now, not all sidechains need a federation, but many of them do because they’re quite useful. Some federations are completely coding, while many federations are controlled by the side chains organization.

The federation is in charge of making sure whatever is locked up is exactly what’s on the side chain. This way the side chain never has more value and tokens in it than those that are locked up on the main chain. Many people say federations are a huge risk of centralization between moving funds back and forth between the main chain and the side chain.

Rootstock

Photo by: Panorama Crypto

Now one example of a side chain I want to talk about is Rootstock. Rootstock, or RSK as it is commonly called, is simply a side chain to bitcoin. Bitcoin can’t do smart contracts, mostly bitcoin just processes transactions. However, Rootstock is a side chain that allows the usage of smart contracts. Rootstocks federation is made up of 25 of the biggest blockchain exchanges out there, and they have created this bitcoin bridge, where you can transfer your real bitcoin for rootstock versions of bitcoin so that you can do smart contract stuff with it.

Rootstock is pretty much ethereum but before bitcoin. You can run smart contracts, you can use gas, and even the development programming is similar.

Polygon

Photo by: SwissBorg

I couldn’t talk about side chains without talking about Ethereum’s sidechain: polygon. Polygon, or the Matic network, is roughly a side chain for ethereum. Now, ethereum has been crazy backed up in the past couple of months, meaning high transaction fees. Polygon is a side chain to ethereum that allows you to perform almost the same interactions although tenths to hundredths to even to a thousand times cheaper.

The block time on Polygon is 2 seconds compared to Ethereum’s 10 seconds. Using the Matic bridge, you can move assets from ethereum to polygon in less than an hour at any time that you want to. There are some other bridges examples you can use, so visit my guide on them here to learn more.

Conclusion

One thing to keep in mind with side chains is that they are permanent solutions that are kind of difficult to greatly change once they are in place. Roll-ups and channels are two other layers 2 scaling solutions that are not as permanent but can be changed quicker and easier. Faster interactions mean faster feedback, which means faster overall development, but side chains work.

If you have any other questions about Sidechains, please stop by the KogeFarm Telegram or Discord communities, where you’ll always find someone willing to help you out.

--

--

Eduardo Freitas
KogeCoin

A crypto enthusiast, dedicated to promote financial freedom and education.