An article summarizing the basic knowledge system V1.5 of Bitcoin Layer 2 construction

Original author: Fu Shaoqing, SatoshiLab, All Things Island BTC Studio

V1.5 version modification notes:

(1) "A Basic Knowledge System for the Construction of Bitcoin Layer 2 (Layer 2) V1.0" was published in February 2024. After writing the article "Observing Bitcoin Layer 2 from the Perspective of a State Machine Can Get More Thoughts and Conclusions" in March, we came up with a summary of the characteristics of some different layers. It will be easier to read if they are summarized into the basic knowledge system, so we released the V1.5 version.

(2) Modified the textual expressions of some details, such as the connection technology between the first and second layers.

(3) Because there are often disputes, the three concepts of Centralized, Decentralized, and Distributed in Section 2.4 are explained in more detail.

(4) The second picture in Section 2.4 has been improved and modified to make the contrast clearer.

(5) Added Section 2.5, which summarizes the basic characteristics of blockchain and the features of three Layer 2 constructions, making it easier to understand if multiple combined structures are used.

The rise of Bitcoin inscriptions has brought new vitality to the Bitcoin ecosystem, allowing more people to start paying attention to Bitcoin again. Some people also say that it has opened the Pandora's box of the Bitcoin ecosystem. Among the many technological developments in the Bitcoin ecosystem, the construction of the second layer of Bitcoin is the top priority. In this regard, I have summarized an article on the basic knowledge of the second layer of Bitcoin by drawing on some well-known articles on the Internet, exchanges with many friends, and the experience of our team in the design and development of Web3 products. This method is easy to summarize and learn, and because of the limitations of individual cognition, I hope to throw out a brick to attract jade, attract more people to improve related ideas, and allow this field to develop better.

**The world of blockchain started with Bitcoin and ended with Bitcoin ecology. **(A summary by Mr. Dashan of Waterdrop Capital, I personally agree with it.) Ethereum is also a sidechain technology exploration of Bitcoin. In this article, we will use "second-layer construction" or "second-layer network construction" in a mixed way. Usually, the term "second-layer network construction" is relatively narrow, and second-layer construction is a broader concept. However, in order to adapt to the common descriptions of the first-layer network and second-layer network commonly discussed in the industry, we will also use the concept of "second-layer network construction". These two terms are the same concept in this article.

1. Common Layer 2 Missions

In order to understand the basic problems that need to be solved in the construction of Bitcoin's second layer, we first start by understanding the basic characteristics of the blockchain system.

1.1. Basic characteristics and basic requirements of blockchain

This article uses a concept proposed by Vitalik: blockchain is a "world computer". It will be clearer for us to understand the various characteristics of blockchain from this perspective. In the following chapters, we will also analyze the possibility of the development of this "world computer" based on the von Neumann structure in the computer.

Let’s first summarize some basic features:

Notes:

The demand generated in order to maintain the normal operation of the "world computer" of the blockchain is called internal demand;

*The needs of users who use this "world computer" are called external needs. *

Open and transparent: This is the data storage and instruction execution characteristics of the "world computer" of the blockchain. It is also an internal requirement that requires many distributed nodes around the world to participate in calculations. This feature just satisfies the user's right to know the data, and is the result of the internal collaboration requirements of the "world computer" itself and the external needs of the user. The privacy features mentioned later are to meet the external needs of users without destroying the collaboration requirements of the "world computer" itself. Decentralization: This feature is an architectural feature of this "world computer". The degree of decentralization and fault tolerance are theoretically determined by the Byzantine Generals Theory (the possibility of dishonesty among collaborators, that is, failure to comply with the agreement) situation) is supported. Non-Byzantine general systems are not blockchain systems in theory. We will see two situations of non-blockchain systems in second-layer construction later. The degree of decentralization is an important indicator of blockchain security and is the basis for certain features.

Security: Security is a combination of internal requirements generated by the architectural characteristics of this "world computer" and external requirements required by users. From a micro level, security is guaranteed by cryptography-related technologies, and from a macro level, it is guaranteed by the decentralization of the architecture, so that the security of this "world computer" will not be affected by the forgery of micro data or the destruction of the macro architecture.

Computing power: One of the main functions of the world computer, blockchain, is computing power. To measure this indicator, we generally use it to examine whether it is Turing complete. In order to maintain their main characteristics, some chains are deliberately designed to be Turing incomplete. For example, in the Bitcoin network, Satoshi Nakamoto not only made its code instructions not Turing-complete, but also deliberately deleted some instruction sets during development to maintain its stability and security. All Turing complete technologies are designed to expand the computing power of the blockchain. From the perspective of layered design, simple systems are more suitable for the bottom layer.

Performance: Under the same computing power, performance is another major capability of blockchain as a world computer. It is generally measured by TPS, which is the number of transactions processed per second.

Storage: Blockchain is described as a "world computer", so it must have a storage function, which is the ability to record data. Currently, it is basically stored in the block, and more professional on-chain storage outside the block is still under development.

Privacy: Privacy is a sub-requirement in the “world computer”, which requires maintaining the authority of data producers and users during computing and storage (we also put anti-censorship in the privacy part). This is basically driven by the external needs of users.

There is also a comprehensive indicator called scalability, which generally refers to the scalability of the entire architecture. This feature affects most basic features. At the architectural level, system scalability is a very important indicator. There are also some other connection capabilities or other capabilities for specific scenarios. I will not discuss them here in detail. When encountering these special scenarios, we will analyze them in detail.

Among the basic characteristics of these blockchains, most of them are restricted by impossible triangles. For example, the DSS conjectures are decentralization (Decentralization, D), security (Security, S) and scalability (Scalability, S). As shown below:

An article sorting out the basic knowledge system of Bitcoin Layer2 construction V1.5

In distributed systems, a similar impossible triangle is the CAP principle. CAP refers to the fact that Consistency, Availability, and Partition tolerance cannot be achieved simultaneously in a distributed system. The blockchain system is a distributed system with Byzantine Generals Problem, so it also applies to the CAP principle.

The CAP principle is shown in the figure below:

An article sorting out the basic knowledge system of Bitcoin Layer2 construction V1.5

1.2. The role of the second floor construction

What roles are to be fulfilled in the second floor construction? What functions are provided? The second-floor construction must expand the deficiencies of the first-floor system. Things that are not suitable to be completed on the first-floor system can be completed on the second-floor construction.

