A sidechain is a designation for a blockchain ledger that runs in parallel to a primary blockchain.
First and second generations of Blockchains: Imagine that you have few bitcoins and you want to use them in smart contracts, will this be possible? The answer is “No”, because the first generation of blockchains lacks features such as smart contracts. you might ask yourself: why do I need to use Bitcoin for such a purpose? I am going to use Ethereum which is more advanced and is known as a second generation blockchain, and I can easily use smart contracts on its blockchain.
I have to say that your conclusion is partially true, but note that you made a hidden trade off here (And I don’t mean changing Bitcoin to Ethereum), by changing the Blockchain of Bitcoin to Ethereum you are basically giving away a more secure chain to get into a less secure yet more functional one (because of complex programming language that Ethereum has, it is more prone to have unseen bugs). Therefore, in the first and second generations of the blockchains, it is practically impossible to have both security and features like smart contracts simultaneously.
Now imagine that you can keep your Bitcoins (without turning them into Ethereum) and also be able to use Ethereum’s fully featured blockchain and its capabilities such as “smart contract ” and ” shorter block time” (Ethereum around 15 seconds), and eventually return them to the Bitcoin blockchain if needed. The above example is the sidechain concept, The Ethereum blockchain is represented here as a sidechain for the Bitcoin network.
Third generation focuses on implementation of sidechain technology on Blockchain with the goal of increasing functionality, the ability to connect to other networks, the ability to update without hard for, etc… without compromising on security. the Cardano project (ADA) With a special and Academic look at Sidechain concept is trying to design two blockchains to work side by side for a fully featured yet secure solution, lets continue to completely understand how Cardano works.
The Cardano project is designed to have two blockchains called CSL (Cardano Settlement Layer) And CL (Computation Layer), CSL will be used as main chain and CL as sidechain.
CSL is where ADAs will be produced, this chain does not support many features which makes it more secure because all the features will be tested, and simplicity is another reason for calling it a secure chain.
CL works as a sidechain for the main chain (CLS), CL has more features like smart contracts, and because of the complexity in implementation of the chain, it naturally is less secure than CSL.
You can transfer your ADAs to sidechain and use the benefits of CL chain, and if necessary, reinstate them back to main chain and keep it safe. This is exactly the trade off we were talking about earlier, you can keep your ADAs in a safer environment with fewer capabilities, or bring them to a riskier environment with more features and a complex programming language like Plutus.
Suppose we want to transfer 1000 ADAs from the main chain to the sidechain, to do this, it is required to create a transaction in CSL and send 1000 ADAs to an address that no one has the ability to access (burn ), After confirmation of the burning of the corresponding ADAs ( some confirmations after burning) by the core nodes of the network (Minters who are the creator of the ADAs), a coinbase transaction will be created on sidechain and the amount of 1000 ADAs will be generated and sent to the person who burned associated ADAs.
Obviously, in order to create a coin on a peripheral network, a proof is needed from the main network, in this case it is “the hash of the whole blockchain after the block which the burning of ADA’s has been confirmed” for example, in POW (Proof of Work) based networks, since POW is big in size, the proof of Proof of Work(POPOW) will be implemented (Cardano is based on POS).
Transmission process from sidechain to main chain is the opposite with the additional Firewall Property
Maybe you’re wondering what happens if sidechain gets compromised? Is it possible to create infinite number of ADAs in CL? To answer this, I have to tell you a firewall feature is designed to always consider a rule, which is the number of ADAs transmitted to the main chain from the sidechain cannot be higher than ADAs burned and transferred to sidechain earlier, in other word you cannot create more ADAs and send them to main chain than you burned in that main chain.
For example, if the entire project history shows that 1,000,000 ADAs had been transferred from main chain to sidechain, this property would only allow transferring up to 1,000,000 ADAs from sidechain to main chain, even if the sidechain is compromised, there will be no risk to the funds available on the main chain.
The features of the Cardano project are as follow:
(Items 2-3-4 are doable by sidechain technology)