Layer 2 refers to the network built on the blockchain (Bitcoin, Ethereum, etc.) A collection of scaling solutions on top of that.
The main goal of the second-layer network is to solve the scalability problem in the "blockchain impossible triangle". To be more precise, it is to increase the transaction speed (TPS, Transactions Per Second) of the blockchain. In the impossible triangle theory of blockchain, a decentralized network can only provide two of the three benefits at any time, namely decentralization, security and scalability.
For more information about the impossible triangle of blockchain, please refer to the entry: What is the impossible triangle of blockchain?
Mainstream blockchains such as Bitcoin and Ethereum often sacrifice scalability to build a secure, decentralized blockchain. For example, the average TPS for Bitcoin and Ethereum is only 5 and 15 respectively. As demand surges to use Layer 1 networks, networks become more congested and expensive. That's why today's second-tier networks are extending the first-tier networks.
The second-tier network takes over a considerable amount of transaction burden from the first-tier network, thus making the first-tier network less efficient. So crowded and more scalable. It is worth noting that since layer 2 solutions communicate with the layer 1 network regularly by submitting packaged transactions, they can still have the security of the layer 1 network.
One of the most famous examples of second-layer networks is Bitcoin’s Lighting Network, which is built on Bitcoin Layer 2 network solutions on the Internet. But the second-layer network solutions that are currently widely discussed are mainly in the Ethereum ecosystem. Ethereum's second-layer network solutions have evolved from the initial "state channel" and Plasma to more advanced Optimistic rollup (Optimism, Arbitrum) and Zero-knowledge rollup (zkSync, StarkWare).
As of March 2023, there are already many well-known projects on the market Layer 2 projects such as Arbitrum, Stacks, Immutable X, Optimism, etc. You can view more projects through TokenInsight's Tag.