We can draw a preliminary conclusion from the characteristics of blockchain summarized above, which is to expand these basic capabilities: openness and transparency, decentralization, security, computing power, performance (throughput), storage, privacy, etc. In addition to these basic capabilities from a technical perspective, there is another very important economic issue that needs to be solved, which is to reduce costs. Usually, the comprehensive cost of executing transactions on the first-layer network is relatively high, and the second-layer network needs to be used to reduce these costs.

To sum it up, the solutions for increasing capacity, reducing costs, and customizing features are all built on the second layer. Customized features are not yet obvious enough, or are often hidden in the first two features, which is a bit confusing. We can understand it this way: the features of the first layer network are required to different degrees for many applications, and the degree of implementation of various features can be readjusted on the second layer for certain applications.

In the second-layer construction, the basic capabilities of the blockchain will have trade-offs, and some features will be reduced or even discarded in exchange for significant improvements in certain features. For example: in order to improve performance, some second layers will reduce the degree of decentralization and reduce security; in order to increase throughput, some second layers, such as the Lightning Network, will change the system structure and settlement method. There are also some that enhance certain features without reducing the basic features, such as the RGB processing method, which obviously increases privacy and censorship resistance, but increases the difficulty of technical implementation. In later cases, we will see two-story construction that simultaneously reduces or alters several properties.

Among them, cost reduction should be a basic need for all second-story construction. (Are there any second floors that don’t reduce costs? I haven’t seen one yet.)

1.3. Why do we need layered design?

Hierarchical design is a means and methodology for humans to deal with complex systems. It divides the system into multiple hierarchical structures and defines the relationships and functions between layers to achieve modularity, maintainability and scalability of the system, thereby improving the design efficiency and reliability of the system.

For a broad and large protocol system, using layers will have obvious benefits. This makes it easier for people to understand, easier to implement by division of labor, and easier to improve by modules. For example, the seven-layer model design of ISO/OSI in computer networks, but in specific implementations, some layers can be merged. For example, the specific network protocol TCP/IP is a four-layer protocol. As shown in the following figure:

An article sorting out the basic knowledge system of Bitcoin Layer2 construction V1.5

Specifically, the advantages of protocol layering:

  1. **Each level is independent. **A certain layer does not need to know how the layer below it is implemented, but only needs to know the services provided by the layer through the interface between layers. In this way, the complexity of the entire problem is reduced. In other words, how the work of the upper layer is performed does not affect the work of the next layer. In this way, as long as the interface remains unchanged when designing the work of each layer, we can adjust the working methods within the layer at will.
  2. **Good flexibility. **When any layer changes, as long as the interface relationship between layers remains unchanged, the layers above or below this layer will not be affected. When there is a technological innovation in a certain layer or a problem occurs in the work of a certain layer, it will not affect the work of other layers. When troubleshooting, only the problems of this layer alone need to be considered.
  3. **The structure can be divided. **Each layer can be implemented with the most appropriate technology. The development of technology is often asymmetric. The hierarchical division effectively avoids the barrel effect and will not affect the overall work efficiency due to the imperfection of one aspect of technology.
  4. **Easy to implement and maintain. **This structure makes it easy to implement and debug a large and complex system, because the entire system has been decomposed into several relatively independent subsystems. When debugging and maintaining, each layer can be debugged separately, avoiding the situation of not finding or solving the wrong problem.
  5. **It can promote standardization. **Because the functions of each layer and the services it provides have been accurately described. The advantage of standardization is that any layer can be replaced at will, which is very convenient for use and research.

The hierarchical modular design idea is a common method in the technical field for dealing with a project that has a huge function and requires the cooperation of many people and continuous improvement of engineering projects. It is an effective method that has been tested in practice.

2. Several construction ideas for Bitcoin Layer 2

We take the second-layer construction of Bitcoin as a case to conduct relevant analysis. There are three obvious second-layer construction routes for Bitcoin’s second layer:

(1) One is a chain-based expansion route, which is very similar to the second layer of EVM and is a blockchain structure;

(2) One is based on a distributed route, represented by the Lightning Network, which is a distributed structure.

(3) Another route is based on a centralized system, represented by a centralized index, which is a centralized structure.

The first two methods are very distinctive, and there are already some products in use and products under exploration. For the first method, due to the booming development of Ethereum and the exploration of other Bitcoin imitation chains, chain-based second-layer expansion is relatively easier, and there are more reference cases. The second distributed method is usually more difficult and develops slower, represented by the Lightning Network. The third method is very controversial because it does not look like a two-story building, but it seems to complete the function of a two-story building.

Which second-layer construction plan is better? We use a market test result as a measure. The second-layer network with a higher total locked value TVL (Total Value Locked) is the best plan. With the development of time and technology, this best plan will be a process of change.

Regarding the definition of Bitcoin's second-layer network, as long as it relies on the Bitcoin network, establishes technical connections with the Bitcoin network, and has some characteristics that are superior to Bitcoin's first-layer network, it is considered Bitcoin's second-layer network construction. In other words, as long as BTC is consumed as gas, BTC is used as the underlying asset, and the system that expands Bitcoin's performance is considered a second-layer construction. Based on this judgment, we should recognize the third type of second-layer network construction, that is, the centralized structure of the second-layer construction.

The development of Bitcoin’s own technology, such as the modification of OP_RETURN, SegWit (Segregated Witness), Taproot (Segregated Witness Upgrade), Schnnor Signature, MAST, Tap, should all be designed for the purpose of connecting the first and second layers. These technologies should not be used to develop too many functions, because no matter how much the first layer network is expanded, there will be no qualitative breakthrough, and the second layer must be built. However, in the absence of better Bitcoin second layer products, these technical capabilities connecting the first and second layers will be overused for a period of time.

2.1. Chain-based second-layer construction

There were many explorations in the early Bitcoin imitation chains, such as “Colorcoin”, “CovertCoins” and “MasterCoin”; various expanded Bitcoin imitation chains, such as BCH (Bitcoin Cash), BSV (Bitcoin SV), 5 BTG (Bitcoin Gold); various side chain technologies are all based on chain expansion construction cases, which can be said to be a broad second layer.

