To understand the origins of second layers in a blockchain, we must talk about the difficulty of Bitcoin to fulfill its main purpose: to be a user-to-user cash system.
Origin of second layers in Bitcoin
Bitcoin is a slow network. It can only process 7 transactions per second and this does not make it possible for it to achieve the objective expressed by Satoshi Nakamoto in the whitepaper of this blockchain, to function as money and value exchange for the purchase of any product or service and to be used on a daily basis.
The appearance of a Bitcoin Layer 2 called Lightning Network allowed BTC to be transacted in a much faster way. It was the origin of what we know today as second layer solutions. Expanding the scalability of this blockchain so that its services are enhanced and allow, for example, that today countries like El Salvador accept bitcoin as a current currency.
Second layers in Ethereum
Ethereum has similar scalability problems as Bitcoin, both in terms of slowness in processing transactions and high economic costs in commissions.
Different strategies are being developed to implement second layers on the Ethereum blockchain.
State Channels: they are very similar to Lightning Network. Protocols such as Raiden Network allow, in addition to transferring value, to store data and smart contract information.
Side Chains: they go one step further than state channels. Side Chains allow, not only to store data and transfer value, they are a whole blockchain of their own on top of another blockchain and allow the deployment of any type of smart contract. Some of the most popular projects are Polygon or Gnosis Chain.
Side Chains like Polygon are secure, but not as secure as Ethereum. The more staking the blockchain consensus protocol has, the more secure the blockchain will be. Side Chains, which also use proof-of-stake, still require more adoption and more users staking the native cryptocurrency to make it more secure. This led to the creation of another Layer 2 strategy called "Rollups".
Rollups: Rollups, in turn, are divided into two types: Optimistic Rollups that base their security on fraud proof, and zkRollups that base their security on validity proof.
Second-layer protocols of the Optimistic Rollups type, such as Arbitrum or Optimism. They are a technology that has been in operation since 2021 and allow high speed and low costs, in addition to being more secure than Side Chains.
On the other hand, zkRollups are divided into specific use applications and general use applications. As the name suggests, specific-purpose zkRollups allow you to fulfill a use case only, such as zkSync 1.0, which allows you to send or receive payments only. Immutable X allow interacting with NFTs, while (zkAztec](https://aztec.network/) allow sending payments anonymously. General-purpose zkRollups such as zkSync 2.0, Scroll or Polygon zkEVM allow to emulate everything that can be done in Layer 1, deploy smart contracts and develop any kind of dapp.
The zkRollup technologies are in the final stages of testing. If you find yourself reading this in early 2023, there may not yet be projects deployed in production under these technologies.
Conclusion
Many of Ethereum's Layer 2 technologies are still in testing and experimentation phases. We find ourselves talking about the cutting edge of technology. Technologies created in the last 2 or 3 years and that are still under development and in the process of adoption.
If being a blockchain developer is uncommon these days, it is even more so to know this kind of second layer technologies to become great Web3 professionals. In the next classes we will interact with some of these second layer protocols to have a first approach to them. Do you know or have you already interacted with any Layer 2 protocol?
Contributed by: Kevin Fiorentino (Platzi Contributor).
Want to see more contributions, questions and answers from the community?