If you go out into the wilderness of DeFi you will come across many terms such as Layer 2 solutions and Sidechans but no one seems to bother too much explaining what they actually are. That's why we are going to peel off the layers and see what we can find underneath.
Since Ethereum is the most popular destination for Layer 2 solutions and sidechains we will use it as an example here. Our layer two competitor will be Matic and for our sidechain contestant, we will pick Arbitrum.
Sidechains vs Layer 2
The main difference between these two can be found by looking into their infrastructure. Since Matic is running its own network secured by nodes that have nothing to do with Etehreum it is considered a sidechain. It is EVM compatible and ETH dapps will run on it, but the Matic chain is a completely separate blockchain.
A true layer two solution would be Arbitrum as it benefits from ETH security and uses Etehreum as the native currency to settle transactions. If Etehreum was a tree, Arbitrum would be one branch on that tree while Matic would be a completely different tree growing beside it.
In other words, a layer two solution should be benefiting from the security of layer one while a sidechain has to handle that part on its own. According to the documents on Ethereum.org, these are the definitions for the two.
A sidechain is a separate blockchain which runs in parallel to Ethereum Mainnet and operates independently. It has its own consensus algorithm (e.g. Proof of Authority, Delegated proof-of-stake, Byzantine fault tolerance). It is connected to Mainnet by a two-way bridge.
What makes a sidechain particularly exciting is that the chain works the same as the main Ethereum chain because it's based on the EVM. It doesn't use Ethereum, it is Ethereum. This means if you want to use your dapp on a sidechain, it's just a matter of deploying your code to this sidechain. It looks, feels, and acts just like Mainnet – you write contracts in Solidity, and interact with the chain via the Web3 API.
Layer 2 is a collective term for solutions designed to help scale your application by handling transactions off the Ethereum Mainnet (layer 1), while taking advantage of the robust decentralized security model of Mainnet. Transaction speed suffers when the network is busy which can make the user experience poor for certain types of dapps. And as the network gets busier, gas prices increase as transaction senders aim to outbid each other. This can make using Ethereum very expensive.
Which Is Better?
If you support the idea behind Ethereum and the general decentralization narrative you will probably want to vouch for layer 2 solutions before sidechains. They are a part of the same infrastructure and they help the ecosystem grow locally. When ETH fees started to get more and more expensive Matic and BSC offloaded a lot of that traffic but this all comes at a cost. Users get less security and liquidity gets drawn aways from the main network.
If you aren't familiar with the blockchain trillema I highly recommend reading into it a bit. Basically, it explains why you can't have security, decentralization, and scalability all at the same time. You simply need to sacrifice one of those and that's exactly what BSC and Matic did.
When it was launched, the Binance Smart Chain was secured only by a handful of nodes controlled completely by Binance. If they decided to run away with all of your money there isn't much you could do about it because sidechains (for now) are mostly centralized databases.
To be completely fair, all of them have a long-term decentralization plan but a lot of pieces need to fall in the right place before that becomes a reality.
Will All Blockchain Have A Second Layer?
Yes, and probably even more beyond that. What we all tend to forget is that crypto isn't made to replace money, it is made to become programmable money. With programmable money, you can do almost anything and we are only seeing glimpses of that innovation.
Litebringer is a game built on top of the Litecoin blockchain. It is a working Dapp that you can use today and pay for the fees in LTC. Bitcoin Cash is experimenting with DeFi and smart contracts work on Bitcoin as well. When you think about the future think about what can be done today with "cheap chains" like Matic. Move that infrastructure over to BTC and teach BTC holders how to DeFi. Can you see where this whole thing is going?