Including Ethereum, it is also an improvement exploration based on Bitcoin. After Vitalik failed to persuade other project teams, he set up his own team to publish a white paper and develop a new generation of blockchain system to address the imperfections of Bitcoin: UTXO's accountless system, non-Turing completeness of the execution language, poor scalability, etc. Although Ethereum's exploration is not a direct second-layer construction on Bitcoin, it is a chain-based construction exploration in a broad sense.

Ethereum's exploration of improvements to Bitcoin's imperfections, as well as the development and verification of the second layer on Ethereum, provide a reference case for the development of a second-layer network based on Bitcoin. Various Rollup solutions, cross-chain solutions, message channel technologies, and Ethereum's own sharding technology* (from the perspective of layered thinking in dealing with complex systems, perhaps this idea of solving multiple problems at one level is wrong)* have made the Ethereum technology ecosystem flourish, causing many people to believe that the development direction and future of the public chain have been determined, and the ecosystem represented by Ethereum has won. In fact, this is also a manifestation of the relative maturity of the second-layer construction based on the chain. However, the second-layer construction based on the chain is only one way of second-layer construction. It has its own advantages and disadvantages, and other second-layer technologies are needed to improve the entire second-layer ecology.

The second-layer construction based on the chain in Bitcoin generally includes two typical chain types, one is the account model compatible with EVM, and the other is the UTXO model similar to Bitcoin. Existing cases (we use the broad second-layer definition) include: Ethereum, Polygon, Bsc, Arbitrum, etc. are all EVM account models, and CKB (Nervos) and Chia are all UTXO models.

In the following chapters, some cases will be introduced in more detail when introducing the Bitcoin second-layer projects that have been implemented.

In addition, the second-layer projects that have been successful on Ethereum will also join the second-layer construction of Bitcoin based on the chain. For these second-layer projects on Ethereum, the workload and challenges of transforming to the second-layer on Bitcoin will be less. With the maturity and modular development and theoretical achievements of Ethereum's rollup, this type of second-layer construction will become the mainstream of the expansion discussion and the fastest solution.

How successful will this transformation be? It remains to be tested. We can make some preliminary judgments based on the advantages and disadvantages of this chain-based second-layer construction.

**What are the advantages and disadvantages of chain-based second-layer construction? **

The disadvantage of this solution is that the second layer based on the chain is generally limited by the limitations of the blockchain, and the performance improvement is limited. Either the system becomes more centralized, or the block generation interval is reduced, and the block capacity is increased. , the safety will generally be reduced. As a result, a two-story building above the second floor was born, which is also called Layer 3 or Layer 4.

The advantage is that this solution maintains most of the basic characteristics of the blockchain, and generally solves the Turing-complete problem. The transaction costs are also significantly reduced, and it expands the capabilities of the first-layer network to a certain extent. Moreover, this solution has abundant construction cases, and the technical implementation is relatively easy. There are already many exploration cases, and the migration of upper-layer applications is also very convenient. It is a faster implementation method. I believe that this method will produce more second-hand solutions. layer network.

Roughly speaking, due to the expansion limitations of this method, there should be many projects on the second floor based on the chain structure. There may be one or more second floors in each vertical field. Each project must complete its own unique second floor construction. , to meet the needs of certain applications. Its value will also be determined by the number and total value of applications on it.

2.2. Second-layer construction based on distributed system

In the second-tier construction, there are also some constructions based on distributed systems. In this solution, the second-layer structure and framework are no longer blockchain structures, but a distributed system based on Channel. Lightning Network is a typical representative.

A distributed system consists of a limited set of processes and a limited set of channels. In order to deliver messages in a distributed system, the data, events, and channels that need to be controlled are already a relatively complex set of problems. The Channel we refer to here is the upper-level channel concept, such as the payment channel in the Lightning Network and the message channel in Nostr, rather than the underlying concept of the specific technology Channel in the distributed network.

There are two categories in the second-layer construction of distributed systems:

(1) Only value transfer is completed, similar to the Lightning Network;

(2) Not only complete value transfer, but also complete Turing-complete technology, such as RGB;

In the distributed second-layer construction scheme, because it is value transfer, there are many difficulties that surpass the original message transmission, such as the total value capacity in the channel, the rigor of transactions, and the inability to consume twice. These problems all surpass the difficulty of message transmission. Therefore, the development of distributed second-layer construction is not as fast as that of chain-based second-layer construction, and there are not many mature cases.

If you want to complete Turing-complete computing on such a second layer, that is, to build a Turing-complete virtual machine system on the Channel, it will be more difficult. For example, the RGB protocol achieves Turing-complete computing on a distributed system through client verification and one-time sealing.

Regarding the second-layer construction of distributed distributed systems in Bitcoin, existing cases include: Lightning Network, RGB, are there any more famous cases? If we look at it according to the standard of generalized two-tier construction, does Nostr also belong to the second-tier construction of distributed systems with Channel mechanism? When sorting out Ethereum information, I saw cases of using Channels in Ethereum documents: Connext, Raiden, and Perun, which can be used as exploration directions for in-depth researchers.

In the following chapters, we will introduce the Lightning Network and RGB in more detail in the Bitcoin second-layer projects that are already running.

**What are the advantages and disadvantages of distributed systems based on distribution? **

The advantages of this solution are generally that the system is more decentralized, the second-layer network can accommodate countless nodes, privacy and anti-censorship capabilities are better, and there is unlimited scalability, so the performance becomes extremely large in theory.

The disadvantage of this solution is that the technical implementation is complex, and the routing algorithm, value splitting and encapsulation algorithms in a huge distributed system are relatively complex. Compared with information transfer, there is still a lack of engineering implementation experience and infrastructure in value transfer. This is also one of the reasons why the Lightning Network has been considered to be developing slowly.

In addition, it is a very big challenge to implement a Turing-complete system in this kind of system, that is, Channel+ computing. It can definitely be realized in theory, but in practice it is still in the early experimental stage. RGB is a typical representative of this situation.

Once the distributed second-layer construction achieves a breakthrough, it will greatly promote the development of upper-layer applications. The decentralized capabilities formed by its huge distributed nodes and Turing-complete code execution capabilities will better support the next generation of Internet applications, which is the "Mass Adoption" scenario that everyone is talking about.

It can be roughly judged that the second layer of the distributed structure based on Channel generally only has a few parallel projects. There are two main reasons. One is the unlimited expansion capability of this system, and the other is the technical difficulty of implementation. Therefore, such a system needs to be more open in design and concept, and can accommodate more people and teams to participate. And based on this second-layer infrastructure application development team will also promote the development of this second-layer, for example, the RGB-based BiHelix project.

