📜 ⬆️ ⬇️

How to translate cryptocurrency into another blockchain: a little about sidechains

Bitcoin continues to strengthen after the recent recession. The development of blockchain technologies and a series of events in a cryptocurrency ecosystem affect the positive dynamics.

Attached to this hand and the company Bitfury Group. For example, in early July, we conducted the first transaction in the Lightning Network using a bitcoin protocol. The task of this network is to accelerate transactions and reduce costs for their implementation.

Other solutions are also being developed that should positively affect the blockchain ecosystem. For example, sidechain technology . They operate in parallel with the main blockchain and can be used, for example, to test its new functions.
')
/ image of Ardonik CC

Why side


Imagine that you can send cryptocurrency not only to addresses / wallets of other people and centralized services, but also other blockchains. This is sidechain. Sidechining is a mechanism that allows you to safely use the tokens of one blockchain in another, while maintaining the possibility of reverse translation. In this case, the original blockchain is called the main, the additional blockchains are sidechains. For example, a private Bitcoin network capable of transferring currency to a publicly available blockchain and back will be considered a sidechain for this network.

Residents of the Stack Exchange offered an analogy describing the work of sidechains. The Federal Reserve prints US dollars for the government - this is the main blockchain. However, tourists can take money and take it to other countries - sidechains - with a different economic situation. However, this currency will still be supported by the US government.

How it works


In fact, sidechains allow cryptocurrency to move from the main blockchain to other blockchains, where they can be backed up with new functions: increased confidentiality or smart contracts.

The conversion of currency to sidechain is carried out in several stages. First, bitcoins are sent to a specially created address. Enrolling at this address, the cryptocurrency is blocked. Bitcoins “freeze” and “release” them can only the owner, who will prove that the blocked funds are not used anywhere else.

After confirmation of the blocking transaction, a message is sent to the target blockchain. In the message, you “attach” proof that the coins arrived at a special address in the Bitcoin network, and you are the sender. Further, in the second blockchain, a similar number of tokens is generated, and you get control over them.

It looks as if the bitcoins have moved from one blockchain to another. At the same time, no Bitcoin was created from or destroyed. We just transferred them. Now, with these coins, you can perform operations in the second blockchain, following its rules: for example, to pay "tax" on a transaction.

To withdraw funds back to the main blockchain, the same operations are performed. A special transaction is created, freezing the coins in the sidechain, and the tokens are generated in the Bitcoin-blockchain (if it was the main one).

We will examine in more detail


To go from the main blockchain to sidechain, coins are frozen in the first and activated in the second. This operation is called a two-way peg . There are several options for its implementation.

Single Keeper Method

The currency is sent to one custodian in the main blockchain, while funds are active in the sidechain. The problem of the solution is that it is centralized. In practice, this approach is not much different from the simple transfer of funds to Bitcoin banks, for example, Coinbase or Xapo. You can consider these banks as sidechains for bitcoin.

Federation method

The second option is to replace one custodian with a notary system using the multi-signature method. In this model, the federation must sign all funds transfers between blockchains, which increases stability, eliminating a single point of failure.

In the beginning of the year, Blockstream presented whitepaper about “strong federations”, representing their vision of the principles of double fixing and its implementation in the sidechade Liquid. It is used to transfer bitcoins between exchanges.

Here is the code for calculating the chain address to which tokens should be sent, presented in the Blockstream document:



The advantages of the single-keeper method and the federation method are that they do not require changes in the bitcoin protocol.

Sidechain spv

This is a concept that is based on a two-way peg decentralized fixation. To move coins to sidechain and back, this type of commit uses SPV proofs . They prove the existence of a transaction in a block using a special data set.

The SPV moves the bitcoins between the main blockchain and the sidechain after it finds out that the signal transaction about the transfer of funds between the chains has been placed in the block. Here is an example request for GitHub, which allows you to activate coins in sidechain.

Unlike other double fixing options, the SPV sidechains do not give the custodian direct control over the funds in the main blockchain. However, the miners' ability to form fraudulent SPV-proofs gives them indirect control over the coins. However, work is underway to solve this problem.

Drivechain

Drivechain is a development of the sidechain idea. In drayvcheyne miners report the current state of the blockchain. In other words, miners are custodians of funds and are able to “unfreeze” the coins of users who want to transfer them back to the main blockchain. The concept of drayvain was proposed by Bloq economist and Bitcoin Hivemind creator Paul Sztorc.

The main axiom in the concept of drayvchains is that the miners are the least “problematic” custodians of funds from the point of view of game theory.

Hybrids

Hybrid methods are also possible, which are a combination of the methods described above. For example, the technology developed by RSK Labs, combines driving with a federation model. And although the federated model will be used in the RSK blockchain, it will become optional if 90% of miners of Bitcoin decide to jointly mine RSK.

Another idea that is similar to the sidechain concept is called extended blocks. These blocks allow users to join transaction blocks with different confirmation rules. The main difference is that the updated full Bitcoin nodes confirm transactions in the advanced block. However, there is a difficulty here - the boundaries between the expanded blocks and the bitcoin network are blurred, therefore problems in the extended blocks can cause problems in the whole blockchain.

Sidechains are deprived of this “trouble” - the main blockchain is protected from failures in the sidechain. Therefore, experimental products, like RSK, will be implemented (most likely) using sidechain rather than extended blocks.

Work for the future


Sidechain technology allows you to implement interesting things in Bitcoin space. For example, you can implement sidechain, which is mined only by employees of one company. This sidechain will be some kind of implementation of a company wallet with open transactions. A sidechain can also be mine by hundreds of federated companies - such a blockchain will be less censored.

At the same time, the technology retains such advantages as decentralized security and transparency of transactions.

Additional reading on the topic:

Source: https://habr.com/ru/post/338222/


All Articles