Preamble
In the second part of the article series "Finding the trends that will drive the crypto market next season, we will study a piece of the puzzle that has been making waves for more than a year, which is Layer 2.
If you haven't seen part 1, please read it again here: Part 1: LSDfi
What you will gain in this article:
Architecture of Blockchain network
Scaling solutions for the Ethereum network
The necessity and potential of layer 2
Outstanding layer 2 projects
Part 2: Layer 2 Wars - The war between extension solutions and between projects within each solution
Theoretically, developers can build Layer 2 on any chain, not just Ethereum, but currently Ethereum is the chain with the strongest level of activity and the most urgent need for expansion, so when considering As for Layer 2, we will default to Layer 2 for Ethereum.
In this article, too, we will learn about scaling solutions for Ethereum.
Layering of Blockchain systems
Before learning about what Layer 2 is and why Layer 2 is needed, let's go over the layers in the blockchain system.
Since the birth of Bitcoin in 2009 and Ethereum in 2015, we still only have the concept of the blockchain infrastructure layer and the layer of dApps built on it. Later, with the explosion of layer 1 blockchain networks, there was a need for communication between blockchains and the need for expansion for each blockchain, so the concepts of Layer 0, Layer 1 and Layer 2 were widely used. cobble.
Currently, the blockchain network, specifically Ethereum, is divided into 3 main layers.
Layer 0: A blockchain network that helps connect and communicate between multiple layer 1 blockchains.
Layer 1: Are independent blockchain networks with their own infrastructure and consensus mechanisms that operate according to their own rules. For example Ethereum, BNBChain, Fantom,…
Layer 2: A network of blockchains built on the foundation of layer 1 blockchains and compatible with layer 1 to expand or serve specific purposes. For example Optimism, Arbitrum, zkSync.
Layer 3: Are blockchains built on top of Layer 2.
The dApp layer can be built on any layer to serve each specific need.
Here I also introduce the infrastructure architecture of the blockchain system so that you can grasp the information for the analysis of the expansion solutions behind it without going into too much depth to avoid complexity.
Infrastructure layer: This is the physical infrastructure layer of the blockchain, responsible for storing and managing data in distributed hardware.
Data layer: This layer defines how data is organized and stored in the blockchain.
Network layer: The network layer manages communication between nodes on the blockchain network. The task of the Network layer is to detect nodes and transmit data between nodes.
Consensus layer: Layer responsible for sequencing and validating transactions and blocks. Ensure consistency and security for the network.
Application layer: Consists of decentralized applications that interact with the blockchain network to serve different needs. This is the layer that interacts directly with users.
Why is Layer 2 needed?
So, after understanding what Layer 1 is and what Layer 2 is, the question is why is the appearance of Layer 2 necessary?
To answer this question, let's first come to the trilemma of blockchain.
One of the most difficult problems for blockchain developers is the impossible trinity:
Decentralization
Security
Extend
If you want the network to have one or two superior capabilities, you must sacrifice the remaining. For example, if you want superior scalability and high security, you must sacrifice decentralization like Solana.
Or if you want a decentralized network that is still secure, you have to sacrifice scalability, this is Ethereum's choice. This choice makes its TPS only fall to about 20 transactions/second. If compared with Solana at 65,000 TPS or Visa international payment system at 24,000 TPS, the gap is very far.
Moving on, what affects the network's scalability? Expanding the network means it can meet the needs of users many times over while still ensuring decentralization, speed and safety for transactions.
As the number of users increases, it means the number of transactions increases, leading to network bandwidth and data volume increasing exponentially. Transactions that want to be executed need to be checked and confirmed from nodes. If the number of nodes for Solana is about 3,000, BNB is about 2,200, then for Ethereum it is 830,000 nodes. Although confirmation from all nodes is not required for approval, you can imagine how cumbersome the network needs to handle the transactions that arise.
The difference between the number of transactions and processing capacity causes network congestion. High transaction costs are also a consequence of this bulkiness, creating a barrier to expanding the number of users.
If you want to move towards mass adoption, the ability to expand to meet the needs of millions or billions of users is inevitable. So how can Ethereum meet this expansion requirement while still maintaining its inherently decentralized and secure nature? Scalable solutions begin to appear from here.
Classification of blockchain scaling solutions
Based on the level of intervention in the original network (Ethereum), we divide expansion solutions into two main types: on-chain and off-chain expansion solutions.
On-chain scaling solution
The problem of network expansion has been recognized by Ethereum programmers and included in the development roadmap from the beginning.
In the roadmap update posted in May 2022 by Vitalik Buterin, he clearly defined the vision of bringing Ethereum to mass adoption through 5 major update stages:
- The Merge: Converting consensus mechanism from Proof-of-work to Proof-of-stake.
- The Surge: Implementing Sharding architecture, a scaling solution that reduces transaction costs on Ethereum. Promising to push transaction speeds on scaling solutions to 100,000 TPS.
- The Scourge: Updates aim to ensure neutrality, fairness, trust of transactions, while also minimizing risks from MEV.
- The Verge: Updates make Nodes authentication faster and simpler through SNARK proofs. Vitalik mentions the following: “Verifying blocks should be extremely easy - download N bytes of data, do a few basic calculations, verify the SNARK and... voila.”
- The Purge: The goal is to simplify the protocol by limiting historical data. Nodes will not need to store historical data older than 1 year, will only need to if required. This allows to increase the speed of synchronization and transaction authentication, reducing barriers to entry.
- The Splurge: Fix what needs to be fixed next.
Intervening in network infrastructure is a very difficult job, the problem comes not only from technology but also from the consensus to upgrade the entire network. Each update impacts not only how it works but also the benefits of each group of members in the network. This work requires time and effort from the entire Ethereum community.
The two updates that have the strongest impact on Ethereum's scalability are The Surge and The Verge, while the development team is actively working, our job is to wait and support.
Off-chain scaling solution
While on-chain expansion solutions bring long-term and stable results but take a lot of time, off-chain expansion solutions produce quick results to meet general development needs from the market. .
Off-chain scaling refers to scaling solutions that do not impact the architecture of the original network. And the direction is to build a system compatible with the original network, then solve part of the external work, and finally update the results back to the original network. Such solutions are called Layer 2 solutions. Up to now , there are five Layer 2 solutions offered.
Rollup
This is probably the most familiar name we have heard for more than a year. The general operating mechanism is that Rollups perform many external transactions, then synthesize the results into individual packages and send them back to the original chain for validation.
There are 2 main types of Rollup with different security methods:
- Optimistic Rollup: Trust that all transactions are valid until proven wrong through a fraud proof. If fraud proof is proven correct, the transaction is reversed.
- Zero-Knowledge Rollup: Transactions must be proven valid before being authenticated, which is done through a validity proof. Once the validity proof is proven correct, the transaction is confirmed and cannot be reversed.
With each type's unique operating mechanism, Rollup solutions can achieve speeds hundreds of times faster than Ethereum while still leveraging the security of the original chain.
Optimistic Rollup
As mentioned, the operating mechanism of Optimistic Rollup is to synthesize many transactions into a batch and then send it to layer 1 for further processing.
The reason for the name "Optimistic - optimism" comes from its operating mechanism. Optimistic Rollup assumes that all transactions that take place off-chain are valid, so it will only send transaction information to the original chain in the form of calldata without evidence. This is the specific difference between Optimistic and ZK Rollup.
To protect the network from fraudulent transactions, Optimistic has a period called challenge time (usually lasting 7 days). During this time, anyone can challenge the results through a Fraud Proof.
- If fraud proof is proven correct, the protocol will re-execute the transaction and update the new status accordingly. Sequencers that make incorrect calculations will incur a penalty for their mistake.
- If at the end of the challenge period the transaction batch is not challenged, it is considered valid and the new status is accepted on the original chain.
To summarize, Optimistic Rollup's transaction processing process is as follows:
Users submit transactions on Layer 2 Optimistic Rollup.
Network operators collect and process transactions internally on Layer 2.
Transaction data is packaged, compressed and sent to Layer 1 for verification.
Waiting for challenge time:
If there is a challenge, the protocol checks to determine the validity of the transaction batch. If fraud is proven, the protocol will re-execute the transactions and update the new status.
If the period ends without a challenge, the transaction batch will be accepted on Layer 1 and cannot be reversed.
Advantages and disadvantages of Optimistic Rollup
Outstanding Optimistic Rollup projects
Optimism
Decision
Base
Mantle Network
Debank Chain
opBNB
Optimism and Arbitrum are two projects that have consumed a lot of ink in the crypto community. While the civil war between projects under the ZK-Rollup solution seems peaceful, the Optimistic Rollup front line is more fierce than ever.
Optimism has its advantage thanks to launching tokens early with many incentive programs to promote the ecosystem. Arbitrum also proved not to be inferior with its heavy airdrop spending to attract users and has also achieved proud achievements.
Optimism's long-term orientation is to become a Superchain that connects all Layer 2 built on OP Stack. For Arbitrum, it is a Layer 3 network vision through the Arbitrum Orbit toolkit. Unlike OP Stack where developers can freely build OP Chain (permissionless), if Layer-2s want to be deployed, they must be approved by Arbitrum DAO (Orbit Chains can be deployed arbitrarily).
With its open mechanism and flexibility, OP Stack is gaining the support of many industry giants such as opBNB (Binance), Base (Coinbase), Magi (a16z).
At the present time, Arbitrum's TVL is still leading with 6.14 billion USD, followed by Optimism with 2.77 billion USD, quite far behind the rest.
While the two tigers fight, a new rookie is slowly building his power, Base. We have heard a lot of analysis about Optimism, Arbitrum, so what about Base. Base, backed by Coinbase, is the largest crypto exchange in the US with more than 150 million customers, 2021 revenue reaching 7.83 billion USD.
Currently, Optimism and Arbitrum have launched tokens, have been hyped and are starting the process of creating use cases and preventing inflation for their tokens, but Base still retains the advantage of not having issued tokens.
Token is one of the powerful weapons of any ecosystem, it helps bootstrap the ecosystem, attract users and cash flow, and create incentive programs for projects. Base's next big advantage is that they have a customer base at web2 just waiting to be pulled up to web3 for use.
We are envisioning a similar story to Binance and BNB Chain. At Base, there are customers, reputation, and abundant resources. In my personal opinion, Base will be a very potential Layer 2 worth paying attention to. Base's only barrier is legality in the US.
Zero-Knowledge Rollup
It is also an extension solution belonging to the Rollup branch, which means synthesizing many transactions on Layer 2 for processing and then sending the results to Layer 1 for authentication. The difference comes from its mechanism of action.
ZK Rollup uses Validity Proof created by Zero-Knowledge technology to authenticate transaction packets without revealing much information, thereby enhancing the security and privacy of transactions on the network.
ZK Rollup's transaction processing process
Users send transactions on the Layer 2 ZK-rollup network.
Network operators collect and process transactions internally on Layer 2.
Create validity proof for transaction batches.
Send proof with a little summary information to layer 1 for authentication.
Verifier Contract on Layer 1 will verify the validity proof.
If the validity proof is accepted, the transaction batch is approved, the new state of the ZK-rollup network is updated and cannot be changed.
If the validity proof is not accepted, network operators must calculate and resubmit new data.
The unique point that creates ZK-Rollup's brand is the use of zero-knowledge proof - Zero-Knowledge to prove the correctness of a batch of transactions without needing to reveal the details of each transaction in the batch.
To better understand this magic, let's look at an interesting example of Zero-Knowledge Proof as follows:
There are two identical paintings of Mona Lisa, one is real, the other was painted by a thief and he marked the fake in a place no one knows.
The requirement for the art appraiser who is being controlled by the thief is how to tell him which painting is real but must not reveal the distinguishing characteristics, because when revealed, the thief will repair the fake painting. Next time it won't be possible to tell the difference.
The solution to this situation is a clear example of the application of Zero-Knowledge. The art appraiser asked the thief to place two paintings side by side and would point out which one was real without telling the thief why it was the real painting. Next, the appraiser covered his eyes and asked the thief to reverse the positions of two random paintings many times, then the appraiser continued to point out which painting was real. Repeat the job over and over until the thief is satisfied. Thus, the appraiser successfully showed the true picture but did not reveal any features.
Surely by now you have understood the power of Zero-Knowledge. Of course, in practice, authenticating transactions on the blockchain is not as simple as the example, they are many times more complicated. In rollup applications, four types of evidence (ZKP) are used:
SNARK (Succinct Non-Interactive Argument of Knowledge): is a short type of ZKP that is non-interactive, meaning there is no interaction between the prover and verifier (the prover and verifier only have to exchange one proof ). For SNARK, it is necessary to have an initial set of information for both sides.
STARK (Scalable Transparent ARguments of Knowledge): is a type of ZKP that is non-interactive but designed to be extensible. Unlike SNARK, STARK does not require initial information to be set up, but the overall size of STARK is many times larger.
Bulletproofs (DARK - Distributed Aggregated Range Proofs): is a type of ZKP specifically designed to prove that a number is within a specific range (range proof). They focus on conciseness and the ability to demonstrate multiple values in a single transaction, helping to reduce the length and weight of certificates. For example, demonstrate the amount of money in a transaction without revealing the specific amount.
PLONK (Permutation, Linear, and Omitted variable over NIZK): is a type of ZKP designed to be compatible with permutations, linear functions, and omitted variables. . They focus on integrating these elements into the proof process.
Above is a chart comparing types of evidence introduced by Vitalik Buterin, you can refer to it for more information, I will not go into this part further to avoid trouble.
Advantages and disadvantages of ZK-Rollup
Featured ZK-Rollup projects
zkSync
Line
StarkNet
Validity
Validium is a new extension solution belonging to the Rollup branch and has many similarities with ZK-Rollup, also known as "ZK Rollup but with off-chain data", the difference of Validium is that it accepts Generate more security to increase scalability.
Also uses validity proof created by Zero-Knowledge technique sent to Layer 1 to authenticate transaction packets, but Validium does not include transaction data in calldata like ZK-Rollup but only stores it. off-chain.
This reduces the size and cost of processing on the root chain, thereby increasing transaction speed. Validium's TPS can be up to 9,000, 4 times higher when compared to ZK-Rollup.
The downside is similar to data unavailability, off-chain transaction storage causes data availability risks when operators intentionally hide information, at which point users will have difficulty identifying actual transaction or worse, not being able to withdraw money. Using Validium requires placing a lot of trust in the network operators.
Validium's transaction processing process
The transaction processing process on Validum is similar to ZK-Rollup.
Users send transactions on the Layer 2 ZK-rollup network
Network operators collect and process transactions internally on Layer 2
Create validity proof for transaction batches.
Send evidence to Layer 1 for authentication.
Verifier Contract on Layer 1 will verify the validity proof.
If the validity proof is accepted, the transaction batch is approved, the new state of the ZK-rollup network is updated and cannot be changed.
If the validity proof is not accepted, network operators must calculate and resubmit new data.
Advantages and disadvantages of Validium
Volition combined solution
In order to increase flexibility for users, the development team has introduced a solution combining Validium and ZK-Rollup called Volition.
It allows users to choose to switch back and forth between the two solutions. With Volition, users can use Validium's off-chain data availability for specific transactions to optimize transaction speed. When necessary, they still have the right to switch to using on-chain data like ZK-Rollup. This gives users the freedom to choose trade-offs according to their own characteristics.
Outstanding Validium projects
StrongEx
Immutable X
zkPorter
Currently, both Optimistic Rollup and ZK-Rollup have their own place, but it seems that the father of Ethereum, Vitalik, supports ZK-Rollup more openly. The Verge update in Ethereum's roadmap also mentions the use of SNARKs (a type of Zero-Knowledge proof) to help Nodes authenticate native network transactions.
Below is a table comparing the characteristics of the three solutions.
With extreme EVM compatibility reaching the same level, Optimistic Rollup allows developers to deploy projects at lightning speed. Very little code editing is required for dApps running on Ethereum to run on Optimistic Rollups.
For this reason, the Optimistic ecosystem is growing very quickly and is also a familiar choice for many big players in the crypto market.
My personal opinion on these types of Rollups is that they will exist and develop in parallel, without one destroying the other. But in the long term, ZK-Rollup has a lot of potential to become the main scaling solution on Ethereum. The Validium branch will be suitable for projects that require high scalability and accept security trust in Validators such as games.
Plasma
Plasma was first introduced by Vitalik Buterin and Joseph Poon in August 2017. Plasma was designed to solve Ethereum's scaling problem by creating a system of child chains connected to the parent chain to handle transactions. pandemic.
These child chains are managed by a smart contract on the parent chain and connect the state to the parent chain through a Merkle tree, they act as a mini copy of the Ethereum root network.
Plasma's connection with the original chain lies in the fact that the information on the child chain is encoded according to the Merkle tree and sent to public storage in the original chain. This helps it inherit part of the security from the original chain to ensure data integrity and data availability to handle disputes when they arise. Just like Optimistic Rollup, Plasma uses fraud proof - proof of fraud to resolve disputes.
But there is a huge flaw of the Plasma solution which is data unavailability. The system does not send all transaction information to the original chain for storage, but only sends the encrypted state, which makes it difficult to create fraud proof if Plasma Operators (Plasma network operators) Does not provide complete information. Participating in the plasma chain requires users to place a lot of trust in the operators. It can be seen that Plasma has accepted to sacrifice security in return for strong expansion.
Advantages and disadvantages of Plasma
Outstanding Plasma projects:
OMG Network
Polygon
Glue
At present, Plasma is considered quite old and out of breath in the expansion race on Ethereum.
State Channel
State Channel is more familiar on the Bitcoin network for the Lightning Network project that El Salvador is currently using for their payment system.
The State Channel solution allows participants to open a channel and perform multiple off-chain transactions. When transactions are completed and participants agree to close the channel, the final result will be pushed down to the original chain for storage.
There are two main types of channels:
- Payment Channel: Serves for the purpose of clearing balances of channel participants.
- State Channel: Extended version of Payment Channel, in addition to performing balance clearing, State Channel also allows processing more complex logic beyond balance like Payment Channel.
This method has the advantage of fast speed and low cost, but is limited in scalability because it will be difficult when the number of members in the channel is large.
State Channel's transaction processing process
- Open channel: Two (or more) participating parties deposit money into a smart contract to open the channel.
- Channel usage: Channel participants perform exchange transactions with each other (off-chain)
- Closing the channel: When the parties reach a final agreement, they can agree to send the results to the chain (on-chain) by signing the confirmation. The protocol will check the validity of the state, ensuring that it has been signed by all parties. In the end, the protocol will distribute the initial locked assets according to the agreed results among the channel members.
- Dispute handling: If one party disagrees with the final state of the channel, or if there is another dispute, they can submit an on-chain request to accept what they believe is the correct state. The original protocol will consider this request and implement a dispute resolution process.
Advantages and disadvantages of State Channel
Outstanding projects:
Lightning Network
Connext
Sidechain
In essence, sidechain is not considered a true Layer-2 or scaling solution. Since it is a separate blockchain, it has its own consensus mechanism that runs independently of the original layer. In particular, it does not store any data or send any authentication requests to the root layer, so it inherits almost no security.
What makes it considered an extensible solution is that it is designed to be compatible with the original layer and allow assets to move back and forth between the two chains.
More specifically, sidechain extension solutions are designed so that applications on the root layer can easily run on the sidechain without needing to edit the source code too much. In addition, they also build bridges to help assets move back and forth between the two chains.
Sidechain advantages and disadvantages
General comparison table
In this final part, I will try to explain and summarize so you can easily distinguish each extension solution.
- OP Rollup: Synthesize multiple transactions sent to layer 1 and wait, if no one objects then authenticate.
- ZK Rollup: Synthesize multiple transactions with zk proof sent to layer 1 for immediate authentication.
- Validium: Similar to ZK-Rollup but transaction data is stored off-chain
- Plasma: Create many child chains to process transactions, save state proofs in the main chain.
- State Channel: Open a private channel for multiple entities to perform multiple off-chain transactions and then update the final results down to the original chain.
- SideChain: The chain operates independently of the parent chain, the relevance is design compatibility and support for bridging assets from the parent chain to use.
Potential of Layer 2
To assess the potential of the Layer-2 segment for the cryptocurrency market, let's first reassess where we are in its development history.
15 years ago Bitcoin was born with the mission of becoming a new monetary standard. The operations are simply sending and receiving back and forth, operating well at a speed of 10 transactions/second. Five years later, the first smart contract platform, Ethereum, was introduced, allowing developers to implement complex logic, opening the door to decentralized finance. Ethereum's TPS is at 20 transactions/second.
Throughout the 10-year history of DeFi's development, the number of participants has increased from 0 to 425 million people, but the transaction speed of the largest DeFi ecosystem, Ethereum, still stops at 20 TPS.
GameFi season 2021 is the final straw that shows that expanding the network is absolutely necessary if we want DeFi and the crypto market in particular to continue to grow.
Of course, this was recognized early on by the Ethereum development team and the crypto community. Many blockchains with the nickname Ethereum Killer have been born, but until now, no solution has been truly successful. It comes from the Trilemma, sacrificing decentralization for scalability is a violation of the main core value of Decentralized Finance.
And Layer-2 is considered the perfect solution to this problem. Take advantage of the decentralization and security of the Ethereum native network and depending on each use case, developers choose to use the appropriate solution. In addition, Layer-2s also take advantage of a large number of users from the original Ethereum Layer, easily enticing them to use Layer-2 rather than a new blockchain.
As mentioned before, the scaling issue was soon recognized by the Ethereum development team and included in the development roadmap. Not only that, in the recent roadmap update, the Ethereum development team also updated support to help Layer-2 work better. Vitalik Buterin - the father of Ethereum mentioned that The Surge will bring the speed of Layer-2 up to 100,000 TPS.
The third argument proving that Layer 2 will become a big trend in the future is the support of major players in the cryptocurrency market.
We have seen the participation in the Layer-2 war of Binance, Coinbase, Consensys, a16z. Not only that, many Layer 1 projects, after many years of struggling, also decided to transform themselves into Layer 2 such as Celo and Canto.
Thus, the development of Layer-2 is in line with the general development of the entire industry. Not only does it meet urgent needs, it also receives support from many large entities in the cryptocurrency space.
Layer 2 will likely create the next historical milestone for crypto in the near future similar to how Layer 1 did during the last growth season.
Regarding investment opportunities, I do not have financial advice for you, please do your own research and make your own decisions. However, you may want to pay attention to the valuation of projects to determine profit expectations. Unlike the previous cycle, Layer 1 projects with strong growth all have very small capitalization levels, and currently, despite the expansion of the entire market, most Layer 2 projects are being highly valued.
In addition, don't forget to retroactivate Layer 2s that have not issued tokens yet, such as Base, Linea.
Conclude
There is a very good rule in the book “22 Immutable Laws of Marketing” by authors Al Ries and Jack Trout, which is the law of parallelism.
It is defined like this:
In the beginning, any new industry is a multi-step ladder. Gradually, this ladder becomes just a competition between the top two rungs.
“Eventually, every market becomes a two-horse race.”
This is true in most markets, for example in the beverage industry we have the dual codes Coca-Cola and Pepsi, in the phone industry we have Apple and Samsung.
As for Rollup, we are currently seeing the expression of the two codes Optimistic and ZK. In Optimistic, we have two codes: Optimism and Arbitrum, and in ZK, we have zkSync and Linea.
The battle is not over yet, let's follow the market closely to find the leading horse in the upcoming growth cycle.
I have put a lot of effort into this series of articles, so if the article is valuable, please help me press Like and Share to spread it to everyone.