2.3. Second-layer construction based on centralized system

Should we have this classification? There will probably be controversy.

Centralized index structures like Ordinals, or indexers of certain functional nodes are centralized structures, and they are also a second-layer construction idea. However, this construction idea is less recognized because the second layer is too centralized and the expansion of the first-layer network is very limited. The second-layer construction of this centralized structure relies on the first-layer network for the basic characteristics of various blockchains. The second layer only serves some simple calculation and statistical functions. The second layer sometimes seems to be a temporary existence that can be replaced by another second layer at any time, and its importance does not seem to be that high. But from the perspective of On-Chain and Off-Chain, and from the perspective of improving the capabilities of the first-layer network, this centralized structure is also a second-layer expansion.

In addition to Ordinals, examples of such systems should include centralized exchanges. Projects in this situation will not be introduced in the following cases.

Pros and cons of the second-layer construction based on the centralized system:

The advantage is that the centralized system is very mature, with countless available cases and optimization solutions, full Turing completeness and excellent performance.

The disadvantage is that the second layer is extremely centralized, and all the basic features of blockchain rely on the first layer network.

Roughly speaking, there should be fewer projects based on the second layer of the centralized structure, and they may even exist in stages. After the distributed structure based on the chain structure and the Channel matures and improves, most of the second-layer constructions of the centralized structure will disappear, or only a few centralized second layers with special scenarios will remain. At the current stage, because the centralized system is very mature, it can well meet the scenarios of On-Chain data and Off-Chain calculations when it can write data on the basic chain. It is the easiest mode to implement in the current primary application of the Bitcoin ecosystem and is widely used.

2.4. Broader second-level concepts and higher-level applications

From the analysis of the second-layer structure above, there are **blockchain structure, distributed system structure, and centralized system structure. **This is a common classification of system structure: Centralised, Decentralised, Distributed. From this perspective, it is easier for us to understand the characteristics and applicable scenarios of each type. The three second-layer types have their advantages and disadvantages. In the future complete Bitcoin ecosystem, all three types should be distributed according to different scenarios.

An article to sort out the basic knowledge system of Bitcoin Layer2 construction V1.5

I used this diagram in reference to Vitalik’s article: The Meaning of Decentralization, link URL: 76 a 274

There are often some disputes about this picture in China. It is believed that the Decentralized and Distributed picture logos are reversed. From the perspective of control and decision-making, we should be able to eliminate this controversy and better understand Decentralized and Distributed. Regarding Centralized (A) in the figure, there should be no dispute among everyone from various perspectives, so we only compare decentralized and distributed. Decentralized Decentralization is actually a kind of multi-centering, and its control and decision-making also require the participation of certain central nodes. At this time, control and decision-making are called consensus. For example, only full nodes with mining capabilities in Bitcoin have the ability to determine the generation of new blocks and the content written into new blocks. Those nodes without mining capabilities are read-only nodes or verification nodes. In POS and DPOS chains, this situation will be more obvious. Only the consensus node can decide what to generate and write in the new block. The difference between synchronous algorithms and asynchronous algorithms in consensus protocols is also more obvious, which will determine the number of nodes that can be accommodated in the blockchain network. In the distributed system, there is no obvious center at all, only nodes. Any node can join or leave the network at any time, and its control and decision-making are local. This is also one of the reasons why distributed systems can achieve very high performance. . Does this explanation eliminate the common disputes between Decentralized and Distributed?

In addition, the blockchain crowd often discusses Layer 3 or even Layer 4 above the second-layer construction, which is a generalized second-layer construction. Layer 3 and Layer 4 are completely different concepts from the 5-layer structure of the Web3 technology stack proposed by Gavin Wood. Layer 3 and Layer 4 in the Web3 technology stack are the classification methods of application protocols.

An article sorting out the basic knowledge system of Bitcoin Layer2 construction V1.5

What impact will these second-layer constructions have on upper-layer applications? With the basic features provided by the blockchain system: openness, transparency, decentralization, security, computing power, throughput, storage, privacy, etc., upper-layer applications will be built on these second-layer extensions and will interact with each other on these second layers. The second-layer extensions based on blockchain structures, distributed structures, centralized structures, and some centralized applications will produce real, large-scale Web3.0 applications.

2.5. Summary of the basic characteristics of blockchain and the characteristics of three types of Layer 2 construction

The content of this section comes from another article I wrote, "Observing the second layer of Bitcoin from the perspective of a state machine, you can get more thoughts and conclusions." The summary table and some conclusions are directly quoted here. For the system architecture of Web3.0 applications, please also refer to that article.

One article combing the basic knowledge system V1.5 of Bitcoin Layer2 construction

Through the above table, we can roughly summarize the characteristics of blockchain structure, distributed system structure, and centralized structure.

(1) Blockchain structure

The biggest advantage of the blockchain structure is that it solves trust-related issues (the role of the ledger) and can record the change process of data (state transition), so that data and computing rules become trusted data and trusted computing.

The biggest problem with the blockchain structure is poor performance. There are two reasons for this. First, the blockchain structure cannot remove some of the scenarios in which some calculations are performed. All requests are processed in a full-volume calculation manner. For example, partial calculations and global calculations, local data and global data, temporary data and permanent data. Second, the blockchain structure has a clear performance ceiling. If the second-layer expansion is performed through the chain, the number of transactions supported is also limited.

In order to expand the performance of the blockchain structure, multi-layer construction is required and it needs to be used in combination with heterogeneous systems.

From the above table, only the blockchain structure can realize the trustless ledger function. Therefore, if a system wants to realize the trustless ledger function, it must include a blockchain system. However, due to the performance requirements of large-scale applications, the blockchain system must be combined with other systems to meet the needs.

(2) Distributed system

In the table above, we can see the obvious advantages of distributed systems: decentralization, performance, and scalability are all excellent, but they are more complex in terms of functional implementation. In addition, distributed systems do not have the ability to trust ledgers.

Therefore, if we can use the distributed system in the second-layer construction based on the first-layer ledger function of Bitcoin, we can theoretically achieve unlimited performance expansion while maintaining the basic characteristics of the blockchain. A case in this area is represented by Bitcoin + Lightning Network. The performance of this combination is Bitcoin's 7 TPS * ∞.

