Sidechains are separate blockchains that are attached to a parent blockchain using an asymmetric two-way peg.
This means a token or any digital asset can be transferred from the main blockchain to a separate blockchain and moved back to the main blockchain when needed. The primary function of sidechain is to develop interoperability between itself and the parent blockchain. The two-way peg works by employing a Simple Payment Verification (SPV) to show and prove the ownership of assets on the parent blockchain.
The process begins by sending the tokens to a special output address where they become locked and un-spendable. Once the transaction has been completed, the communication of verification is communicated across the chains followed by a waiting period to prevent DOS attacks. After this waiting period, the equivalent number of coins is released on the sidechain allowing the user to access and spend them there. The time for which the token is locked in the parent blockchain is called a confirmation period. There is another waiting period in which the newly-transferred token may not be allowed to spend on the sidechain. This is called a contest period and is specifically done to prevent double-spending.
While locked on the parent chain, the coin can be freely transferred within the sidechain without 250 further interaction with the parent chain. However, it retains its identity as a parent chain coin, and can only be transferred back to the same chain that it came from. When a user wants to transfer coins from the sidechain back to the parent chain, they do the same thing as the original transfer: send the coins on the sidechain to an SPV-locked output, produce a sufficient SPV proof that this was done, and use the proof to unlock a number of previously-locked outputs with the equal denomination on the parent chain.
Sidechains are without a doubt very promising, and if everything works out, they might just be the future of blockchains since they solve the most discussed limitation of blockchain – SCALABILITY. Sidechains can allow new and potentially unstable software to get deployed and tested on a sidechain. It is the same as you create a staging website to test all your developments without harming the main website. If the software causes harm to the sidechain, the harm will not leak on the parent blockchain. Faulty software and major bugs can lead to terrible situations, for example, a DAO hack resulting in the loss of millions of dollars.
Sidechains also give the ability to have a stronger and faster mainchain. It can be evidently seen as transactions can happen on one of the sidechains and the transaction load gets completely transferred to it. Users or developers can take advantage of cheaper costs of sending a transaction by deploying their dapp on one of the sidechains. This leads to a more diversified network and a stronger, faster, and more robust mainchain.
Since sidechains are able to take some pressure off the main chain, they are also able to help solve the ancient blockchain scaling problem. Sidechains can also store data and process transactions, maintaining the integrity of the mainchain while making it smaller and faster.
The original Research Paper which explained the Sidechains first can be found HERE.
Or you can read the original whitepaper here:Sidechains