The layer 2 blockchain technology has gained steam and will continue to in order to find viable solutions to the problems plaguing the blockchain network. Layer 2 is basically a secondary protocol or framework built upon an existing blockchain system. Like you have it in Ethereum networks, you’ll find it on other blockchain networks. It’s referred to as an “off-chain” network, and the main aim is to provide support to the main layer. The main purpose of layer 2 is to scale the blockchain transaction capacity without compromising the blockchain protocol’s decentralization benefits.
With the demand for Ethereum blockspace exploding over the last years, we can discuss how much the traction has led to high gas fees and slow transactions. Scaling blockchain networks is necessary as root networks can only process about 15-20 transactions per second. Other issues like questionable privacy and some native limitations also exist. And root blockchain networks can theoretically solve these problems, but it comes at a cost that is referred to as the scalability trilemma.
The Scalability Trilemma
The scalability trilemma is a phrase coined by Vitalik Buterin, the founder of Ethereum. He used the phrase to describe that it is impossible to equally maximize all three desirable traits (decentralization, scalability, and security) of a blockchain network. The trilemma explains that blockchain systems can maximize two of the attributes at the expense of the third one. Therefore, this leads to trade-offs depending on applications and their specific use. The attribute that will prove most useful differs from the use case and will have top priority.
Desirable Blockchain Attributes
Decentralization: This means distributing and dispersing power away from a central channel. This allows for control and data storage to be shared across multiple nodes in the network. This makes the network efficient, resilient, and democratic. Anyone can participate in the ecosystem, as it allows every user the opportunity to become one of the many payment processors on the network.
Scalability: This attribute is the ability of a blockchain network to cope with the influx of transactions. A network is considered scalable if it’s able to process thousands of transactions per second. However, the issue with scalability is it’s mutually exclusive with decentralization. This explains why highly decentralized networks like blockchain and Ethereum, scalability is a challenge.
Security: This attribute refers to the ability of the network system to protect data from leaks, loss, or modifications. The network uses encryption to store and transmit cryptocurrency data between wallets and public ledgers.
Trilemma trade-offs occur as a result of a blockchain network not being able to maximize all three of these attributes.
Decentralized and Secure networks are networks like bitcoin and Ethereum networks that are non-scalable. They are not suitable for a commercial payment system because a transaction can take about 5 minutes and even up to 1 hour in some cases. As the nodes of a network increases, its scalability is compromised as it is faster to upload 10 rather than 100 distributed ledgers.
SQL, SAP, Oracle classify as scalable and secure networks. They are centralized; hence the data in these networks are managed by database administrators and are stored in several locations and backups rather than nodes as we have on decentralized systems.
New blockchains like EOS, NEO, Tomochain are decentralized and scalable as they sacrifice some decentralization for scalability.
Understanding Ethereum Layer 2
As the main purpose of layer 2 is to improve the scalability of blockchain networks, these solutions will contribute significantly to blockchain mainstream adoption. In building the desired blockchain ecosystem, the layer 2 blockchain system is needed to balance the needs for decentralization, scalability, and security.
Layer 1 is the base consensus layer of the Ethereum network. It’s believed that Ethereum will eventually embrace layer 1 scaling solutions via sharding, which will split the network’s activity across 64 main chains than one.
But before this is implemented, L2 tools work so well to provide scaling solutions. L2 tools process data in a manner that reduces the workload on the root network (base layer). Therefore, the Ethereum network can handle a much higher number of transactions by offloading transactions from the main chain to layer 2 platforms.
Layer 2 is basically tethered to the base layer and uses its existing elements, such as the smart contracts, which means it relies on layer 1 as a means of finality and security.
When a transaction is performed on a decentralized blockchain network, there’s universal consensus across all the networks. The copy of the transaction will be stored on all the nodes on the network for validation of the transaction. To help cut down massively on this data [rocessing, layer 2 allows you to run computations off-chain. The second layer does this while still attached to the base layer, getting decentralization and security benefits and would free up processing resources to do other things.
Over the years, layer 2 scaling techniques that have proved helpful to the Ethereum network include State Channels, Side Chains, Plasma, and ZK Rollups.
State Channels help to create enough processing resources for the Ethereum network by offloading transactions. Transactions are processed off-chain, and only the final state of the nodes is recorded on the blockchain.
This tool operates on the premise that since only the participants that are involved in the transaction should know the details, it is not necessary to record every single transaction in the blockchain. Transactions can continue, and only when the channel is closed will the final state of the nodes be broadcasted and recorded as a single on-chain transaction.
Channels serve as an effective tool for scaling and can process thousands of transactions in a second. However, they come with a few downsides— they don’t offer open participation. Users have to be known upfront, and they are required to deposit their funds in a multisig contract (similar to how Lightning Network’s users are required to deposit bitcoin into the system’s payment channel). On top of it, state channels are application-specific and cannot be used to scale general-purpose smart contracts.
Sidechains are independent, Ethereum-compatible blockchains with their own block parameters and consensus model. Transactions are moved into sidechains in a custodial manner since the sidechains can handle higher transaction speeds and more powerful customized smart contracts. To enable workability, networks create a two-way peg between the main chain and the sidechain hence dividing the workload between both chains.
However, there are security concerns for sidechains because they have less computing power to maintain consensus as compared to the main blockchain. And this opens up the possibility for an attack on the sidechain by miners on the blockchains.
Rollups are similar to advanced, non-custodial sidechains and can extend the main Ethereum network’s throughput capabilities. It provides scaling by rolling up sidechain transactions into a cryptographic proof, known as SNARK (succinct non-interactive argument of knowledge). This proof is submitted to the base layer. T
All transactions in rollups are executed in the sidechain, while the main chain stores the transaction data as a ZK proof. Rollups are of two types, which include:
- ZK Rollups: With ZK rollups, the ZK proof (Zero-Knowledge Proof) is a method by which an entity can prove to another entity that they have knowledge of particular information without revealing the information itself.
- Optimistic Rollups: Optimistic rollups use an EVM-compatible virtual machine called Optimistic Virtual Machine (OVM) to execute smart contracts that can be executed on Ethereum.
Although more efficient and faster, ZK Rollups do not make it easy for existing smart contracts to migrate to L2. Optimistic Rollup does, and this is important to ensure that existing smart contracts maintain their composability.
Other layer 2 scaling solutions such as Plasma also exist. Plasma is likened to the other layer 2 solutions, whereas it has subtle differences in its mode of operation.
What Does Layer 2 Scaling Mean For Blockchain
The L2 scaling solution has proved very efficient for blockchain, and this means that blockchain technology can be used for other industries with the need for high data processing. It scales decentralized networks to the point where they can compete with centralized, established systems like Visa.
Technologies like the layer 2 scaling solution open the door to emerging businesses who want to leverage the blockchain network to create value. This contributes to the overall blockchain mainstream acceptance as contemporary business industries like e-commerce and fintech can integrate the blockchain technology into their business models and bank on the attributes of decentralization, scalability, and security it promises.
Conclusively, it’s safe to say that blockchain development is still in its initial stage, and the layer 2 scaling solution is one of the approaches to take the technology to its optimum level. Therefore, it is pertinent for industries to embrace this new technology as it promises a new level of digital disruption, and the ever-growing desire for decentralization, security, ease, and privacy is finding answers in the blockchain.