The reason for achieving Turing completeness in a distributed system is that the cost of recording and running smart contracts in a blockchain system is very high because it is global data and global code. Therefore, smart contracts are also suitable for layered theory, which limits the code storage and execution of smart contracts to participants.

(3) Centralized system

In the table above, we can see that the advantage of a centralized system is that the engineering implementation is relatively simple, which is due to the simple internal logic control and simple calculation. Similarly, a centralized system does not have the ability to trust the ledger. The advantages of a centralized system are not prominent, and it is relatively suitable for processing small-scale data, or processing temporary data and temporary calculations.

The second-layer construction of the centralized system can serve as a supplement or transitional solution to the other two methods.

(4) Comprehensive analysis

In the value era, through the above content, we can see that it is difficult to achieve the effect of meeting needs by relying on one system alone. This is also a practical need for the second layer of Bitcoin ecological development. But how to combine these three systems requires a lot of exploration. Let’s analyze it theoretically first. Faced with different needs, there will be different combination structures.

First of all, from the perspective of the design concept of protocol layering, the Bitcoin network does not require Turing completeness. It is a global trust machine and only needs to save the data and data changes that require global trust. Based on this most basic requirement, Bitcoin's instruction set can be reduced to a minimum. Other functions are left to the upper-layer extensions to complete.

Generally, small applications can be completed on a single blockchain. Slightly larger systems are suitable for completion on the second-layer construction of blockchain + blockchain. However, for large-scale applications, the preferred solution is to use blockchain system + distributed system.

Through the combination of multiple system structures, the limitations of the basic theory of a single system can be broken through. For example, the blockchain system is limited by the DSS impossible triangle, but if the blockchain system + distributed system is used, the impossible triangle of decentralization D, security S, and scalability S can be solved. Other combinations, blockchain + centralized system, can also solve the scalability problem to a certain extent. Distributed system + centralized system can solve the limitations of the CAP triangle in the distributed system.

3. Things related to second-story construction

With the first-tier network and second-tier construction, what is the connection between the two? Or are the two directly related? One is a direct technical connection, for example, a link through two-way locking or bridge technology. The other is correlation outside the system, such as Bitcoin and Ethereum. Although there is no direct correlation, people transform BTC into WBTC to flow on Ethereum. There is not even any technical correlation, but individual adjustments based on price fluctuations. The positions of Bitcoin and Ethereum are a correlation outside the system.

Here we only discuss the technical relevance, which is completely closely related to the structure and characteristics of the second layer. Later, we will refer to the von Neumann structure from a more macro perspective to judge the development of the blockchain-related ecology.

3.1. Connection technology between layer 1 and layer 2

We have already mentioned the development of Bitcoin's own technology, such as modifying OP_RETURN, SegWit (Segregated Witness), Taproot (Segregated Witness upgraded version), Schnnor signature, MAST, and Tap, all of which should be used to connect the first and second layers. Design is the basic technical element that connects the first layer and the second layer in the Bitcoin ecosystem. These connection technologies are an important part of thinking about the second-layer construction. Although there are some BTC connection technology implementation solutions on the network, such as using HashLock, or threshold signatures, MPC, etc., these solutions have limited functions and are not suitable for more complex functions. To further segment the scenarios and requirements, it is still necessary to use the basic technical elements generated for connection in the Bitcoin ecosystem.

BEVM's layer 1 and layer 2 connections are representative, and use more functions built with the above basic elements. Its Shnorr signature + MAST contract + Bitcoin light node network BTC L2 solution is a good case for learning to connect the layer 1 and layer 2.

In addition to these basic technical elements that connect the first layer and the second layer, the specific connection technology will vary depending on the structure of the second layer. I will first generally introduce some types of connection technologies. The common technologies that connect the first layer network and the second layer network of the blockchain are as follows:

**Cross-chain technology: **Through cross-chain technology, different blockchains can interoperate and realize the connection between the first-layer network and the second-layer network. Cross-chain technology can realize cross-chain transfer and interaction of assets, allowing data and value to flow between different blockchains.

**Isolated Verification Technology: **Isolated Verification technology can isolate transaction data in the first-tier network and then verify and process it through the second-tier network. This approach can reduce the burden on the first-tier network and improve overall throughput and efficiency.

**Sidechain technology: **Sidechain technology is a technology that connects the main chain and the side chain. The side chain can realize data transmission between the first-layer network and the second-layer network. Side chains can separate some specific functions and applications from the main chain to improve overall performance and scalability.

**State Channel technology: **State Channel technology is a solution based on the second-layer network. By establishing a communication channel outside the chain, transactions can be carried out outside the chain and submitted to the first-layer network only when needed. State Channel technology can increase the speed and throughput of transactions and reduce transaction fees.

**Plasma technology: **Plasma technology is an expansion solution based on the second-layer network. By sharding the transaction data of the first-layer network and then verifying and processing it through the second-layer network, it can achieve higher throughput and Scalability.

Common two-layer structures include blockchain structure, distributed system structure, and centralized system structure. Due to the different structures of the two-layer, most of the common connection technologies mentioned above can only be used in one structure, so they will not be discussed in depth here.

As the second-layer construction matures, there will be more specific technologies or cases, and it may not even be a technical connection but just an economic connection.

What are the reference indicators for evaluating the quality of Layer 1 and Layer 2 link technologies? The indicators we generally see are:

Can the first layer verify transactions on the second layer?

Can the assets on the first floor escape smoothly when the second floor collapses?

Does the connection technology degrade certain characteristics of the system?

……

The content of the linking technology between the first layer and the second layer should be better summarized and improved when there are more cases of second layer construction. These connection technologies are currently completed by second layer builders. Whether there will be independent products like cross-chain bridges in the future is hard to say at present.

This section is more about raising questions and giving us participants and builders more to think about.

3.2. Refer to the von Neumann structure to look at the development of blockchain

Earlier, we have used the concept proposed by Vitalik: The blockchain is a "world computer". Since they can all be called computers, this "world computer" can be compared and analyzed with the von Neumann structure of traditional computers.

One article combing the basic knowledge system V1.5 of Bitcoin Layer2 construction

The five major components of a von Neumann-structured computer are: arithmetic unit, controller, memory, input device, and output device. ** In the "world computer" system of blockchain, similar components also exist, and we must also pay attention to the connection part among these five components, because in a distributed system, the connection part has a greater impact.

