The Main Stack
L0
This is the ground floor layer for all blockchain protocols. While L1 projects allow decentralized applications (dApps) to be built on top of them such as Uniswap and Aave (L3s), L0 projects allow for entire blockchains to be built on top of them.
For example, Binance Smart Chain (BSC) was built using Cosmos SDK, Cosmo’s customizable framework for building blockchains. Not only do L0s allow for blockchains to be built on top of them, but they also allow for cross-chain interoperability between L1 projects. This entails that different blockchains are able to communicate with one another, a feature that is usually missing on L1s.
Allow blockchains to interact with each other
A great example is the aforementioned Cosmos, which creates an ecosystem of interoperable blockchains thanks to its "Tendermint IBC" (Inter-blockchain communication protocol)
This is massive for developers. If a dApp can function on just one blockchain now, they can also be functional on other blockchains as long as they are built using the same L0 ; No need to invest more time and resources to build the same app on another chain.
Faster and cheaper transactions
With IBC, PoS consensus can be achieved across multiple chains resulting in finality times happening almost instantaneously (finality = when a block is approved, can’t be rolled back, and is considered irreversible). The result is faster and cheaper transactions on cross-chain exchanges.
L1
Layer 1s are, to put it simply, the blockchains themselves (Bitcoin, Ethereum, Algorand, Hedera, etc) that process and finalize transactions on their own blockchains ; Source of truth and responsible for the settlement of transactions. This is where stuff like consensus (PoW, PoS) & other technicalities like block time and dispute resolution take place.
All L1 networks typically have a native token that provides access to the network’s resources. The tokens can be used to pay for sending crypto, minting a token or calling a smart contract.
The various consensus mechanisms used to build blockchains generally have trade-offs between Speed (Scalability), Decentralization (Interoperability) and Security also known as the blockchain trilemma effect.
Till today, no single blockchain has been able to nail all 3.
L2
Layer 2 networks extend the functionality of their Layer 1 counterpart. Usually they are created to increase the L1’s performance, reduce transaction costs, or increase programmability. Picture layer 1 as a congested highway, then layer 2 protocols are additional highways plugged into them. Of course, in the digital space, we deal with data bits instead of cars, so they are much easier to handle.
When you hear the terms zero-knowledge rollups (zk rollups), side chains, or anything to do with speeding up transaction throughput, its most likely L2.
For example, on Ethereum, where gas fees can be highly variable and expensive with slow transaction times, it is increasingly common for application developers to provide its user the ability to interact with a layer 2 network, like Polygon, to decrease their user’s fees and transaction latency. More recently, zero-knowledge rollups has been the talk of the town. It is the idea that a side-chain performs transaction ordering and processing and submits mathematical proof that they have processed the transactions fairly.
Some examples are:
Lightning Network (BTC) - Scaling with 2 party multi-signature channels.
Starknet - Scaling with Zero-Knowledge Rollups
Polygon - Commit side chains - Optimistic Rollups (coming soon)
Optimism and Arbitrum (Both are rollup solutions to ETH) - Using fraud-proof (FP), instant finality and allowing for cross chain bridges. They are able to drastically bring down ETH gas fees. (more about them here).
L3
Layer 3 is often referred to as the application layer. It is a layer that hosts DApps and the protocols that enable the apps. While some blockchains such as Ethereum/ Solana/ BSC/ Polygon and more have thriving varieties of layer 3 apps, Bitcoin isn’t optimized to host such applications.
There is a wide array of L3s that a lot of us in the crypto space are familiar with such as the popular Uniswap, MakerDAO and many more.
L3s offer services such as swapping, staking/liquidity pooling (Sushiswap, Pancakeswap, etc), lending/borrowing (Aave etc) and voting/governance platforms and many more. It is an integral part because it combines blockchain technology and Web3 technologies into full fledged products.
New L3 projects can be built upon (or forked from) other L3s (eg Uniswap and Sushiswap)
L3s are continuously evolving and new ones are created like water. Ultimately, how well they are able to support their preceding L1 and L2 infrastructure and values will determine how successful they are. The success can also be seen through number of users and volumes on it.
Conclusion/TLDR
Blockchain platforms may have four distinct layers.
Layer 0 - the connection architecture between various blockchains.
Layer 1 - the actual underlying blockchain with core architecture and functionality.
Layer 2 - protocols built on top of L1s, extending functionality of the underlying blockchain.
Layer 3 - protocols that enable DApps on the blockchain.
~Discussion and something to think about~
There has been a debate on whether BTC needs to move towards enabling the layer 3 functionality. Some industry analysts argue that BTC is worth multiple times more than all these layer 3 apps combined, and therefore, it does not have a pressing need for layer 3 at all.