blockchains are like onions, they all have layers. Onions have layers. Blockchain also has levels.
Let us strip the blockchain layer one by one at a time!
What is the layer 1 blockchain?
Layer 1 is the basic blockchain; it can use its own network to verify and complete transactions. Examples of Tier 1 blockchain projects are Bitcoin, Ethereum, and Cardano.
Layer 1 blockchain network has its own native token, also known as coins, used to pay for transaction fees .
uses layer 1 to extend
Layer 1 network has expansion problems. When the blockchain struggles to process the number of transactions required by the network, transaction fees increase.
When solving the extension problem, you will encounter Blockchain tribulations , a term coined by Vitalik Buterin. This is where you try to balance decentralization, security, and scalability. All extension solutions will try to balance the three.
You can also fund some supernodes (by purchasing supercomputers, large servers, etc.) to protect and expand your network. But this will centralize your blockchain.
There are three main methods to improve layer 1 scalability: block size , change consensus mechanism and shard .
Increase block size
If the Layer 1 network is difficult to handle the required number of transactions, you can increase the block size. This will allow more transactions to be processed in each block.
However, this is just so far. Since block data needs to be downloaded, larger block sizes will eventually slow down transaction speed. That's why you can't simply create an infinitely large block. Super large blocks will also reduce decentralization.
Consensus mechanism Change
Some consensus mechanisms are not as scalable as other mechanisms.
For example, the sustainability and scalability of the proof of work consensus mechanism is not as sustainable and scalable as proof of stake. That's why Ethereum is slowly transitioning from the former to the latter.
We have introduced the consensus mechanism in more detail in here [1].
shard
In short, shard is to split a set of data into smaller and easier to manage shard . This is an easy way to help spread the load. Think about eating a cake, once it is sliced and distributed to others, it will be easier to eat.
shard increases transaction output by dividing the network into different shards. Due to the way the network is divided, each shard does not contain all the information from the blockchain. After the node completes the sharding, it will be broadcast to the blockchain and then verified on the blockchain.
This helps to disperse the workload and thus improve transaction speed.
What is layer 2?
The layer 2 protocol is built on the layer 1 blockchain to solve the scalability problem of layer 1.
This is done by creating a secondary framework that does not require a layer 1 chain—also known as "off-chain".
Two things that can be improved on layer 2 are transaction speed (how long does a transaction take) and transaction throughput (how many transactions can the network handle in a defined time period).
When the Layer 1 network becomes congested, Layer 2 can make up for the shortcomings to shorten transaction time and reduce transaction fees.
How does it work?
Layer 2 has several ways to solve the scalability problem of layer 1.
channel
channel is a layer 2 solution that allows users to make multiple transactions off-chain before reporting to the grassroots.
There are two types of channels:status channeland payment channel . Payment channels are simple; they allow off-chain payments to be processed. State channels, on the other hand, are a bit broad; they allow any interactions that may occur on the blockchain to occur off-chain (e.g., smart contracts). One problem with this solution is that the network must understand the user, which means open participation is not an option. These users must also lock their tokens in the multisig contract.
Plasma
Plasma was created by Joseph Poon and Vitalik Buterin, and created a "sub-chain" using smart contracts and a numerical tree, which is a copy of the original blockchain (also known as "parent chain").
This framework pushes transactions from the original chain to the child chain to increase transaction speed and reduce transaction fees.
However, Plasma body solutions cannot be used to help extend general smart contracts. In addition, users have to wait for a while to withdraw money from the second floor.
side chain
side chain has its own independent blockchain, using its own consensus mechanism and block requirements. They can connect to layer 1 using the same virtual machine. This means that all contracts and transactions that can be used on tier 1 can also be used on the sidechain.
Rollups
rollup solution combines sidechain transactions together (or aggregates) into a single transaction to generate an encrypted proof called SNARK (a concise non-interactive knowledge parameter). Once the SNARK is generated, it will be broadcast to the grassroots.
There are two types of rollups: ZK rollups and optimistic rollups.
optimistic rollups Use virtual machines to easily migrate from layer 1 to layer 2.
ZK rollups are faster and more efficient, but don't use virtual machines as it makes moving between layers more difficult.
What is the layer 0 protocol?
Layer 0 protocol allows cross-chain interoperability between layer 1 projects. This is a major problem in Layer 1; once you get into the ecosystem, it is difficult to move to another ecosystem – Layer 0 solves this problem.
Not all blockchains built on the same layer 0 will have the same design. They can use different consensus mechanisms, block parameters, etc.
Usually, the layer 0 token acts as an anti-spam filter that requires you to bet on the layer 0 tokens to access its ecosystem.
Layer 0 Example
Cosmos[2] is the most famous example of the layer 0 protocol.
They provide open source tools such as Tendermint[3], Cosmos SDK[4] and IBC[5] to help developers easily create their own blockchains that can communicate with each other. Their goal is to create a "blockchain internet". Projects such as
Binance[6], Crypto.com[7], and Polygon[8] were created using Cosmos. Does the
layer 3 exist?
Yes!
Layer 3 is a protocol that supports blockchain-based applications (such as dApps, games, storage, etc.). Layer 3 is often referred to as the "application layer".
"Application Layer" provides information for layer 1 for processing (such as smart contracts). Without an application, the layer 1 protocol will be quite boring. Layer 3 gives basic blockchain functionality, not just transactions.
Most layer 1 blockchains allow you to easily build layer 3 projects directly onto their network, but Bitcoin can’t do that. Some bitcoin forks are trying to bring dApps to the network, but we haven't seen real layer 3 projects on the underlying bitcoin network yet.
Bitcoin may have missed because blockchains such as Ethereum, Solana and Cardano have a booming Layer 3 ecosystem that enrich their blockchains.
Usually, these projects have cross-chain capabilities, such as Uniswap, which allows users to trade assets across different blockchains.
It is worth noting that each blockchain uses a different programming language. This means that the layer 3 application that provides cross-chain functionality must be multilingual. For example, convert from Ethereum's Solidity to Cardano's Haskell.
Layer 3 provides layers below real-world applications that are only outside transactions. Now you can create NFT, swap tokens, play games, and more. The application layer unlocks the full potential of blockchain. Does the
layer 4 exist?
does not exist. The layer we are discussing is often called the four layers of blockchain, but that's because we count from 0 in the programming world.
Conclusion
Blockchain has many levels, and they are all very important. Let's quickly review them:
- • Layer 1: Basic blockchain network. They validate and complete transactions, but have problems with scaling (e.g. Bitcoin).
- • Layer 2: Scaling solution for the layer 1 protocol. It creates a secondary framework for "off-chain" transactions (such as the Bitcoin Lightning Network).
- • Layer 3 : Enable blockchain-based dApps, games, etc. Also known as the application layer (such as Uniswap).
- • Layer 0: Enable cross-chain interoperability between layer 1 protocols (such as the universe).
reference link
[1] Here: https://web3.hashnode.com/cryptocurrency-consensus-mechanisms-explained
[2] Cosmos: https://cosmos.network/
[3] Tendermint: https://tendermint.com/
[4] Cosmos SDK: https://v1.cosmos.network/sdk
[5] IBC: https://ibcprotocol.org/
[6] Binance: https://www.binance.com/en
[7] Crypto.com: https://crypto.com/
[8] Polygon: https://polygon.technology/