The development rules of the "world computer" are very similar to those of traditional computers. If compared with the development of traditional computers, the blockchain system is still in a stage similar to that before 286, still expanding processing power and storage capacity, with simple peripherals, and can do very limited things.

A few comparisons of the development of traditional computers and the development of the "world computer":

(1) CPU (computing unit and controller) expansion, just like the current expansion of the first and second layer computing energy and throughput;

(2) The expansion of storage will gradually shift from competing for space on the chain to using real blockchain storage. The current on-chain storage space of the first and second layers is like the registers, first-level cache, and second-level cache in traditional computers. In the future, there will be professional blockchain storage methods similar to memory, hard disks, and external storage. The current way of writing data will also change greatly in the future.

One article combing the basic knowledge system V1.5 of Bitcoin Layer2 construction

(3) Input devices and output devices, in the blockchain system, are oracles. These input and output devices have not been reflected much in the second-floor construction, and there will be more demands in upper-layer applications.

(4) Some special chains and functions in the blockchain are very similar to GPUs, dedicated device cards, special peripherals and other components in traditional computers.

(5) On-chain applications and higher-level applications, just like traditional computers that have not yet distinguished operating systems and application software, are also evolving and functionally separated step by step.

(6) Many current blockchain applications are financial applications, much like early traditional computers, which were mostly used for scientific research and military applications. As they develop, they gradually move towards enterprises, families, and individuals. Blockchain applications will also have a similar development trend, from early financial applications to more extensive applications.

From the construction of the second layer, there is still a lot that can be discussed comparing traditional computers and the "world computer" of the blockchain, which will not be described in this article.

4. Current status of Bitcoin’s Layer 2 construction

4.1. Bitcoin second-layer projects already in operation

In this article, we mainly introduce those second-layer Bitcoin projects that have been successfully operated, referring to some research reports and industry reports. These second-layer constructions have been running for a certain period of time, and most of them were brewed or launched from 2015 to 2019. . Some newer projects will also be introduced if they have special features. We will see that these cases are basically based on the second-layer construction of the chain, and the only distributed system construction based on the Channel is the Lightning Network. If you include the second-layer construction of Ethereum, Raiden Network is also a design case based on Channel, but its current development does not seem to be successful and will not be introduced in this article. Ethereum's Plasma technology is a sub-chain design based on Channel. It seems to be a combination of chain and Channel. I personally think that its main feature is a two-layer design based on chain, so I won't discuss it too much here.

1. Lightning Network Lightning Network (based on distributed second-layer construction)

The Lightning Network is a second-layer solution built on the Bitcoin blockchain that aims to solve Bitcoin's scalability and low transaction speed issues. The Lightning Network was first proposed in 2015 and began to be fully implemented in 2018.

The main features of the Lightning Network are fast, low-cost and scalable. It establishes a series of payment channels so that Bitcoin transactions can be carried out within the channels without being recorded directly on the blockchain. This can greatly reduce transaction confirmation time and transaction fees, and support a large number of parallel transactions. The Lightning Network relies on the RMSC protocol to ensure transaction security and reliability, and HTLC solves the problem of routable scalability. The scalability of its architecture gives it very high performance.

Since its launch, the Lightning Network has received widespread attention and adoption. More and more Bitcoin users, exchanges, and merchants have begun to use the Lightning Network for fast cross-chain transactions and real-time payments. In addition, developers are constantly improving the performance and user experience of the Lightning Network, providing it with more features and scalability.

Although the Lightning Network offers significant improvements in scalability and transaction speed, it still faces several technical and adoption challenges. For example, network stability, routing algorithms and user interfaces need to be continuously improved. However, as time passes and technology improves, the Lightning Network is expected to become an important payment solution for Bitcoin and other cryptocurrencies, providing users with a faster, lower-cost transaction experience.

2.Liquid (chain-based second-layer construction)

Liquid is a sidechain solution launched by Blockstream in 2015. As the first sidechain of Bitcoin, Liquid aims to provide a faster, more secure and private transaction solution to meet the needs of professional users such as financial institutions and exchanges.

One of Liquid’s key features is its fast transaction confirmation times. Compared to Bitcoin’s confirmation time of about 10 minutes, Liquid’s transaction confirmation time is only 2 minutes. This enables users to conduct transactions faster and transfer funds quickly when needed. Another important feature is Liquid’s transaction privacy. Liquid uses Confidential Transactions (confidential transactions) technology to hide the transaction amount, and only the participants in the transaction can view the specific amount. This helps protect the privacy of transaction participants.

Liquid also features higher transaction throughput. By using Federated Peg (federal anchoring) technology, Liquid can support a large number of parallel transactions and anchor on the Bitcoin network to achieve interoperability with Bitcoin. This allows Liquid to handle more transaction volume and improve overall system throughput.

Since its launch, Liquid has grown in the cryptocurrency industry. More and more exchanges, financial institutions, and enterprises are beginning to adopt Liquid as their trading and fund settlement solution. At the same time, Blockstream continues to launch new features and improvements to further improve Liquid's performance and security.

In summary, Liquid is a Bitcoin sidechain solution launched by Blockstream that aims to provide fast, private, and high-throughput transactions. It meets the needs of professional users by shortening transaction confirmation time, providing transaction privacy, and increasing transaction throughput. Over time, Liquid has been widely used and developed in the cryptocurrency industry.

3. Rootstock (RSK) (chain-based second-layer construction)

Rootstock (RSK) is a smart contract platform built on the Bitcoin blockchain and aims to provide Ethereum-like functionality to the Bitcoin ecosystem. Rootstock was first proposed in 2015 and officially launched in 2018.

The main features of Rootstock are the two-way peg with Bitcoin and smart contract functionality. With a two-way peg to Bitcoin, Rootstock is able to use Bitcoin as its primary asset, enabling security and stability. At the same time, Rootstock supports smart contract functions, allowing developers to build and execute smart contracts with automation functions on its platform.

Since its launch, Rootstock has gradually gained recognition and adoption within the Bitcoin ecosystem. It provides more functions and flexibility to Bitcoin users and developers, allowing Bitcoin to support a wider range of application scenarios, such as decentralized finance (DeFi), digital asset issuance and supply chain management.

However, Rootstock’s development has been relatively slow compared to other smart contract platforms. Its expansion in terms of user and developer communities requires more efforts. Nonetheless, Rootstock’s development prospects are still considered positive and it has the potential to become one of the important smart contract platforms in the Bitcoin ecosystem.

