With the continuous fermentation of the Bitcoin scaling narrative, numerous Bitcoin Layer 2 projects have emerged recently. However, unlike Ethereum Layer 2 networks, BTC Layer 2 is gradually evolving into a vague marketing label from a technology-oriented blockchain scaling roadmap.
(Table of Contents:
Review of the current Bitcoin Layer 2 payment solutions: Lightning Network grows 7 times in one year, officially surpassing 10,000 nodes
)
(Supplementary background:
Why is it said that Bitcoin L2 ecology “cannot replicate” Ethereum’s diverse gameplay?
)
Index of this article
The inevitable topic: The difference between Layer 2 and sidechains?
Technical challenges of BTC Layer 2 —— Verification
MAST (Merkleized Abstract Syntax Tree)
Schnorr signature
Summary: Feasible development path for BTC Layer 2
Bitcoin’s underlying layer adopts a simple UTXO model and has limited block space.
Decentralized cross-chain capability issues
When it comes to Layer 2, most people think of Ethereum’s various Layer 2 projects, such as Arbitrum, Zksync, Optimism, StarkWare, etc. Some people also say that the Layer 2 concept originated from the Bitcoin Lightning Network and was later applied and developed on Ethereum by Vitalik. These are all facts, but it’s just a different perspective.
The concept of Layer 2 is not unique to Bitcoin or Ethereum but is a major direction of scaling technology in blockchain. Layer 2 refers to a set of off-chain solutions built on the mainnet, aiming to increase transaction throughput without sacrificing decentralization or security (emphasis on this point!).
With the continuous fermentation of Bitcoin’s scaling narrative, a wide variety of BTC Layer 2 projects have emerged. Layer 2 is gradually transitioning from a technology-oriented blockchain scaling roadmap to a vague marketing label.
This article will provide a simple technical overview of projects labeled with BTC Layer 2. It is worth noting that in this market driven by hype, technical impact on the market is often secondary. At the same time, due to the limitations of the author, some technical perspectives may differ from the outside world. Welcome to discuss.
The inevitable topic: The difference between Layer 2 and sidechains?
As mentioned earlier, the purpose of Layer 2 technology is to scale the mainnet without sacrificing decentralization or security. Therefore, strictly speaking, it is not a single technical concept but includes various different solutions.
Currently, the most common types of Layer 2 technology are state channels and rollups.
State channels refer to establishing a channel between two or more parties on the mainnet and conducting multiple transactions within the channel. Transactions only need to be broadcasted on the mainnet when the channel is opened or closed.
Bitcoin’s Lightning Network adopts this solution. In simple terms, a Lightning Network channel can be understood as a multi-signature address. After Bob and Alice deposit BTC into this channel (address) on the mainnet, they can carry out daily transactions through the Lightning Network.
These daily transactions do not occur on the mainnet, thus saving expensive gas fees. When both parties decide that they will no longer engage in transactions, they can initiate a withdrawal command to the mainnet. The signature of this command can prove the authenticity of a series of transactions outside the mainnet to the Bitcoin mainnet.
At this moment, the mainnet’s security consensus will intervene to settle and provide funds to Bob and Alice. Therefore, transactions that occur on the Lightning Network have the same level of security as the Bitcoin mainnet. However, currently, this solution has not implemented smart contracts as a precedent.
Further reading:
Seven years of perfecting “Bitcoin Lightning Network”: A comprehensive analysis of challenges and future prospects
Rollups may be more familiar. Optimistic Rollups and Zero-Knowledge Rollups on Ethereum are Layer 2 expansion suite solutions aimed at moving complex execution and state storage processes to Layer 2 to increase throughput.
In simple terms, the mainnet will verify the proofs submitted to the mainnet by Layer 2 on a regular basis to ensure the authenticity of the Layer 2 ledger (this verification process is particularly important).
In this way, the mainnet can “instantly” control the L2 ledger. When funds return from L2 to the mainnet, the security consensus of the ETH mainnet will intervene. The mainnet’s Layer 2 withdrawal contract can verify whether the withdrawal is possible based solely on the data generated by the mainnet consensus, without relying on third-party information sources.
Reading up to this point, many readers may realize that the essence of traditional Layer 2 is a cross-chain bridge with the same security as the mainnet. With this awareness, we can distinguish sidechains well.
Sidechains refer to establishing an independent blockchain network (such as BSC) outside the mainnet. The consensus of the mainnet cannot verify the legitimacy of cross-chain behavior on the sidechain.
Cross-chain bridges to sidechains lock assets on the mainnet and reflect them onto the sidechain. Then, the reflected assets on the sidechain can be used for transaction transfers and other functions. When the sidechain returns to the mainnet, the mainnet’s cross-chain bridge contract only verifies the authenticity of the withdrawal messages sent by the sidechain, not the sidechain’s ledger.
In other words, if the cross-chain bridge project misbehaves, maliciously signs, or the sidechain directly creates fake ledgers, the funds on the mainnet will be at risk.
It is not difficult to see that if we observe whether the mainnet can verify the ledger outside the mainnet, we can determine whether a chain is a crucial Layer 2.
With this concept, it is not difficult to explain why even though Ethereum was launched later than Bitcoin, it achieved a counter-attack and made Layer 2 ahead of Bitcoin.
Further reading:
Ethereum Layer 2 | Matic’s 100-fold surge this year! Why do DeFi projects migrate to the sidechain Polygon?
Technical challenges of BTC Layer 2 —— Verification
To understand the technical challenges of BTC Layer 2, we must first understand the BTC Taproot upgrade that creates possibilities for BTC Layer 2.
Taproot was first proposed by Bitcoin Core contributor Gregory Maxwell in 2018. Taproot is an improvement to the Bitcoin protocol, aiming to enhance the privacy and efficiency of Bitcoin transactions.
The core idea of Taproot is to make transactions under various conditions appear as ordinary single-signature transactions, thereby reducing the consumption and leakage of on-chain data and executing complex transactions (multi-signature, time locks) like a single Bitcoin transaction.
The Taproot upgrade introduces two important technologies to create possibilities for future BTC Layer 2.
1) MAST (Merklized Abstract Syntax Tree)
2) Schnorr signature
MAST decomposes complex scripts into multiple subscripts and organizes them into a Merkle tree structure. Only when the conditions of a certain subscript are met, the hash value and content of that subscript need to be revealed. This saves space, increases flexibility, and enhances privacy.
Schnorr signature is a digital signature algorithm that can combine multiple signers into a single signer and generate a single signature. This simplifies multi-signature transactions, reduces costs, improves security, and increases privacy.
MAST (Merklized Abstract Syntax Tree)
The significance of MAST lies in using Taproot to enable complex smart contracts to execute on Layer 2, thereby improving scalability and privacy.Before the upgrade, in order to achieve complex script conditions, we could only use P2SH addresses and generate redemption scripts with the same hash value and include them in transactions.
However, for complex conditions in P2SH, the transaction size becomes extremely large. In P2SH addresses, BTC requires generating redemption scripts with the same hash value and including them in transactions. If there are too many spending conditions specified in the script, the transaction size becomes extremely large.
MAST can solve the above problem well, which is why BTC Layer 2 development is possible.
MAST is a mechanism that combines Merkel Trees and Abstract Syntax Trees. It is similar to P2SH, which pays for scripts with specified hash values, but MAST pays for scripts with specified Merkel root hash values.
MAST assembles a large set of conditions into a hash tree, which is called the Merkel tree. In this tree, each node is a hash value calculated from its child nodes.
The root of the tree is a hash value that represents the collection of all conditions. This way, only the root hash needs to be included in the transaction, and all conditions do not need to be listed, 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 calculation, generating a new set of hash values. This process of pairwise hash calculation is repeated until the final hash value is calculated.
This hash value is the Merkel root.
MAST can associate Bitcoin transactions with a Merkel tree, where each leaf node on the tree represents a condition for unlocking Bitcoin.
To spend these locked Bitcoins, a unlocking script must be constructed that satisfies a condition corresponding to a path on the Merkel tree.
The network only needs to verify whether the condition corresponding to this script belongs to the original condition set of the Merkel tree, that is, whether this condition exists on the Merkel tree.
Once the network confirms that this script (and the corresponding condition) belongs to the Merkel root, it knows that this script meets the requirements for locking Bitcoin, and then proceeds to verify this unlocking script. This way, we do not need to include the complete script in the transaction, reducing the size of Bitcoin transactions.
It should be noted that although MAST greatly reduces the space occupied by transaction scripts and provides the possibility of complex on-chain operations, the logic that can be implemented by this structure is relatively limited. Therefore, claims that “MAST can achieve smart contract-like functionality on Bitcoin” are inaccurate.
Currently, the Bitcoin mainnet does not support the implementation of ledger validation functionality similar to Ethereum Layer 2, which means that BTC Layer 2 cannot simply copy the technical architecture of ETH Layer 2. To ensure the security of cross-chain bridges, alternative approaches are needed.
If Schnorr signatures and MAST are combined, it can provide a new approach for cross-chain bridges from the BTC mainnet to Layer 2. This technology is also the mainstream technical solution for current BTC Layer 2 projects.
Schnorr Signatures
Schnorr signatures are a digital signature scheme proposed by Claus Schnorr, known for its simplicity and efficiency. Its advantage is that it can aggregate multiple signatures into a single signature, optimizing the verification and authentication process in multi-signature scenarios.
For example, in a multi-signature transaction that requires 12 signatures, each signature may require 20 bytes of storage. Therefore, a total of 240 bytes is needed to store these 12 signatures.
Schnorr signatures can combine these 12 signatures into a unified Schnorr signature, which only requires about 60 bytes of space. This saves a lot of storage space, which can be used to accommodate more transaction script information.
Schnorr signatures provide privacy protection for all n-n multi-signature contracts. The most typical application is the Lightning Network payment channel, which is essentially a 2-2 multi-signature contract.
For general m-n (m ≤ n) multi-signatures, taking 2-3 multi-signature as an example, it is equivalent to A, B unlocking or B, C unlocking or A, C unlocking three scenarios. This can be seen as a multi-condition script, where each condition is a 2-2 multi-signature, so it can also be defined using aggregated public keys instead of explicit multi-signatures.
This is the basis for current cross-chain technologies such as STX, BEVM: by establishing BTC addresses controlled by hundreds of layer 2 nodes.
In summary, the BTC Layer 2 solution cannot simply replicate the design of Ethereum Layer 2 due to inherent differences between the two. To plan the correct path forward, the BTC Layer 2 solution should focus on the core essence of security while considering the unique properties of Bitcoin.
The Bitcoin base layer adopts a simple UTXO model and has limited block space.
As mentioned earlier, even with MAST, the BTC mainnet still cannot implement overly complex OP/ZKP verification logic.
This means that, unlike Ethereum Rollup, Bitcoin Layer 2 solutions cannot regularly submit responsibility records for verification on the chain. Storing data on the Bitcoin blockchain can only serve as availability checkpoints and cannot be used for actual verification.
This is currently a concern in the market. For BTC believers, without BTC consensus participation in verification, the narrative of BTC Layer 2 is lost. For ETH users, the security of the technology solution is weaker than ETH Rollup and may not be very attractive.
Decentralized cross-chain capability
This is a crucial definition for Layer 2. Implementing a cross-chain bridge on the BTC mainnet that is secure equivalent to the mainnet consensus is challenging. Current traditional Bitcoin cross-chain technologies, such as hash/time locks, pegs, swaps, and multi-signatures, cannot provide sufficient trust guarantees.
The combination of MAST contracts and Schnorr signatures introduced in the Taproot upgrade on the Bitcoin network in 2021 brings hope for decentralized Bitcoin cross-chain bridges and is a major breakthrough in realizing BTC Layer 2.
Compared to on-chain verification in Rollups, the current direction for BTC Layer 2 teams under development is to maximize the security of cross-chain bridge signatures.
As for achieving a perfect Layer 2, only Bitcoin can upgrade the BIP layer, with miners updating the underlying code to support OP/ZKP verification and Bitcoin miners’ computation execution, in order to achieve a Layer 2 solution similar to ETH Rollup. It should be noted that this will take a very long time and may never be adopted by miners.
Related Report
The first Bitcoin oracle, Alex Labs, opens the door to BTC DeFi
The true trilemma of Bitcoin Layer 2: Lightning Network, Stacks, Rootstock…
In-depth exploration of the differences between Layer 2 and L2 Rollup, the way forward for the Bitcoin ecosystem