The bitcoin blockchain is still very slow. It takes a long time for a transaction to take place and bitcoin to move from A to B. Buying a cup of coffee or tea with bitcoin is generally not yet feasible. A sidechain can ensure that this is accomplished much faster and more efficiently. Several crypto projects exist to try to solve this problem. In this blog, I will discuss the sidechain.
What are sidechains? Why do we need sidechains? How does a sidechain work and what are the advantages and disadvantages of a sidechain that exist beside the main blockchain?
Analogy of making a nice noodle dish
Suppose you want to make a meal and you have several ingredients. You want to make noodles, cook a steak, make a sauce, etc. You can put all of this in 1 pan, but that won't be a nice meal.... Instead, you cook your noodles, steak and sauce separately. That way the tasks are separated from each other and you cook the different ingredients in parallel. You cook the noodles in one pan, steak in another pan etc. This divides your work between different pans and allows the ingredients to focus on 1 task. This same concept happens in sidechains.
Why do we need sidechains?
Before we dive into the details, it is important to understand why sidechains are so important. As noted in the introduction, the bitcoin blockchain (but also the Ethereum blockchain) cannot process many transactions at once. A transaction takes a relatively long time to be processed. This is also called the scalability problem of blockchain. This scalability problem is a problem that bitcoin has struggled with since the beginning. Actually, every cryptocurrency blockchain struggles with this problem. If we compare credit cards to blockchain, we see that credit card companies like VISA can handle a lot more transactions than blockchain. Visa can process approximately 1700 transactions per second. The bitcoin blockchain on the other hand, only can process around 7 transactions per second. This is a big difference. If blockchain wants to be a competitor of VISA, blockchain still has a long way to go. But for this scalability problem there is a solution. This solution could be the sidechain.
What is a sidechain?
At its core, a sidechain is a separate blockchain from the parent main blockchain. The sidechain is connected in its entirety to the main blockchain. The sidechain is connected to the main blockchain through a two-way link. This means that in addition to the main blockchain, other blockchains exist that are linked to the main blockchain. These sidechains - because they are linked to the main blockchain - can communicate with the main chain. In practice, this means that you can move your cryptocurrency from the main chain to the sidechain and vice versa.
The main reason for having a sidechain in addition to a main chain is to take work off the main chain. A blockchain, such as the bitcoin blockchain does everything related to transactions. That's a lot. That's why there can only be a limited number of transactions. If work can be moved from the main chain to the sidechain, it saves a lot of work on the mainchain. Transferring work also frees up a lot of space on the main chain. This allows the main chain to focus on other elements of blockchain, such as security. Thus, the main chain now has to focus less on other parts of the blockchain because these parts are processed by the sidechain(s).
The sidechain is responsible for their own security and they need their own miners and consensus mechanisms. For example Proof of Work or Proof of Stake. They are not bound to the proof of work or proof of stake. The sidechain can also use another consensus mechanism. Miners are also rewarded as on the main chain. So the miners get a block reward for verifying transactions on the sidechain.
What is cool is that miners can mine or validate two blockchains at once earning double the rewards for roughly the same amount of work. This is also known as merge mining.
How do sidechains work?
The communication of the main chain and the sidechain is through the ''lock-up and releasing'' mechanism. If you decide to transfer your crypto to the sidechain, you must lock your crypto in a special wallet address. You cannot spend the locked-up crypto. There is some time between locking the crypto on the main chain and getting your crypto (on the sidechain). This time is crucial because it prevents double spending. After this period your sent crypto (to the sidechain) will be released in the same amount on the sidechain. You can now spend your crypto.
Please note that it is not that your crypto disappears on the mainchain and emerges on the sidechain. If you ''lock-up'' your crypto on the mainchain, then an equivalent of that crypto emerges on the sidechain. If you send your crypto on the sidechain back to the mainchain, then your crypto currency (equivalent) is destroyed on the sidechain. The crypto that was already on the mainchain is now ''released'' and you have your crypto back.
Federation
Federation is the technical term for locking and releasing crypto between the main chain and sidechain. This is handled by a middleman and is responsible for this process. Note that not all sidechains have a federation but they are very convenient and efficient in sending crypto to and from the sidechain. The middleman can be pure code or the organization that manages the sidechain. The most important job of the federation is to make sure that the crypto that is locked on the mainchain has the same amount and value as on the sidechain. This makes sure that there is never more crypto on the sidechain than is locked on the mainchain. The criticism of sidechains is that, as you can see, the sidechain is very centralized.
Pros and cons of sidechains
Pros
- because the bulk of the work is removed from the main chain, blockchain is (much) more scalable.
- Sidechains exist permanently. If you created a sidechain once, you don't have to create a new sidechain every time. If a sidechain already exists, you can use it every single time.
- Multiple sidechains can coexist with their own specialty (think of the meal that is prepared separately and each ingredient has its own focus).
- It allows cryptocurrencies to communicate with each other. This is very similar to a blockchain bridge.
Cons
- The biggest challenge is that sidechains need the same amount of security as the mainchain.
- In many cases, sidechains are not the best solution for solving scalability. A few sidechains are not going to ensure that blockchain technology can handle all the traffic.
Few examples of crypto projects that use sidechains
- Polygon (MATIC);
- Cardano;
- Rootstock.
Reactie plaatsen
Reacties