**4. RGB (based on distributed + Turing complete second-layer construction) **

The story of RGB dates back to 2016, when Giacomo Zucco wanted to use Peter Todd's client-side verification and one-time seal concepts to develop a better colored coins and bring these tokens to the Lightning Network (that's where the name "RGB" comes from). It is an open protocol built on the Bitcoin blockchain that aims to provide richer features for the creation, trading and management of digital assets.

RGB is a scalable and confidential Bitcoin and Lightning Network smart contract system developed by the LNP/BP Standards Association. It adopts the concepts of private and common ownership and is a Turing-complete, trustless form of distributed computing that does not require the introduction of tokens and is a non-block decentralized protocol. RGB is designed to run scalable, robust and private smart contracts on UTXO blockchains (like Bitcoin) to make all possibilities possible. Through RGB, developers can execute token issuance, NFT minting, DeFi, DAO, and more complex multi-category smart contracts.

The RGB protocol is a client-side state verification and smart contract system that runs on the second and third layers (off-chain) of the Bitcoin ecosystem based on the concepts of client-side validation and single-use-seals.

5.Stacks (chain-based second-layer construction)

Stacks (formerly Blockstack) is a decentralized computing platform built on the Bitcoin blockchain. Stacks was first proposed in 2013 and had an initial coin offering (ICO) in 2017. Its main feature is to provide decentralized authentication, storage and smart contract functions.

The core feature of Stacks is to support the development and execution of decentralized applications with the security and stability of Bitcoin. It uses a consensus mechanism called "Stacking" to achieve consensus by letting users holding STX tokens lock a certain number of tokens and participate in network verification. This mechanism provides incentives for users and increases the security of the network.

In terms of development, Stacks has become one of the important platforms in the field of decentralized applications. It has attracted a group of developers and projects to join, built numerous decentralized applications, and provided rich tools and development documentation. Stacks also cooperates with other blockchain projects to expand its ecosystem and application scenarios.

6. Other Bitcoin Layer 2 Projects

With the popularity of Bitcoin, many new projects have emerged, most of which are initiated by Chinese people. These new projects, such as B² Network, BEVM, Dovi, Map Protocol, Merlin, Bison, etc., also have certain characteristics.

Founded in 2022, B²Network is a second-layer Bitcoin network developed based on ZK-Rollup. It is compatible with EVM and enables EVM ecosystem developers to seamlessly deploy DApps. It is a typical case of transferring the second-layer technology of Ethereum technology to the Bitcoin ecosystem.

BEVM's original team was established in 2017 and has explored a variety of extended applications of Bitcoin. The BEVM concept proposed in 2023 is a decentralized Bitcoin L2 compatible with EVM. BEVM is based on technologies such as the Schnorr signature algorithm brought by the Taproot upgrade, allowing BTC to cross-chain from the Bitcoin main network to Layer 2 in a decentralized manner. Since BEVM is compatible with EVM, all DApps running in the Ethereum ecosystem can run on BTC Layer 2 and use BTC as Gas. On November 29, 2023, BEVM released a white paper.

Founded in 2023, Dovi is a Bitcoin Layer 2 compatible with EVM smart contracts. In November 2023, Dovi officially released the white paper. According to the white paper, Dovi integrates Schnorr signatures and MAST structures to improve transaction privacy, optimize data size and verification processes; issue a flexible framework for various asset types other than Bitcoin, and realize cross-chain asset transfers.

The Map Protocol team was established relatively early. Originally, it was mainly engaged in cross-chain protocols, which is the connection technology between the first and second layers we introduced earlier. After the Bitcoin ecosystem became popular, it was able to quickly build a second-layer construction based on the chain. The ability to cross-chain the current inscription assets and reduce transaction fees will attract some project parties and applications.

From the official website of Merlin Chain, it is easy to see its Bridge attributes. It transfers assets on BTC to the second-layer network and reduces transaction costs. It is a typical representative of solving pain points first. According to the official website introduction and some research reports, Merlin is a Bitcoin Layer 2 solution that integrates the ZK-Rollup network, decentralized oracles and on-chain BTC fraud prevention modules. The project is launched by Bitmap Tech. They are a unique team. The Bitmap.game and BRC-420 "Blue Box" Ordinals assets they launched have good reputations.

Founded in 2023, Bison is a Bitcoin-native zk-rollup that increases transaction speed while implementing advanced features on native Bitcoin. Developers can use zk-rollup to create innovative DeFi solutions such as trading platforms, lending services, and automated market makers. From its official website, Bridge is also an important feature. Cross-chaining Bitcoin assets and completing upper-layer asset applications are the entry points for many projects.

Judging from the above relatively new projects B² Network, BEVM, Dovi, Map Protocol, Merlin, and Bison, they have quickly completed the reduction of transaction fees and met the transaction needs of Bitcoin's first-level assets. They all involve cross-chain assets. Those teams that have cross-chain protocols can do it faster. Teams that have experience in second-layer construction have more advantages in upper-layer applications. These newer projects are all based on the second-layer construction of the chain, taking advantage of the original technology accumulation and short-term explosive power. These projects are somewhat homogeneous. What will be their future development? What will be the outcome of competition with distributed second-tier construction service providers? It also requires a lot of observation. Judging from the experience of second-tier projects on Ethereum, many projects will fall flat after the tokens are issued through hot-spot marketing. Will this be the case for Bitcoin's second-tier projects?

From the projects currently running on the second layer of Bitcoin, we can roughly see that the well-known second-layer Bitcoin projects were established relatively early and have been exploring related technologies for a long time. However, because the basic technology of the Bitcoin ecosystem has not been formed, most of the projects are not exciting enough, or are overshadowed by the brilliance of Ethereum and the Ethereum ecosystem. With the maturity of the Bitcoin basic protocol, especially the formation of the underlying basic technologies such as Segregated Witness, Taproot, Schnorr Signature, MAST Merkel Abstract Syntax Tree, Tap, etc., the connection technology between the first layer and the second layer has developed well, so the things that the Bitcoin ecosystem can do are becoming richer. From the second-layer projects of Bitcoin that are already running, we can see that some are builders of the original Bitcoin ecosystem, another part is the builders of the second layer of Ethereum, and another part is from the builders of connection technology. No matter which direction the project comes from, it is necessary to use these newly generated Bitcoin basic connection technologies. The more comprehensive and diversified the use methods are, the better the support for the second layer will be.

