Author: Caliber; Compiler: TechFlow
In the complex field of financial technology, Bitcoin, as an innovative digital currency, enables direct peer-to-peer transactions by bypassing traditional financial intermediaries. However, as it develops, Bitcoin also faces a series of inherent challenges, especially those related to scalability and transaction throughput, which are the main obstacles on the road to its wider application.
These challenges are not unique to Bitcoin. Although Ethereum is designed with more flexible application development capabilities, it also has similar problems. To solve these problems, many solutions have been proposed, such as side chains, Layer 2, or payment channel networks. In Ethereum, the Layer 2 ecosystem is expanding rapidly, with a variety of solutions emerging, such as EVM rollups, side chains transitioning to rollups, and projects pursuing different degrees of decentralization and security. The security issues of Layer 2 solutions, especially asset protection and the ability of these systems to read and adapt to changes in the Ethereum blockchain, highlight a key trade-off: higher security often comes at the expense of scalability and cost-effectiveness.
While Bitcoin has made impressive progress in improving its functionality, there are still some significant challenges in developing Layer 2 solutions similar to Ethereum. Bitcoin's design limitations are particularly evident in ensuring the security of withdrawals in Layer 2 solutions. Its limited scripting language and lack of Turing completeness limit its ability to perform complex calculations and support advanced features. This design choice prioritizes Bitcoin's security and efficiency, but limits its programmability relative to more flexible blockchain platforms such as Ethereum. And probabilistic finality may also weaken the reliability and speed required for Layer 2 solutions, potentially leading to issues such as chain reorganizations that affect the permanence of transactions. Although Bitcoin's design principles make it reliable and secure, these factors make it difficult for its Layer 2 system to quickly adapt to new changes.
Segregated Witness (SegWit) and Taproot are transformative for Bitcoin. SegWit optimizes Bitcoin's infrastructure by separating signature data, increasing transaction speeds and supporting fast payment processing on the Lightning Network. Subsequent Taproot introduced improvements in efficiency and privacy by compressing transaction data and masking transaction complexity. Together, SegWit and Taproot ignited a new wave of Layer 2 innovation and became the foundation for future Layer 2 designs, significantly expanding Bitcoin's functionality as a digital currency.
Understanding Bitcoin's Layer 2 Solutions
Bitcoin's Layer 2 Trilemma
In Bitcoin's growing Layer 2 solutions, we see many different systems emerging that aim to improve scalability and increase adoption. These solutions offer unique approaches to overcoming Bitcoin's inherent limitations. Trevor Owens proposed a classification method to classify these solutions according to how they solve the Bitcoin Layer 2 trilemma, dividing them into off-chain networks, decentralized sidechains, and federated sidechains, each with unique approaches and trade-offs:
Off-chain networks: Prioritize scalability and privacy, but may bring challenges to user experience. For example, Lightning&RGB.
Decentralized sidechains: Introduce new tokens and consensus mechanisms, expand functionality, but may complicate user experience and increase centralization concerns. For example, Stacks,Babylon,Interlay, etc.
Joint sidechain: Simplifies operations through a trusted consortium, providing efficiency, but may be at the expense of Bitcoin's basic decentralization. For example, Liquid,Rootstock,Botanix.
This trilemma provides a useful way to categorize Bitcoin's Layer 2 solutions, but may not fully capture all the complex details of its design. In addition, it points out the trade-offs of current solutions rather than unsolvable obstacles, indicating that elements of these trilemmas are part of the decision-making process of developers.
For example, decentralized sidechains issue new tokens to increase security and promote network participation, which may make user interaction more complicated and may not be welcomed by Bitcoin purists. On the other hand, joint sidechains choose to skip new tokens, making the user experience smoother and reducing resistance within the Bitcoin community. Another option is to use full VM/global state, which allows the implementation of complex functions, including the creation of new tokens on the smart contract platform. However, this approach makes the system more complex and generally increases its risk of attack.
Technical Classification
From another technical perspective, we classify Bitcoin's Layer 2 solutions based on their main technical characteristics. This different classification approach examines various technical details and structures, providing a nuanced understanding of how each solution contributes to enhancing Bitcoin's scalability, security, and functionality. Each approach has its own unique purpose, which is not in conflict and does not create a trilemma. However, each approach has its own advantages and disadvantages in terms of security and scalability. Therefore, some systems may combine these approaches. We will discuss this in detail in the next part of the article. Let's explore these categories:
Sidechains using a two-way anchoring protocol.These sidechains are connected to Bitcoin like Layer 2 through a method called a two-way anchoring. This setup allows Bitcoin to be transferred between the main chain and the sidechain, supporting experiments and implementing features that the main chain does not directly support. This approach improves Bitcoin's ability to handle more transactions and different types of applications by supporting a wider range of uses. The two-way peg mechanism plays a key role in transferring BTC value to sidechains. On these sidechains, developers set up various environments; some choose to use EVM-compatible ecosystems, while others choose to create VM environments with their own smart contracts. For example, Stacks,Rootstock,Liquid,Botanix, etc.
Blockchain rollups. This approach uses Bitcoin as a layer to store data, providing inspiration for rollup technology. In this setting, each UTXO is like a small canvas where more complex information can be written. Imagine that each Bitcoin can store its own detailed data set, which not only increases value, but also expands the types of data and assets that Bitcoin can handle. It opens up a wide range of possibilities for digital interaction and representation, making the Bitcoin ecosystem richer and more diverse. For example, B2 network, BitVM
Payment channel network. These networks are like fast lane networks in the vast landscape of Bitcoin. They help speed up a large number of transactions on the Bitcoin side roads, reduce congestion, and ensure that transactions are both fast and economical. For example, Lightning &RGB.
By breaking it down this way, we can get a clearer picture of how each tool helps improve Bitcoin, making it more scalable, secure, and versatile. Let's take a deeper look at these tools:
Two-way anchoring protocol
Two-way anchoring allows assets to be transferred between two independent blockchains (usually a main chain and a side chain). This system enables assets to be locked on one chain and then unlocked or minted on another chain, maintaining a fixed conversion rate between the original asset and the anchored asset.
Understanding the anchoring process
Imagine that you want to transfer assets on the main chain (such as Bitcoin) to the side chain. The anchoring process is your starting point. Here, your assets are securely locked on the main chain, similar to depositing them in a vault for safety. Subsequently, a transaction is created on the main chain to consolidate this lock. After the side chain recognizes this transaction, it mints an equal amount of anchored assets. This process is similar to receiving a certificate of equal value in a foreign land, enabling you to use your wealth in a new environment while ensuring that your original assets remain intact and safe.
Guiding the anchoring process
The anchoring process begins when you decide to restore your assets to the original main chain. This return process involves "burning" or locking the anchored assets on the sidechain, meaning that they are set aside on the sidechain and are no longer in circulation. You then provide proof of this action to the mainchain. Once the mainchain verifies your claim, it releases an equal amount of the original assets to you. This mechanism ensures the integrity and balance of the distribution of assets between the two blockchains, preventing duplication or loss.
Implementation of the Two-Way Anchor System
Rootstock
RSK's two-way anchor system is an advanced framework designed to seamlessly integrate Bitcoin with smart contract functionality through RSK's platform. By using SPV for efficient transaction verification, adopting a robust federation model for transaction approval, and integrating SegWit and Taproot, RSK not only improves transaction efficiency, but also closely aligns with Bitcoin's security model. In addition, the merged mining method increases the security of the system and incentivizes more miners to participate.
RSK federation model. Pegnatories (a selected functional group) are the bridge keepers or trust keepers in this federation model, ensuring that every anchor-in and anchor-out adheres to the protocol. Think of them as a committee of keepers, each holding the keys to a collective vault. Their role is critical - they ensure that every cross-bridge transaction follows integrity and consensus, maintaining the safe and orderly flow of digital assets in this critical channel.
Segwit and Taproot. SegWit reduces transaction size and increases processing speed by separating signature information from transaction data. In addition, combined with the Schnorr signature scheme and other enhancements to MAST (Merkelized Abstract Syntax Trees) and Taproot, transactions can be made more efficient and private.
RSK merged mining. In RSK’s merged mining approach, miners simultaneously secure both Bitcoin and the RSK network without additional computational requirements, thereby increasing the security of RSK. This approach leverages Bitcoin’s mining intensity to provide additional rewards to miners, demonstrating an innovative use of existing blockchain infrastructure. However, the success of this integration relies on accurately aligning tags within Bitcoin blocks with RSK blocks, highlighting the importance of detailed and precise execution to maintain the security and consistency of the interconnected network.
Botanix
Botanix combines Bitcoin-based Proof-of-Stake (PoS) consensus with the decentralized EVM network Spiderchain multi-signature architecture to manage Turing-complete smart contracts off-chain. With Bitcoin as the primary settlement layer, Botanix ensures transaction integrity through advanced multi-signature wallets and off-chain cryptographic verification.
Spiderchain, is a distributed multi-signature network responsible for custody of all actual Bitcoin on Botanix.
Architecture:Spiderchain consists of a set of coordinating nodes (node operators and source of liquidity for the entire chain). It consists of a sequentially ordered multi-signature wallet responsible for managing custody of assets within the network. Transactions in each wallet require approval from multiple coordinating nodes to ensure there is no single point of failure.
Dynamic Operation. For each new Bitcoin block, a Verifiable Random Function (VRF) based on the Bitcoin block hash is used to determine the corresponding coordinating node for the upcoming "cycle" (defined in the Botanix system as the period between Bitcoin blocks). Subsequently, fairness and randomness of the selection of the coordinating nodes is ensured by hashing the block hash with SHA256 and then applying a modulo operation with the number of active coordinating nodes (N). This ensures a fair and secure distribution of operational tasks, minimizing centralization risks.
Two-way peg system. The multi-signature wallet plays a key role here, requiring consensus between the selected coordinating nodes to execute any transaction.
Anchor-in process. The user sends Bitcoin to a new multi-signature wallet, which is securely locked. This action mints an equal amount of synthetic BTC on the Botanix chain. Creating this wallet requires multiple coordinating nodes, who must all agree and sign, ensuring that no one can independently control the wallet.
Anchor-out process. Conversely, for a peg-out, the synthetic BTC is destroyed and the corresponding bitcoin is released from the multi-signature wallet back to the user's bitcoin address. This process is secured by the same multi-signature protocol, requiring multiple coordinating nodes to approve the transaction.
PoSConsensus andEVMImplementation
Consensus. In Botanix's PoS system, coordinating nodes stake their bitcoins to participate in the network. They are responsible for validating transactions and creating new blocks on the Botanix chain. These coordinating nodes are selected based on their stake and the randomization method mentioned earlier in the Spiderchain section.
EVMImplementation. The EVM on Botanix supports all operations compatible with Ethereum, enabling developers to deploy and execute complex smart contracts.
Stacks:
The Stacks platform aims to expand Bitcoin's infrastructure through innovative mechanisms such as sBTC two-way anchoring, Proof of Transfer, and Clarity smart contracts to support smart contracts and decentralized applications (dApps).
In PoX, miners transfer BTC to the Stack network to participate, instead of burning Bitcoin as in Proof of Burn. This not only incentivizes participation through BTC rewards, but also directly links the operational stability of Stacks with the verification security properties of Bitcoin. Stacks transactions are anchored in Bitcoin blocks, and each Stacks block records a hash value in a Bitcoin transaction using the OP_RETURN opcode, which allows up to 40 bytes of arbitrary data to be embedded. This mechanism ensures that any changes to the Stacks blockchain require corresponding changes to the Bitcoin blockchain, thereby benefiting from the security of Bitcoin without changing its protocol.
Clarity. Clarity, the smart contract programming language used by the Stacks blockchain, provides predictability and security for developers by enforcing strict rules to ensure that all operations are executed as defined and avoid unexpected results. It provides decidability, and the results of each function are known before execution, preventing accidents and enhancing the reliability of contracts. In addition, Clarity interacts directly with Bitcoin transactions, allowing the development of complex applications and taking advantage of Bitcoin's security features. It also supports features similar to interfaces in other languages, helping code reuse and maintaining a clean code base.
Liquid:
Liquid Network provides a federated sidechain to the Bitcoin protocol, significantly enhancing transaction capabilities and asset management. The core concept of the Liquid Network architecture is strong federation, consisting of a group of trusted functionaries responsible for block verification and signing.
Watchmen:Watchmen manages the peg-out process from Liquid to Bitcoin, ensuring that every transaction is authorized and valid.
Key Management: Watchmen's hardware security module protects the keys required to authorize transactions.
Transaction Verification: Watchmen verifies transactions by confirming cryptographic proofs of compliance with Liquid's consensus rules, using a multi-signature scheme to enhance security.
Anchoring Mechanism:
Anchoring: Bitcoins are locked on the Bitcoin blockchain (by using Watchmen's multi-signature address), and the corresponding Liquid Bitcoin (L-BTC) is issued on the Liquid sidechain through cryptographic methods to ensure the accuracy and security of the transfer.
Anchoring: This process involves destroying L-BTC on the Liquid sidechain and releasing the corresponding Bitcoin on the Bitcoin blockchain. This mechanism is closely monitored by designated functionaries called Watchmen to ensure that only authorized transactions can be carried out.
Proof of Reserves (PoR):This is an important tool developed by Blockstream that provides transparency and trust in the network's asset holdings. PoR involves creating a partially signed Bitcoin transaction that proves control of funds. While this transaction cannot be broadcast on the Bitcoin network, it proves the existence and control of the claimed reserves. It allows an entity to prove its fund holdings without moving the funds.
Babylon:
Babylon is designed to enhance the security of PoS chains by allowing Bitcoin holders to stake their assets, integrating Bitcoin into the PoS ecosystem, leveraging Bitcoin's massive market capitalization without the need for direct transactions or smart contract functionality on the Bitcoin blockchain. Importantly, Babylon maintains the integrity and security of staked assets by avoiding the need to move or lock Bitcoin through vulnerable bridges or third-party escrows.
Bitcoin Timestamping:Babylon uses a timestamping mechanism that embeds PoS chain data directly into the Bitcoin blockchain. By anchoring PoS block hashes and key staking events on the Bitcoin immutable ledger, Babylon provides a historical timestamp that is secured by Bitcoin's extensive proof-of-work. Using the Bitcoin blockchain for timestamping leverages not only its security, but also its decentralized trust model. This approach ensures an additional layer of security against long-range attacks and state corruption.
Accountable Assertions:Babylon utilizes Accountable Assertions to manage staking contracts directly on the Bitcoin blockchain, allowing the system to disclose the private keys of stakers in the event of misconduct (such as double signing). The design uses Chameleon hash functions and Merkle trees to ensure that stakers' assertions are closely linked to their stakes, enforcing protocol integrity through cryptographic accountability mechanisms. If a staker deviates, such as signing a conflicting statement, their private key is deterministically disclosed, triggering an automatic penalty.
StakingProtocol:An important innovation of Babylon is its staking protocol, which allows for rapid adjustment of staking allocations based on market conditions and security needs. The protocol supports fast staking unwinding, enabling stakers to quickly move their assets without the long lock-up periods typically associated with PoS chains. In addition, the protocol is built as a modular plugin that is compatible with a variety of PoS consensus mechanisms. This modular approach allows Babylon to provide staking services for a wide range of PoS chains without the need to significantly modify existing protocols.
Payment Channels and Lightning Network
Payment channels are tools designed to conduct multiple transactions between two parties without immediately committing all transactions to the blockchain. They simplify transactions in the following ways:
Initial:A channel is opened with a single on-chain transaction, creating a multi-signature wallet shared by two parties.
Transaction Process:Within the channel, the two parties transact privately, adjusting their respective balances through instant transfers without broadcasting to the blockchain.
Closing:The channel is closed with another on-chain transaction, settling the final balance based on the most recent mutually agreed-upon transaction.
Explore Lightning Network
Building on the payment channel, the Lightning Network extends these concepts into a network that allows users to send payments across blockchains through connected paths.
Routing:Just like using back roads to find a path through the city, the network can find a path for the payment even if you don't have a direct channel with the final recipient.
Efficiency:This interconnected system significantly reduces transaction fees and processing time, making Bitcoin suitable for everyday transactions.
Smart Locks(HTLCs):The network uses advanced contracts called Hashed Time Lock Contracts to secure payments between different channels. It’s like making sure your delivery reaches its destination safely through several checkpoints. It also reduces the risk of intermediary default, making the network reliable.
Secure Protocols:If any disputes arise, the blockchain acts as a judge, verifying the latest agreed balances, ensuring fairness and security.
Taproot and Segwit enhance the privacy and efficiency of the Bitcoin network, especially the Lightning Network:
Taproot: Like an aggregator for Bitcoin transactions — bundling multiple signatures into one. This not only keeps off-chain transactions neat, but also makes them more private and cheaper.
Segwit: changed the way data is stored in Bitcoin transactions, allowing a block to contain more transactions. For the Lightning Network, this means cheaper and smoother opening and closing of channels, further reducing fees and increasing transaction throughput.
Layer 2 Solutions Based on Inscriptions
Inscriptions have sparked a wave of innovation in Bitcoin's Layer 2 ecosystem. With the launch of two groundbreaking updates (Segwit and Taproot), the Ordinals protocol was introduced, enabling anyone to attach additional data to the Taproot script of a UTXO, up to 4MB. This development made the community realize that Bitcoin can now serve as a data availability layer. From a security perspective, inscriptions provide a new perspective. Data, like digital artifacts, are now stored directly on the Bitcoin network, making them unchangeable and protecting them from tampering or loss due to external server issues. This not only enhances the security of digital assets, but also embeds them directly into Bitcoin's blocks, ensuring their permanence and reliability. Most importantly, Bitcoin rollups become a reality, and inscriptions provide a mechanism to add additional data or functionality to transactions. This allows for more complex interactions or state changes outside the main chain while still relying on the main chain's security model.
Implementation of Layer 2 solutions based on inscriptions
BitVM:
BitVM utilizes a combination of optimistic rollup technology and cryptographic proof design. By moving Turing-complete smart contracts off-chain, BitVM significantly improves transaction efficiency without sacrificing security. Although Bitcoin is still the base settlement layer, BitVM ensures the integrity of transaction data by cleverly utilizing Bitcoin's scripting capabilities and off-chain cryptographic verification. Currently, BitVM is being actively developed by the community. In addition, it has become a platform for several top projects such as Bitlayer and Citrea.
Inscription-like storage method: BitVM leverages Bitcoin's Taproot to embed data in Tapscript, similar to the concept of the inscription protocol. This data typically includes important computational details such as the state of the virtual machine at different checkpoints, the hash of the initial state, and the hash of the final computational result. By anchoring this Tapscript in the unspent transaction output (UTXO) stored at the Taproot address, BitVM effectively integrates transaction data directly into the Bitcoin blockchain. This approach ensures the persistence and immutability of data while protecting the integrity of recorded computations using Bitcoin's security features.
Fraud proof: BitVM uses fraud proofs to ensure the security of its transactions. Here, the prover commits to the computational result of a specific input, and this commitment is not executed on-chain but verified indirectly. If a validator suspects that a commitment is wrong, they can use Bitcoin's scripting capabilities to prove the falsity of the commitment by providing a concise fraud proof. This system significantly reduces the computational burden of the blockchain and avoids full on-chain computation, which is in line with Bitcoin's design philosophy of minimizing transaction burden and maximizing efficiency. The core of this mechanism is hash locks and digital signatures, which link statements and challenges to actual off-chain computational work. BitVM adopts an optimistic verification method - operations are assumed to be correct unless proven to the contrary, which improves efficiency and scalability. Ensure that only valid computations are accepted, and anyone in the network can independently verify their correctness using available cryptographic proofs.
Optimistic rollups:BitVM uses optimistic rollup technology to significantly improve Bitcoin's scalability by batching multiple off-chain transactions. These transactions are processed off-chain and their results are periodically recorded on the Bitcoin ledger to ensure integrity and availability. In actual operation, BitVM processes these transactions off-chain and intermittently records their results on the Bitcoin ledger to ensure integrity and availability. The optimistic rollups used in BitVM represent a way to overcome Bitcoin's inherent scalability limitations by leveraging off-chain computational power while ensuring that transaction validity is maintained through periodic on-chain verification. This system effectively balances the load between on-chain and off-chain resources, optimizing the security and efficiency of transaction processing.
Overall, BitVM is more than just another Layer 2 technology, it represents a potential fundamental shift in how Bitcoin scales and evolves. It offers a unique solution to Bitcoin's limitations, but further development and improvement are needed to fully realize its potential and gain wider acceptance within the community.
B2 Network
As the first zero-knowledge proof verified commitment rollup, the B2 Network enhances transaction speed and reduces costs for Bitcoin. This setup allows Turing-complete smart contracts to be executed off-chain, significantly improving efficiency. Bitcoin serves as the basic settlement layer of the B2 Network, storing B2 rollup data. This setup allows for full retrieval or recovery of B2 rollup transactions using Bitcoin inscriptions. Additionally, the computational validity of B2 rollup transactions is verified via zero-knowledge proof confirmations on Bitcoin.
Important Role of Inscriptions:The B2 network leverages Bitcoin inscriptions to embed additional data into Tapscript, including the storage path of the rollup data, the Merkle root hash of the rollup data, the zero-knowledge proof data, and the parent B2 inscription UTXO hash. By writing this Tapscript to a UTXO and sending it to a Taproot address, B2 effectively embeds the rollup data directly into the Bitcoin blockchain. This approach not only ensures data persistence and immutability, but also protects the integrity of the rollup data using Bitcoin’s strong security mechanisms.
Zero-knowledge Proofs for Enhanced Security:B2’s commitment to security is further reflected in its use of zero-knowledge proofs. These proofs enable the network to verify transactions without exposing transaction details, thereby protecting privacy and security. In the context of B2, the network breaks down computational units into smaller units, each represented as a bit-valued commitment in a tapeleaf script. These commitments are linked in a taproot structure, providing a compact and secure method for verifying the validity of transactions on the Bitcoin and B2 networks.
Rollup technology improves scalability:At the heart of the B2 architecture is rollup technology, specifically ZK-Rollup, which aggregates multiple off-chain transactions into one. This approach significantly improves throughput and reduces transaction fees, solving Bitcoin's most pressing scalability problem. The B2 network's rollup layer processes user transactions and generates corresponding proofs, ensuring that transactions are verified and finalized on the Bitcoin blockchain.
Challenge-Response Mechanism:In the B2 network, after batching and validating transactions using zk-proofs, nodes have the opportunity to challenge them if they suspect that the batches contain invalid transactions. This critical stage utilizes a fraud proof mechanism, and the challenge must be concluded before the batch can proceed. This step ensures that only transactions that are verified as legitimate can proceed to final confirmation. If there are no challenges or existing challenges fail within the specified time lock, the batch will be confirmed on the Bitcoin blockchain. On the other hand, if any challenge is verified, the rollup will be subsequently restored.
Final Thoughts
Advantages
UnlockingDeFiMarket:By enabling features such as EVM-compatible Layer 2 solutions, Bitcoin can access the multi-billion dollar DeFi market. This not only expands the utility of Bitcoin, but also unlocks new financial markets that were previously only accessible through Ethereum and similar programmable blockchains.
Expanded usage scenarios:These Layer 2 platforms support not only financial transactions, but also various applications in fields such as finance, games, NFTs, or identity systems, thereby greatly expanding the original scope of Bitcoin as a simple currency [3, 4, 5].
Disadvantages
Centralization risk:Some Layer 2 solutions involve mechanisms that may lead to increased centralization. For example, in the mechanism that requires locking the value of BTC, unlike Ethereum's Layer 2 solution, Layer 2's interaction with Bitcoin is not protected by the Bitcoin security model. Instead, it relies on a smaller decentralized network or federation model, which may weaken the security of the trust model. This structural difference may introduce failure points that do not exist in the decentralized model.
Increased transaction fees and blockchain bloat:Data-intensive uses (such as Ordinals and other inscription protocols) can cause blockchain bloat, slowing down the network and increasing transaction costs for users. This can result in higher costs and slower transaction verification times, impacting the efficiency of the network.
User Experience and Technical Complexity:The technical complexity of understanding and interacting with Layer 2 solutions can be a significant barrier to adoption. Users will need to manage additional elements like payment channels on the Lightning Network or handle different token types on platforms like Liquid.
The Ugly Side
Regulatory and ethical issues:The immutability of inscriptions, while a technical advantage, also raises potential regulatory and ethical issues. This presents significant challenges if the data is illegal, unethical, or simply wrong, leading to permanent consequences without remedies.
Fungibility impact: If some bitcoins are “tokenized” as non-financial data, this could affect their fungibility — each unit is supposed to be indistinguishable — and could lead to a situation where some bitcoins are less valuable or accepted than others.