Cryptopedia
Sidechain
The blockchain that abides by sidechain protocols is referred to as a sidechain. The sidechain protocol is a cross-chain solution that enables cross-chain asset transfer and transactions.
A sidechain protocol enables the asset transactions between the main chain and other blockchains. There are two steps of the process: first, the asset will be transferred to a certain address of the mainnet and will be frozen; after that, the sidechain will receive the message of the asset being frozen and verify it. After the verification, the sidechain will release the same amount of assets. The process is similar to when one tries to transfer the asset back to the main chain from the side chain. However, the asset released by the sidechain cannot be used immediately and should wait until the confirmation period and contest period are finished.
Confirmation Period
On blockchains, when a transaction is packed into a new block, it does not mean that the transaction is fully confirmed. A temporary fork might occur due to network latency or similar mining rates of different miners. Only when more blocks are gradually chained to the new block and become the main chain, the new block can be 100% confirmed, while all the transactions records become irreversible. Normally, it takes 1 to 2 days for a sidechain to complete its confirmation period.
Contest Period
The contest period is set up to avoid the double-spending problem. During the contest period, the sidechain will verify the transaction on the main chain by using Simplified Payment Verification (SPV). This method verifies a transaction by downloading and calculating the data from all the block headers from the main chain.
The following are the process of how the assets are transferred from the main chain to the sidechain:
1. Send asset M from the main chain to a certain address, M is locked on the main chain;
2. The confirmation phase starts, with more blocks added to the chain, the transaction is confirmed and transferred to the sidechain;
3. After the confirmation phase, the user needs to prove that asset M is locked on the main chain by sending an SPV to the sidechain, then the sidechain will generate asset M2 with the same amount as asset M.
4. Asset M2 enters the contest phase, when the contest phase finishes, M2 can be circulated on the sidechain.
Transferring an asset from the sidechain to the main chain requires a similar process.
Types of Sidechain
There are various types of sidechains, including the ones with a single custodian, multi-sig federation, SPV, drivechain, and the combination of different implementations.
Single custodian mode:
In this type of sidechain, the main chain asset will be sent to a single custodian (e.g. a cryptocurrency exchange). When the locked main chain transaction is confirmed by the miners, the exchange can release the same amount of the asset from the sidechain; after this release is confirmed by the miners, the asset is free to circulate. When a user needs to transfer the asset from the sidechain back to the main chain, the sidechain will lock up the asset, and the main chain will release the same amount of asset after the transaction is confirmed. The drawback of having a single custodian is that the control of the funds is completely centralized and whether the custodian is reliable remains to be determined.
Multi-sig federation:
With the multi-sig federation, a group of notaries approves the release of the funds instead of just one centralized custodian. When they receive the request of fund release, the notaries verify the transaction and provide their signature (similar to multi-signature). Only when the majority of the group approves the fund release will the funds be unlocked. This type of implementation is more secure, however, the notaries should be carefully selected to prevent coercion or corruption.
SPV:
SPV stands for Simplified Payment Verification. When the main chain asset is transferred to a certain address, after the block confirmation, the main chain will send the SPV proof to the sidechain. When the transaction with SPV proof appears on the sidechain, it can be confirmed that the main chain asset is locked and the sidechain can release its asset. The asset can be sent back to the main chain with a similar process. This implementation is more decentralized and secure.
Drivechain:
In a drivechain, the custody of the unlocked asset belongs to the miners. When the sidechain is about to unlock the asset, the miners reach a consensus-based on a certain protocol to confirm the release of the asset.
Combination mode:
The main chain and the sidechain can apply a different implementation mentioned above to unlock the asset. For example, the main chain can apply SPV mode while the sidechain can be a drivechain.
Advantages of Sidechains:
1. Sidechains can relieve the burden for the main chain and improve the speed of transactions. The technology of sidechain allows part of the transactions on the main chain to be processed on the sidechain, which can increase the speed of block confirmation, lower the cost of transactions, and hence effectively improve the speed of transactions.
2. Sidechains can lower security risk. Since the sidechain is independent and separable from the main chain, a security failure on the sidechain cannot affect the security and stability of the main chain.
3. Sidechains can extend the mainchain’s functionality to a great extent, such as adding privacy protection technology, smart contract, etc.
Sidechain technology significantly improves the interaction between blockchains. It not only solves the problem of low transaction speed, but it also enables functionality extension on the main chain. It is believed that sidechain is one of the new directions for blockchain development and innovations.
A sidechain protocol enables the asset transactions between the main chain and other blockchains. There are two steps of the process: first, the asset will be transferred to a certain address of the mainnet and will be frozen; after that, the sidechain will receive the message of the asset being frozen and verify it. After the verification, the sidechain will release the same amount of assets. The process is similar to when one tries to transfer the asset back to the main chain from the side chain. However, the asset released by the sidechain cannot be used immediately and should wait until the confirmation period and contest period are finished.
Confirmation Period
On blockchains, when a transaction is packed into a new block, it does not mean that the transaction is fully confirmed. A temporary fork might occur due to network latency or similar mining rates of different miners. Only when more blocks are gradually chained to the new block and become the main chain, the new block can be 100% confirmed, while all the transactions records become irreversible. Normally, it takes 1 to 2 days for a sidechain to complete its confirmation period.
Contest Period
The contest period is set up to avoid the double-spending problem. During the contest period, the sidechain will verify the transaction on the main chain by using Simplified Payment Verification (SPV). This method verifies a transaction by downloading and calculating the data from all the block headers from the main chain.
The following are the process of how the assets are transferred from the main chain to the sidechain:
1. Send asset M from the main chain to a certain address, M is locked on the main chain;
2. The confirmation phase starts, with more blocks added to the chain, the transaction is confirmed and transferred to the sidechain;
3. After the confirmation phase, the user needs to prove that asset M is locked on the main chain by sending an SPV to the sidechain, then the sidechain will generate asset M2 with the same amount as asset M.
4. Asset M2 enters the contest phase, when the contest phase finishes, M2 can be circulated on the sidechain.
Transferring an asset from the sidechain to the main chain requires a similar process.
Types of Sidechain
There are various types of sidechains, including the ones with a single custodian, multi-sig federation, SPV, drivechain, and the combination of different implementations.
Single custodian mode:
In this type of sidechain, the main chain asset will be sent to a single custodian (e.g. a cryptocurrency exchange). When the locked main chain transaction is confirmed by the miners, the exchange can release the same amount of the asset from the sidechain; after this release is confirmed by the miners, the asset is free to circulate. When a user needs to transfer the asset from the sidechain back to the main chain, the sidechain will lock up the asset, and the main chain will release the same amount of asset after the transaction is confirmed. The drawback of having a single custodian is that the control of the funds is completely centralized and whether the custodian is reliable remains to be determined.
Multi-sig federation:
With the multi-sig federation, a group of notaries approves the release of the funds instead of just one centralized custodian. When they receive the request of fund release, the notaries verify the transaction and provide their signature (similar to multi-signature). Only when the majority of the group approves the fund release will the funds be unlocked. This type of implementation is more secure, however, the notaries should be carefully selected to prevent coercion or corruption.
SPV:
SPV stands for Simplified Payment Verification. When the main chain asset is transferred to a certain address, after the block confirmation, the main chain will send the SPV proof to the sidechain. When the transaction with SPV proof appears on the sidechain, it can be confirmed that the main chain asset is locked and the sidechain can release its asset. The asset can be sent back to the main chain with a similar process. This implementation is more decentralized and secure.
Drivechain:
In a drivechain, the custody of the unlocked asset belongs to the miners. When the sidechain is about to unlock the asset, the miners reach a consensus-based on a certain protocol to confirm the release of the asset.
Combination mode:
The main chain and the sidechain can apply a different implementation mentioned above to unlock the asset. For example, the main chain can apply SPV mode while the sidechain can be a drivechain.
Advantages of Sidechains:
1. Sidechains can relieve the burden for the main chain and improve the speed of transactions. The technology of sidechain allows part of the transactions on the main chain to be processed on the sidechain, which can increase the speed of block confirmation, lower the cost of transactions, and hence effectively improve the speed of transactions.
2. Sidechains can lower security risk. Since the sidechain is independent and separable from the main chain, a security failure on the sidechain cannot affect the security and stability of the main chain.
3. Sidechains can extend the mainchain’s functionality to a great extent, such as adding privacy protection technology, smart contract, etc.
Sidechain technology significantly improves the interaction between blockchains. It not only solves the problem of low transaction speed, but it also enables functionality extension on the main chain. It is believed that sidechain is one of the new directions for blockchain development and innovations.