4.2. Development analysis of Bitcoin’s second-layer construction

Wherever the funds are, there will be enthusiasm, and it will attract more funds to gather. Bitcoin currently has a market value of approximately US$800 billion. Its ecological development is weak, but it has the potential to explode. Therefore, many projects claim to carry out the second-layer construction of Bitcoin. We will not mention the specific names of these projects here, but we will make some classifications of the entrants of these projects to see their characteristics and their respective advantages and disadvantages.

1. The original Bitcoin second-layer construction project

The original second-layer Bitcoin projects, especially those that have been developed for many years and have certain accumulated advantages, can they be rejuvenated by the popularity of Bitcoin this time? Will it thrive? There is great uncertainty.

There are two criteria: one is what was mentioned above, whichever second-layer network has the highest TVL will win. The other is the second-layer structure type. The second-layer construction based on the chain can accommodate more parallel players due to its scalability, while the second-layer construction based on distribution can only accommodate fewer competitors.

The original second-tier projects still need to give full play to their accumulated advantages and establish new advantages with the help of new technologies to attract more applications to the platform. Only then can they have the opportunity to rejuvenate and gain more market share. If it fails to attract more applications, such old projects are likely to eventually sink or transform. In fact, such projects can also cooperate or merge with projects that have no technical accumulation at all and have established a community through some consensus through some consensus in exchange for greater development.

In addition, if those old projects can have advantages in the accumulation of distributed-based second-tier construction technology, they can fully intervene in the distributed-based second-tier construction, and it will be more effective by providing guidance for upper-layer applications.

2. New Bitcoin Layer 2 Construction Projects

New projects that enter the second-layer construction of Bitcoin generally do not have many accumulated advantages, but this gives such a team the advantage of being a latecomer. They can research the latest technology, solve the lightweight and most attractive needs first, and attract a certain number of people. Application entry. It is best to have a team with second-layer construction experience in the Ethereum ecosystem or other ecosystems, which is more suitable for quickly entering the second-layer construction of Bitcoin. For such a project, you can consider chain-based second-layer construction, which will be faster and more advantageous.

Teams with absolutely no experience or advantages can refer to the third scenario to see if they can screen out users and accumulate funds through community consensus.

3. Bitcoin second-tier projects that have no accumulation but want to enter

I didn't have much understanding of projects that promoted their entry into Web3.0 without any technical or community accumulation. I probably thought these projects were CX projects. But through the phenomenon of inscriptions, those communities that have generated a large community consensus through a certain inscription, such as sats, ordi, and rats, not only have many members, but also have accumulated a certain amount of funds. Such projects can completely start a new second-layer construction from scratch. Through the power of the community, the upper-layer applications can be integrated into the community, and it is possible to build the second layer. Such a second layer is likely to be selected as a chain-based second-layer construction, because it is simple and fast, and through the power of the community, DID (decentralized identity), DAO tools, DeFi applications, and other upper-layer applications can be built on the second layer of the community. Moreover, there is no need to build it by yourself, but only to introduce mature product parties and share revenue with them. This may form a small ecosystem. Such projects have high requirements for community construction, foundation management, and decision-making mechanisms.

4. Development of upper layer applications

With the rapid development of Bitcoin's second layer, the huge amount of funds sleeping on BTC began to be reawakened, and due to the eyeball effect, more new users will be attracted to enter the Web3.0 field, coupled with the rapid development of Bitcoin's second layer technology , will lay a solid foundation for Mass Adoption. The upper-layer applications will start from the current financial applications and gradually introduce applications that require high performance, large traffic, and frequent interaction, such as Gamefi, SocialFi and other applications. There will be no downtime of chain-based applications and poor service experience. Good situation. The development of Bitcoin's second layer will bring many opportunities and solid infrastructure to upper-layer applications. When mature, it will bring more opportunities to more less-Native Web3 teams.

In any case, the Web3.0 era has just begun and is still in its infancy and early stages. It requires a lot of exploration and construction. Many countries and regions have not yet fully opened up to many new things in Web3.0. Web3.0 requires a lot of construction and will give each project team more opportunities. Constantly sensing new developments and new technologies, constantly adjusting, and constantly participating in the construction of Web3.0, such a team will definitely gain something at a certain stage and in a certain field.

Reference description

The writing of this article is the result of my reading of a large number of industry articles and participating in many activities such as TwitterSpace and offline exchanges. Inspired by the speeches of many people, some prominent influencing people and factors are as follows:

(1) Mr. Dashan from Waterdrop Capital, he has written many articles, given us many lectures on Wanwu Island, and participated in many Space activities.

(2) Some in-depth technical content is obtained by listening to Teacher Hong Shuning’s lectures, watching his videos, and communicating with Teacher Hong Shuning offline, such as routing problems in distributed systems and RGB Turing completeness problems.

(3) Numerous articles on www.btcstudy.org. There is a wealth of knowledge compiled on this website.

(4) Interview with Jan Xie, Chief Architect of Nervos (CKB).

(5) Read more about BIP protocols, Segwit, Taproot, ordinarys, brc 20, Atomical, etc.

(6) Other blockchain knowledge, including hierarchical design ideas and the comparison of von Neumann structures, are derived from the accumulation of knowledge I wrote in several books in the past few years, of which 5 were published, "Blockchain Knowledge-Popular" Popular Edition", "Blockchain Knowledge-Technology Popular Edition", "Turing Blockchain", "Blockchain Economic Model", "Web3.0: Building the Digital Future of the Metaverse"; and 3 books on Ethereum, completed Part of the writing was done but has not been published. These contents refer to a lot of native protocols, white papers, and technical principles of the blockchain. The output of these contents is also the result of everyone. I just collected and organized them. Slowly, I understood the correlation between these underlying principles and many technologies and possible future application scenarios.

(7) Discussions and reflections with team members when designing related products in our project.

I would like to thank Dashan, Elaine Yang, Hong Shuning and other technical experts from SatoshiLab for reading this article and providing feedback and suggestions for revision. They strictly check the accuracy of the concepts cited in the article until we can find the original references. I really appreciate this rigorous habit! I am very grateful to all the contributors and participants who have improved my knowledge system.

View Original
  • Reward
  • Comment
  • Share
Comment
0/400
No comments