A secondary framework or protocol created on top of an existing blockchain system is referred to as Layer 2. The primary purpose of these protocols is to address the major cryptocurrency networks' transaction speed and scale problems. Bitcoin and Ethereum, for example, are still unable to perform thousands of transactions per second (TPS), which will obstruct their long-term growth. Higher throughput is required before these networks can be effectively adopted and used on a larger scale. The phrase "layer 2" refers to the various solutions being proposed to the blockchain scalability challenge in this context. The Bitcoin Lightning Network and Ethereum Plasma are two key examples of layer 2 solutions.
Despite their differences in functioning principles and features, both solutions aim to boost the throughput of blockchain networks. The Lightning Network is built on state channels, which are connected channels that perform blockchain activities and report them to the main chain. State routes are primarily used for payment. The Plasma framework, on the other hand, is made up of sidechains, which are miniature blockchains grouped in a tree-like form.
Layer 2 protocols, in a broader sense, establish a secondary framework in which blockchain transactions and operations can take place independently of layer 1 protocols (main chain). As a result, these strategies are often known as "off-chain" scaling solutions.
Because the second layer is added as an extra layer, there is no requirement for the main chain to undergo any structural changes when applying off-chain solutions. Layer 2 solutions, as a result, have the ability to provide high throughput without compromising network security.
In other words, most of the work that would normally be done by the main chain can be transferred to the second layer. While the main chain (layer 1) provides security, the second layer enables fast throughput, allowing hundreds, if not thousands, of transactions to be completed each second.
