In-depth exploration of Bitcoin's Layer 2 concept: feasible, but may not be adopted by miners
When it comes to Layer 2, most people will think of various Layer 2 projects on Ethereum, such as Arbitrum, Zksync, Optimism, StarkWare, etc. Some may also say that the concept of Layer 2 originated from the Bitcoin Lightning Network and was later applied to Ethereum by Vitalik. These are all facts, just from different perspectives.
The concept of Layer 2 is not unique to Bitcoin or Ethereum, but rather a major direction of scalability technology in blockchain.
Layer 2 refers to a set of off-chain solutions built on top of the main network, with the aim of increasing transaction throughput without sacrificing decentralization or security (emphasis added!!).
Advertisement - Please scroll down for more content
With the continuous fermentation of the BTC scalability narrative, a variety of BTC Layer 2 projects have emerged. Layer 2 has gradually evolved from a technology-driven blockchain scalability route to a vague marketing label.
This article will provide a simple technical overview of projects labeled as BTC Layer 2. It is important to note that in this hype-driven market, the impact of technology on the market is often secondary. Also, due to the author's limitations, some technical perspectives may differ from external views. Feel free to join the discussion group.
This article does not constitute any investment advice.
Table of Contents
The Unavoidable Topic: What is the Difference Between Layer 2 and Sidechains?
In the previous discussion, the purpose of Layer 2 technology is to scale the main network without sacrificing decentralization or security. Therefore, it is not a single technical concept in a narrow sense, but rather includes various solutions and implementations.
Currently, the most common types of Layer 2 technologies are State Channels and Rollups.
State Channels refer to establishing a channel between two or more parties on the main network, where multiple transactions can take place within the channel, and only need to broadcast transactions on the main network when the channel is opened or closed.
This is the approach officially adopted by Bitcoin's Lightning Network. In simple terms, the channel in the Lightning Network can be understood as a multi-signature address. After Bob and Alice each deposit BTC into this channel address on the main network, they can conduct daily transactions through the Lightning Network.
These daily transactions do not occur on the main network, thus saving expensive gas fees. When the two parties no longer anticipate further transactions, they can initiate a withdrawal command to the main network. This command's signature can prove to the BTC main network the authenticity of a series of off-chain transactions between the two parties.
At this point, the main network's security consensus will intervene to settle and release funds for Bob and Alice, ensuring that transactions occurring on the Lightning Network possess the same level of security as the BTC main network. Currently, this approach has not yet implemented smart contracts.
Rollups, on the other hand, may be more familiar. Optimistic Rollups and Zero-Knowledge Rollups on Ethereum are Layer 2 scaling solutions aimed at moving complex execution and state storage processes to Layer 2 to increase throughput.
In a nutshell, the main network verifies the Proofs submitted regularly to the main network by Layer 2 to ensure the authenticity of the Layer 2 ledger. This verification process is crucial.
Through this, the main network can "real-time" monitor the L2 ledger. When funds from L2 return to the main network, the security consensus of the ETH main network will intervene. The main network's Layer 2 withdrawal contract can verify the eligibility for withdrawal solely based on data generated through the main network's consensus, without relying on third-party information sources.
Having this awareness, it becomes easier to distinguish sidechains. Sidechains refer to establishing an independent blockchain network outside of the main network, such as BSC, where the main network's consensus cannot verify the legitimacy of cross-chain transactions on the sidechain.
A cross-chain bridge to a sidechain locks assets on the main network and maps them to the sidechain. Subsequently, assets mapped out on the sidechain can perform functions like transactions and transfers. However, when the sidechain returns to the main network, the main network's cross-chain bridge contract will only verify the authenticity of the messages for withdrawals issued by the sidechain, without verifying the sidechain's ledger.
In other words, if a cross-chain bridge project behaves maliciously, provides false signatures, or if the sidechain creates fake ledgers, the funds on the main network will be at risk.
It is evident that, following the traditional definition of Layer 2, observing whether the main network can verify ledgers outside of the main network is key to determining if a chain is Layer 2.
With this understanding, it is clear why Ethereum, despite launching later than Bitcoin, can achieve a lead by being the first to asynchronously develop Layer 2 solutions.
Technical Challenges of BTC Layer 2 — Verification
To understand the technical challenges of BTC Layer 2, one must first comprehend the BTC Taproot upgrade that enables possibilities for BTC Layer 2.
Taproot was initially proposed by Bitcoin Core contributor Gregory Maxwell in 2018. It is an improvement to the Bitcoin protocol designed to enhance the privacy and efficiency of Bitcoin transactions.
The core concept of Taproot is to make transactions under various conditions appear as regular single-signature transactions, reducing on-chain data usage and leakage, enabling complex transactions like multi-signatures and time locks to execute like regular Bitcoin transactions.
The Taproot upgrade introduced two crucial technologies for future BTC Layer 2 possibilities:
1) MAST (Merklized Abstract Syntax Tree);
2) Schnorr signatures;
MAST is a mechanism that breaks down complex scripts into multiple subscripts, organizes them into a Merkle tree structure, and only needs to reveal the hash value and content of a sub-script when a specific condition is met. This saves space, increases flexibility, and enhances privacy.
Schnorr signatures are a type of digital signature algorithm that can aggregate multiple signers into one and generate a single signature. This simplifies multi-signature transactions, reduces costs, increases security, and enhances privacy.
MAST (Merklized Abstract Syntax Tree)
The significance of MAST lies in the fact that, before the Taproot upgrade, implementing complex script conditions on Bitcoin's main network could only be done through the use of P2SH addresses, requiring the generation of redemption scripts with the same hash value and including them in transactions.
For complex conditions in P2SH, transaction volumes would become exceedingly large. With BTC in P2SH addresses, you must generate redemption scripts with the same hash value and include them in transactions. If the spending conditions specified in the script are too many, transaction volumes would become significantly large.
MAST effectively addresses the above issues and opens up possibilities for the development of BTC Layer 2.
MAST combines Merkle trees and abstract syntax trees. It is similar to P2SH, paying scripts specified hash values, but with MAST, it pays to a specified Merkle root hash value.
MAST assembles a large set of conditions into a hash tree, known as the Merkle tree. In this tree, each node is a hash value calculated from its child nodes.
The root is a hash value representing the entire set of conditions. Thus, in a transaction, only this root hash needs to be included, without listing all conditions, reducing the transaction size.
First, hash calculations are performed on all scripts (conditions). Then, the calculated hash values are combined with adjacent hash values for hash calculations, generating a new hash value. This process of pairwise hash calculations continues until the final hash value is derived.
This hash value is the Merkle root.
MAST links Bitcoin transactions to a Merkle tree, where each leaf node on the tree represents a condition to unlock Bitcoin. To spend these locked bitcoins, a script unlocking the bitcoins based on a path corresponding to conditions on the Merkle tree must be constructed.
The network only needs to verify if the script corresponds to conditions in the original set of conditions on the Merkle tree, verifying if the condition exists on the Merkle tree. Once the network confirms that the script and corresponding conditions belong to the Merkle root, it knows the script meets the requirements to lock the bitcoins and proceeds to verify the unlocking script. This eliminates the need to include the complete script in transactions, reducing the size of Bitcoin transactions.
It should be noted that while MAST significantly reduces the space occupied by transaction scripts and provides possibilities for complex on-chain operations, the logic that syntax trees can achieve is relatively limited. Therefore, claims that "MAST can implement smart contract-like functions on Bitcoin" are inaccurate.
Currently, the BTC main network does not support ledger verification similar to Ethereum Layer 2, implying that BTC Layer 2 cannot fully replicate the technical architecture of ETH Layer 2. Ensuring the security of cross-chain bridges on BTC requires a different approach.
If Schnorr signatures and MAST are combined, they can provide a new approach for BTC main network's Layer 2 cross-chain bridges, which is currently the mainstream technical solution for BTC Layer 2 projects.
Schnorr Signatures
Schnorr signatures, proposed by Claus Schnorr, are a digital signature scheme known for its simplicity and efficiency. Its advantage lies in aggregating multiple signatures into a single signature, optimizing verification and authentication processes in multi-signature scenarios.
For example, in a multi-signature transaction requiring 12 signatures, each signature may occupy 20 bytes of storage space. Thus, a total of 240 bytes would be needed to store these 12 signatures.
However, Schnorr signatures can merge these 12 signatures into a unified Schnorr signature, requiring only about 60 bytes of space. This saves significant storage space that can be used to accommodate more transaction script information.
Schnorr signatures provide privacy protection for all n-n multi-signature contracts. A typical application is in the Lightning Network payment channel, essentially a 2-2 multi-signature contract.
For general m-n m For instance, in a 2-3 multi-signature scenario, equivalent to A, B unlocking or B, C unlocking or A, C unlocking, three possibilities exist. This can be seen as a multi-condition script, where each condition is a 2-2 multi-signature, thus defining by aggregated public keys rather than explicit multi-signatures. This is the foundation of cross-chain technologies adopted by projects like STX, BEVM, creating BTC addresses controlled by hundreds of Layer 2 nodes to achieve cross-chain functionality. Based on the comparison above, it is evident that BTC Layer 2 solutions cannot simply replicate the design of Ethereum's Layer 2 due to inherent differences between the two. To plan the correct path forward, BTC Layer 2 solutions should focus on the core essence of security while considering the unique properties of Bitcoin. Bitcoin's base layer adopts a simple UTXO model with limited block space. As mentioned earlier, even with MAST, the BTC main network still cannot implement overly complex OP/ZKP verification logic. This means that, unlike Ethereum Rollups, Bitcoin Layer 2 solutions cannot regularly verify the responsibility records on-chain. Data stored on the Bitcoin blockchain can only serve as availability checkpoint and not for actual verification. This is a concern for the market as BTC believers lose the narrative of BTC Layer 2 without verification involving BTC consensus. Conversely, for ETH old users, the weaker security compared to ETH Rollup's technical solutions may not be very appealing. Decentralized cross-chain capability. This is a crucial definition of Layer 2, where achieving a cross-chain bridge that is secure equivalent to the main network's consensus on the BTC main network is highly challenging. Traditional Bitcoin cross-chain technologies like hash/time locks, pegs, swaps, and multi-signatures currently do not provide sufficient trust guarantees. The combination of MAST contracts introduced in Bitcoin's 2021 Taproot upgrade and Schnorr signatures offers hope for decentralized Bitcoin cross-chain bridges, marking a significant breakthrough for BTC Layer 2. Compared to Rollups' on-chain verification, current BTC Layer 2 teams in development need to focus primarily on enhancing the security of cross-chain bridge signatures as much as possible. To achieve a perfect Layer 2, only Bitcoin's BIP layer upgrade, miner adoption of underlying code updates supporting OP/ZKP verification and Bitcoin miner execution can realize a Layer 2 solution similar to ETH Rollup. It is important to note that this process will take a long time and may never be adopted by miners. Biteye is a leading Web3 research community in Asia, generating forward-looking investment research content and tools through community and AI-driven methods to help community members explore the Web3 rabbit hole. WeChat Group: Add the assistant @Biteye01 to join the group Twitter: @BiteyeCN Discord: Discord.gg/ME582FXR4FSummary: Feasible Development Path for BTC Layer 2
About Us