Bitlayer Network: The Computational Layer for Bitcoin
Abstract
Bitcoin's limited transaction throughput and programmability hinder its potential in Decentralized Finance (DeFi). Existing Layer 2 solutions often introduce new trust assumptions, failing to anchor their security directly to Bitcoin's consensus. This paper introduces Bitlayer, a Layer 2 network that solves this challenge using the BitVM paradigm. Our core contribution is a novel, recursive verification protocol that, for the first time, enables a continuous chain of Layer 2 state transitions to be verifiably settled on Bitcoin. This moves beyond mere data inscription to achieve security rooted in Bitcoin's proof-of-work. Furthermore, we deeply integrate BitVM bridge with our rollup protocol to enable secure transfers of Bitcoin assets. Finally, we designed a modular and Turing-complete execution engine, which, powered by a fast consensus mechanism, provides users with sub-second soft finality. Bitlayer unlocks Bitcoin's vast, untapped capital for a new generation of decentralized applications, laying a foundational infrastructure for the Bitcoin DeFi ecosystem.
1. Introduction
Bitcoin [1] holds immense potential for Decentralized Finance (DeFi), but its core design limits transaction throughput and programmability. Activating Bitcoin's vast, untapped capital thus depends on secure and scalable Layer 2 solutions.
However, existing approaches to scaling Bitcoin fall short. Sidechains that rely on federated multisignatures introduce centralized trust, fundamentally undermining Bitcoin's security model. Meanwhile, early rollup designs for Bitcoin can post transaction data to the L1 but lack a mechanism to enforce the validity of state transitions on-chain. This leaves them vulnerable, as their security is not fully guaranteed by Bitcoin's consensus.
This raises a critical question: is it possible to build a Bitcoin L2 that achieves scalable computation while ensuring state validity is enforced by the Bitcoin mainnet itself, without new trust assumptions?
This paper introduces Bitlayer, a Layer 2 network that provides an affirmative answer through rollup architecture [7]. and the BitVM paradigm [2]. overcoming the limitations of both the Bitcoin and existing Layer 2 solutions by enabling scalable computation while anchoring its security to the underlying Bitcoin blockchain. Our primary contributions are as follows:
- A Modular and Turing-Complete Execution Layer: We design and implement a modular execution layer that enables Turing-complete smart contracts, leveraging a meticulously designed blockchain protocol to achieve sub-second soft finality and provide a responsive experience ideal for demanding applications like DeFi and gaming.
- A Recursive Bitcoin Settlement Protocol for Rollups: We design and formalize the first rollup protocol that uses a recursive BitVM-based framework to settle a continuous claim chain of Layer 2 state transitions on Bitcoin. This provides security by anchoring the L2's validity directly to the L1.
- A Synergistic Integration of Bridge and Rollup: We design and implement a secure asset bridge inspired by the BitVM bridge architecture. The core innovation is its deep integration with our rollup protocol, which ensures that asset security and rollup validity are governed by a unified trust model, enabling seamless and secure asset transfers.
2. Network Architecture
Bitlayer operates on a dual-level architecture that combines a Proof-of-Stake (PoS) consensus for fast block production with a rollup framework that anchors its security to the Bitcoin network. The PoS layer allows validators to sequence transactions and produce blocks rapidly, providing a high-throughput, EVM-compatible environment. The rollup layer then periodically commits and settles the state of this L2 chain onto the Bitcoin blockchain. This design leverages Bitcoin as the ultimate layer for security and data availability, while Bitlayer Network serves as a scalable and efficient computational layer.
2.1. Network Participants and Roles
The network is maintained by two key participants: Validators, and Full Nodes.
- Validators: Validators form the backbone of the PoS consensus. They are responsible for producing and validating L2 blocks, ensuring the network's safety and liveness. To join the validator set, a candidate must stake BTR tokens, and their influence in the consensus is proportional to their total stake, which can include tokens delegated by other BTR holders.
- Rollup Operator: The Rollup Operator is a specialized, rotating role assigned to a single validator from the set. This operator is responsible for bundling L2 state transitions into batches, generating cryptographic proofs, and submitting them for settlement on the Bitcoin L1. To ensure accountability and disincentivize fraud, the operator must lock a significant amount of BTC as collateral on L1. The operator role rotates periodically to prevent censorship and centralization.
- Full Nodes: Full nodes maintain a complete copy of the Bitlayer Network blockchain, independently verifying all transactions and state transitions without trusting validators. They play a crucial role in enforcing the protocol rules and ensuring network transparency.
2.2. Dual-Level Transaction Finality
Bitlayer offers a dual-level finality model, giving users and applications a choice between speed and Bitcoin-level security.
- Soft Finality: A transaction achieves soft finality in sub-second once the block containing it is confirmed by Bitlayer's PoS consensus. This provides a fast and responsive user experience, with security backed by the economic stake of the validator set.
- Hard Finality: Hard finality is the highest security guarantee, achieved when the L2 state containing the transaction is settled and finalized on the Bitcoin blockchain. Due to the optimistic rollup's challenge period, this takes approximately seven days. The security for hard finality relies on only a single honest party to challenge fraud, making it nearly equivalent to Bitcoin's own security.
In the rare event of a successful L1 challenge that creates a discrepancy between the L2 state and the settled L1 state, the protocol is designed to halt. The network's recovery would then be guided by social consensus among stakeholders to ensure the integrity of user assets.
3. Settling L2 State on Bitcoin
As a Layer 2 rollup, Bitlayer derives its security from Bitcoin. This chapter details the core mechanism that underpins this relationship: settlement. Settlement is the process by which L2 state transitions, executed in Bitlayer's high-throughput environment, are committed to and finalized on the Bitcoin L1. This allows Bitlayer to inherit Bitcoin's security guarantees. The challenge, however, is achieving this on Bitcoin's constrained, non-Turing-complete script environment.
Our solution is a novel settlement protocol inspired by the BitVM paradigm. This chapter systematically deconstructs this protocol. We first define the concepts of a state claim and explain our hybrid verification approach. After introducing the necessary cryptographic primitives, we detail the protocol for settling a single state claim. Finally, we show how this is extended into a recursive protocol that settles a continuous chain of L2 claims, forming the backbone of the entire rollup.
3.1. Defining the L2 State Claim
At its core, a blockchain is defined by a State Transition Function (STF), denoted as . This deterministic function dictates how the network's State () evolves. A state, which includes all account balances and contract data, is represented by a 32-byte Merkle root. The STF takes the current state and a batch of L2 Transaction Batch () to produce the next state :
where is the index of transaction batch. The entire history of the blockchain unfolds from an initial genesis state ().
A State Claim () is a formal assertion submitted by a Rollup Operator to a smart contract on the Bitcoin L1. Its purpose is to commit to a new L2 state that has resulted from processing a specific transaction batch. This claim acts as the anchor, linking L2 activity to the L1 and enabling Bitlayer Network to inherit Bitcoin's security.
3.2. Cryptographic Primitives
The settlement protocol relies heavily on two advanced cryptographic primitives: Succinct Non-interactive Arguments (SNARGs) and Hash-based One-Time Signature scheme.
3.2.1. Groth16 SNARG
Following the Groth16 paper [4], a SNARG for a relation consists of three probabilistic polynomial-time algorithms (Setup
, Prove
, Vfy
):
- : A setup algorithm that produces a common reference string for a given relation.
- : A prover algorithm that, given the common reference string , a claim , and a witness , generates a proof argument .
- : A verification algorithm that accepts or rejects the proof.
The SNARG satisfies perfect completeness, computational soundness, and what we define as full succinctness.
Definition 3.1 (Full Succinctness): A protocol (Setup
, Prove
, Vfy
) is fully succinct if the verifier Vfy
runs in time polynomial in the security parameter , and the size of the proof is also polynomial in .
3.2.2. Hash-based One-Time Signature (HOTS)
The Bitcoin script language, with its OP_CHECKSIG
opcode [6], is designed to verify signatures for transactions, not for arbitrary off-chain messages. While proposals like BIP348 exist to extend this functionality, they require a network consensus change. To overcome this limitation, We utilize a Hash-based One-Time Signature scheme (HOTS
) [5, 8]. This approach is particularly advantageous as hash functions are native and computationally inexpensive operations within Bitcoin script.
Our variant of HOTS
consists of four algorithms:
- : Generates a secret key and public key pair from a security parameter.
s
: Publishes a commitment to the Bitcoin script, preparing it to verify a signature for a message of length .w
: Signs a message with the secret key to produce a witnessw
.- : Verifies the witness
w
. If valid, it returns1
and reveals the original message on the stack for further on-chain processing.
This final property—the on-chain revelation of the signed message—is a critical component for linking consecutive state claims, as will be detailed in Section 3.5.
3.3. Protocol Overview
The entire settlement protocol is embodied in a BitVM-style smart contract, which is not a single, monolithic contract but rather a complex graph of pre-signed Bitcoin transactions. Participants must jointly pre-sign this transaction graph and are bound to interact strictly according to its predefined pathways. Whereas the original BitVM protocol focused on settling claims about events on both external chain and the Bitcoin for bridging purposes [3], Bitlayer's protocol is more intricate. It must settle a continuous sequence of claims, each representing a discrete change in the L2 state, and guarantee that this sequence is consecutive and unbroken.
The protocol can be conceptualized as a recursive structure. In Section 3.4, we will first elaborate on the sub-protocol for settling a single state claim. Then, in Section 3.5, we will detail how this single-claim verification mechanism is recursively embedded within a broader protocol that settles a continuous chain of claims. By combining these two components, we construct the complete rollup protocol for settling the Bitlayer Network state on Bitcoin.
3.4. Settling a Single Claim
3.4.1. The BitVM2 Paradigm
The on-chain verification of a claim is conducted optimistically. The verifier program in our case is expressed in Bitcoin script. However, as demonstrated by the groundbreaking work of the BitVM Alliance on a Groth16 verifier, a monolithic implementation of such a verifier is far too large to execute directly within a single Bitcoin transaction. Therefore, the BitVM2 paradigm [2] splits the large verifier program into a chain of smaller sub-programs, or "chunks." The protocol then proceeds as a fraud-proof game, where it is assumed the operator's claim is correct unless a challenger can pinpoint an incorrect computation step between two specific chunks.
3.4.2. Protocol Roles
The BitVM smart contract for claim settlement involves a well-defined set of participants:
- Attesting Committee: Rather than forming a new entity, the existing validator set of the Bitlayer Network serves as the attesting committee. This committee is collectively responsible for pre-signing the transaction graph that defines the protocol.
- Protocol Participants: The active participants in the settlement game include a single, designated Operator responsible for submitting claims and any number of Watchers. Watchers can be anyone, including other validators, and their role is to monitor the operator and challenge fraudulent claims.
3.4.3. Single Claim Verification Protocol
The protocol for verifying a single claim unfolds as a timed challenge-response game governed by Bitcoin time locks. It ensures that both the Operator and any Watcher must act within specified time bounds or face penalties. The protocol can be broken down into three primary stages, which correspond to a series of interconnected Bitcoin transactions pre-signed by the Attesting Committee.
1. Setup Stage
Before the game begins, a trusted public setup generates the necessary scripts. The STF () is used to create a common reference string via SNARG.Setup
. The verifier program is split into a set of smaller sub-programs . Three types of locking scripts are created: a Claim Script
to initiate the process, an Assert Script
for the Operator to post results of all , and a set of Disprove Scripts
, one for each sub-program, which Watchers can use to prove fraud. The Claim Script and Assert Script are composed of multiple HOTS, which force operator to post signed claim and results of all sub-programs. The Disprove Scripts include all sub-programs and are organized within a Taproot address. These scripts are then embedded into the outputs of the pre-signed transaction graph.
2. Claim Stage The Operator initiates the process by publishing a Claim transaction, which spends from a previous UTXO and locks their collateral (e.g., BTC). To unlock this input, the Operator must use their HOTS key to sign and reveal the state claim . This action starts a timer, . Watchers observe this claim and can run the STF locally. If they find the claim to be invalid, they can issue a Challenge transaction before the timeout. If no challenge occurs, the Operator reclaims their collateral via an Optimistic Acceptance transaction, and the claim is considered settled.
3. Challenge and Resolution Stage If a Watcher issues a Challenge transaction (which may require them to post a smaller collateral, BTC, to deter frivolous challenges), the pessimistic path is taken. The Operator is now compelled to execute an Assert transaction. In doing so, they must run the chunked verifier program locally and use their HOTS key to sign and publish the results of all sub-programs . This action starts another timer, .
The Watcher now examines the sequence of results published by the Operator. If the Watcher can find a single sub-program where the Operator's published output is inconsistent with the execution of on the Operator's published inputs, they have found fraud. The Watcher can then construct a Disprove transaction. This transaction spends the output corresponding to the fraudulent sub-program, executing that small chunk of logic on-chain to prove the inconsistency. A successful Disprove transaction forfeits the Operator's collateral, a portion of which ( BTC, where ) is awarded to the Watcher. If the Operator correctly publishes results of all , and the Watcher fails to submit a valid Disprove transaction in time, the Operator can finalize the claim via an Acceptance transaction and recover their collateral.
3.4.4. Security Properties
This protocol is designed to be secure under the assumption of at least one honest Watcher. Its security rests on three key properties, which are analyzed in detail in Chapter 6.2.
- Completeness: An honest Operator who correctly follows the protocol and submits valid state claims will never be unjustly penalized.
- Soundness: A dishonest Operator who submits a fraudulent claim cannot avoid being penalized, as an honest Watcher will always be able to construct a valid Disprove transaction.
- Efficiency: The entire claim verification process, whether it results in acceptance or rejection, is guaranteed to terminate within a bounded timeframe defined by the protocol's time locks.
3.5. Settling a Chain of Claims
The protocol described above is sufficient for settling a single, isolated claim. However, a rollup requires the continuous settlement of a sequence of claims that represents the ongoing evolution of the L2 state. This is achieved by extending the protocol to recursively chain claims together.
3.5.1. Linking Claims with HOTS
The key to chaining claims lies in the transaction graph's structure. Each Claim transaction, in addition to its other outputs, creates a special UTXO called a claim connector. To submit the next claim (Claim ), the Operator must spend the claim connector UTXO created by the transaction for Claim . The locking script for this connector requires the Operator to use their HOTS key to sign and reveal the data package for Claim . This design naturally links adjacent claims into a chronological and unforgeable chain, as each claim transaction can only be created by consuming an output from its direct predecessor. Bitcoin time locks are used to enforce a regular cadence, preventing the Operator from submitting claims either too quickly or too slowly.
3.5.2. The Trunk Transaction Graph and Parallel Verification
This recursive structure results in a transaction graph with a primary trunk that links the sequence of claims. At each claim on the trunk, a complete sub-graph for single-claim verification (as described in Section 3.4) branches off.
A critical feature of this design is that the submission of the next claim does not need to wait for the final resolution of the previous claim's verification sub-protocol. The Operator can submit Claim while the challenge window for Claim is still open. This parallelism is efficient but requires a mechanism to handle cascading failures. If Claim is successfully challenged, the protocol ensures that its state is invalid, which automatically invalidates the premise of all subsequent claims (). A rational Operator, upon having a claim successfully challenged, is economically incentivized to cease submitting further claims, as each would require posting collateral that is doomed to be forfeited. The trunk would then terminate via a ClaimTimeout
transaction.
3.5.3. Transaction Graph Reconfiguration and Epochs
Constructing, pre-signing, and storing a transaction graph intended to last for the entire lifecycle of the rollup (e.g., 100 years) is computationally and logistically infeasible for validators. It would also require an impossibly large amount of BTC to be locked as collateral upfront and would preclude any future protocol upgrades.
To solve these problems, we introduce Reconfiguration. The protocol's timeline is divided into discrete epochs, with each epoch consisting of a fixed number of claims (e.g., lasting for two weeks). At the transition between epochs, a reconfiguration event occurs. For each attesting ceremony, the validator set only needs to pre-sign the trunk transaction graph for the upcoming epoch. This makes the burden on validators manageable.
The Exit Window: Reconfiguration is also the point at which protocol upgrades or changes to the validator set can occur. These changes may alter the security assumptions or trust parameters of the system. To protect user sovereignty, Bitlayer provides a mandatory Exit Window. The configuration for Epoch is proposed and finalized during Epoch . This gives users the entirety of Epoch to review the new validator set and transaction graph for Epoch . If a user does not approve of the upcoming changes, they have a full epoch to exit the system by withdrawing their assets (e.g., pegging-out BTC via the BitVM Bridge) before the new configuration takes effect.
Validator Incentives: All validators are required to stake BTR tokens to participate. The pre-signing ceremony for each epoch's transaction graph is coordinated through a system contract on the L2. Failure to participate in the ceremony in a timely manner results in the forfeiture of a portion of the validator's staked BTR, strongly disincentivizing attacks designed to stall the protocol.
3.5.4. The Reconfiguration Process
The reconfiguration process is orchestrated by the L2 system contract. The designated operator prepares all necessary information for the next epoch's transaction graph, and each validator independently generates it, signs it, and submits their signature to the L2 contract. Once a supermajority () of valid signatures are collected, they are aggregated, and the attestation is complete.
This process culminates in a Reconfiguration transaction on Bitcoin. This transaction locks the aggregate collateral required for all claims in the new epoch and records the updated configuration parameters, such as the verifier program commitment , the operator's identity, and time lock values. Reconfiguration transactions must be issued immediately after pre-signing is completed to promptly announce configurations. The very first such transaction, the Epoch 0 Reconfiguration transaction, bootstraps the entire rollup protocol and records the genesis state of the Bitlayer Network.
3.6. Summary
In summary, the Bitlayer settlement protocol materializes as a perpetual, yet manageable, BitVM-style transaction graph on Bitcoin. This graph is cyclic, composed of per-epoch sub-graphs that are linked together through reconfiguration transactions. Each epoch's sub-graph contains a trunk of chronologically linked state claims, and each claim is accompanied by its own verification sub-graph—a sophisticated challenge-response game that allows any single honest participant to enforce the correctness of the L2 state. This architecture enables Bitlayer to achieve a high degree of scalability and programmability while being securely anchored to Bitcoin's unparalleled proof-of-work consensus.
4. State Transition Function and Batch Execution
While Chapter 3 established the protocol for settling a state claim on Bitcoin, this chapter defines the computational process that a claim asserts to be valid: the Bitlayer STF. A correct state transition over a batch of L2 blocks is the fundamental unit of progress for the rollup. Here, we specify the components of our unique, EVM-based STF and present the multi-stage, recursive proving pipeline that generates proofs for its execution. This entire computational process is what an Operator asserts with their claim and what any Watcher can challenge through the settlement game.
4.1. The Bitlayer Network STF
The Bitlayer Network's STF aligns with the battle-tested principles of the Ethereum EVM [9] to provide a familiar and powerful environment for developers. As a Bitcoin rollup, however, it extends the EVM with additional system-level logic and specialized contracts to address its unique requirements, such as handling bridged Bitcoin assets and processing messages from the L1.
4.1.1. Gas and Fees
Transaction fees on the Bitlayer Network are paid exclusively in BTC. This design choice provides a seamless and consistent experience for Bitcoin users, as they can use the asset they already hold without needing to acquire a new, native token for network operations. While transactions are paid for in BTC, the fee rates are extremely low, reflecting the efficiency of the Layer 2 architecture.
Bitlayer implements a multi-dimensional gas model that separates transaction costs into three distinct components:
- Execution Fee: Covers the computational cost of executing the transaction in the EVM, similar to the standard Ethereum model.
- Storage Fee: Accounts for the cost of modifying the L2 state, such as creating new accounts or updating contract storage.
The Execution and Storage Fees are distributed among the validators who secure the network. This fee distribution mechanism creates a precise and sustainable economic model.
4.1.2. Protocol Contracts
Protocol contracts are a set of special-purpose smart contracts that exist at genesis and form an integral part of the Bitlayer protocol. While their logic is central to the network's operation, implementing them as smart contracts rather than native code provides a clear interface and allows for future upgrades through the established governance procedure.
System Config Contract
The System Config contract acts as the network's central control panel, managing core protocol parameters as key-value pairs. Examples include the block gas limit (<block_gas_limit, 10,000,000>
) and validator set size.
- Reconfigurability: Most parameters can be updated via governance proposals.
- Update Cadence: The timing of these updates depends on their impact. Some parameters, like certain fee multipliers, can be adjusted at any block boundary. Others that have deeper systemic effects, such as those related to the consensus engine, can only be modified at an epoch boundary to ensure a safe and orderly transition.
- Security: Since many of these parameters are read directly by native protocol code, modifications must be carefully evaluated to ensure they do not compromise network stability or security.
Validator Management Contract This contract governs the lifecycle of the Bitlayer Network's validator set, which is crucial for both L2 block production and L1 attestation ceremonies.
- Validator Admission and Removal:
- To become a validator candidate, a user must stake a minimum amount of BTR tokens in this contract. Candidates are promoted to the active validator set at the beginning of the next epoch. To maintain network stability, the number of new validators promoted from the candidate queue to the active set is capped in each epoch (e.g., at 10% of the total set size).
- Voluntary exits by active validators are similarly subject to a per-epoch cap.
- A validator whose stake falls below the required minimum due to slashing will be forcibly removed from the active set at the next epoch boundary.
- Operator Election:
- For each epoch, the protocol selects one Rollup Operator from the active validator set. The selected Operator is then required to submit a collateral deposit transaction on the Bitcoin L1 within a specified time frame. Failure to do so penalizes the non-compliant validator and triggers a new election to ensure the liveness of the settlement process.
- Rewards and Penalties:
- Validators are rewarded with BTR tokens for securing the network. Rewards are distributed in proportion to each validator's total stake.
- The L2 block proposer receives transaction fee and a larger share of the block reward.
- The designated Rollup Operator receives additional BTR rewards to compensate for the operational costs of settling state claims on Bitcoin L1.
- Validators who participate in the pre-signing ceremony for each epoch's transaction graph receive attestation rewards.
- Failure to adhere to protocol rules (e.g., missing block votes, failing to participate in the pre-signing ceremony) results in penalties, where a portion of the validator's staked BTR is slashed.
Bitcoin Light Client (BLC) Contract The BLC contract serves as the network's trustless gateway to the Bitcoin L1. It has two primary responsibilities: tracking the canonical Bitcoin chain and processing L1-to-L2 messages.
- Canonical Chain Tracking: The protocol relies on oracles to submit Bitcoin block headers to the BLC. By default, the Rollup Operator fulfills this role. However, if the Operator fails to do so, anyone can submit the block header, ensuring liveness. The BLC contract tracks all submitted headers, including those from ephemeral forks, and maintains the canonical chain by following the heaviest-chain rule. A submitted block is then considered finalized after accruing a number of subsequent confirmations defined by a threshold in the System Config Contract (e.g., six).
- L1-to-L2 Message Processing: The BLC contract scans finalized Bitcoin blocks for specific L1-to-L2 messages and translates them into executable L2 transactions called intrinsic transactions. These messages include:
- Bridge Deposit Events: When a user deposits BTC into the BitVM bridge contract on L1, they inscribe a
Bridge Deposit Event
. The BLC contract detects this event and generates a correspondingBridge-Mint
intrinsic transaction on L2 to credit the user with the equivalent wrapped asset. This automates the peg-in process without requiring a separate user action on L2. - Forced Transactions: A user can force the inclusion of an L2 transaction by inscribing its data directly onto the Bitcoin blockchain. This provides a powerful censorship-resistance mechanism, ensuring that a user can always interact with the rollup even if the entire L2 validator set attempts to censor them.
- Bridge Deposit Events: When a user deposits BTC into the BitVM bridge contract on L1, they inscribe a
The protocol enforces the timely processing of these messages through both its consensus and rollup mechanisms:
- Consensus Enforcement: Before proposing a new block, a validator must query the BLC contract to generate any pending intrinsic transactions. These transactions must be included at the very beginning of the proposed block, ahead of any regular user transactions. If the number of intrinsic transactions exceeds the capacity of a single L2 block, they are processed across multiple blocks in a deterministic order.
- Rollup Enforcement: The STF definition requires that a state claim for a batch of L2 blocks must correctly process all L1-to-L2 messages from the corresponding finalized Bitcoin blocks. Any Operator who submits a claim based on a state that omits or incorrectly processes an L1 message has submitted a fraudulent claim and will be successfully challenged and penalized.
Bridge Contract The Bridge Contract on L2 works in tandem with the BitVM bridge contract on L1 to facilitate the secure, bidirectional flow of assets.
- Peg-In: The contract processes the
Bridge-Mint
intrinsic transactions generated by the BLC, minting the corresponding L2 wrapped assets to the user's account. - Peg-Out: To withdraw assets, a user initiates a transaction on L2 that calls the Bridge Contract. The contract burns the user's L2 assets and emits an L2 event. This event serves as a message that is later picked up by the L1 bridge mechanism to process the withdrawal.
- Proof of Reserves (PoR): The contract maintains a complete and transparent ledger of all bridged assets on Bitlayer, enabling anyone to generate a Proof of Reserves at any time.
The detailed architecture of the bridge and the peg-out mechanism will be further explored in Chapter 5.
4.2. Proving Pipeline
To verify the state transitions of this Rollup protocol, the protocol adopts a multi-stage, asynchronous, recursive proving system based on a zero-knowledge virtual machine (zkVM). The system is designed to generate a wrapped proof that is both compact and easy to verify on the Bitcoin network, while ensuring the entire proving system is secure and upgradable through a governed process.
4.2.1. Integrity and Upgradability via CodeControlGroup
The integrity of the entire proving pipeline depends on the ability to ensure the validity and integrity of its core computation engine—that is, all programs running in the zkVM, including the block execution logic, batch aggregation logic, and recursion logic. The CodeControlGroup
is the core security mechanism designed for this purpose.
CodeCommitment
: The Unique Fingerprint of a zkVM Program
The zkVM generates an unique cryptographic commitment for each complete program suite, known as the CodeCommitment
. This commitment serves as a unique and immutable fingerprint for a specific version of the program. Any change to the code, no matter how small, results in a completely different CodeCommitment
. This holistic commitment is crucial, as it effectively prevents attack vectors where a fraudulent proof is generated by tampering with some components while others appear unchanged.
CodeControlGroup
: An Index-Based Authorization Registry
The CodeControlGroup
is a cryptographically enforced authorization list that records all valid CodeCommitment
s. Its core design is not a flat set, but rather an index-based structure. Throughout the proving pipeline, every program execution occurs within a specific context, which is marked by a unique Index (e.g., a block height). The CodeControlGroup
maps each Index
to a whitelist of valid CodeCommitment
s. Its data structure is a Hierarchical Merkle Trees with Merkle Mountain Range (MMR).
This index-based mechanism is critical. It allows the system to precisely determine whether the program used was on the whitelist for that specific Index
when verifying any historical proof. This ensures the integrity of all programs throughout the entire recursive chain, precluding the possibility of using unauthorized or outdated program versions to generate historical proofs. The root, the CodeControlRoot
, serves as a commitment to the entire authorization history, making the registry itself tamper-evident.
Secure Upgrade Path
The system's upgrade path is structured around discrete Epochs (as described in Section 3.5.3). Changes are introduced via an Epoch Reconfiguration event at each transition. This event defines the new set of system parameters, with the CodeControlGroup
being a critical component, and this data is submitted to both Bitcoin and the L2. To simplify pipeline implementation and trust management, the proving pipeline does not scan blocks for this information. Instead, it receives the appropriate CodeControlGroup
for a given context as a direct configuration input. The integrity of this entire process is guaranteed by the synchronization between the Epoch transition and the pre-signing mechanism. The new CodeControlGroup
is finalized by governance, and its corresponding CodeControlRoot
is locked in on-chain via the pre-signing mechanism before the new Epoch becomes active. This ensures that if a prover uses an incorrect CodeControlGroup
, the resulting proof will be rejected during on-chain verification, as its CodeControlRoot
will not match the pre-signed value for that Epoch. Therefore, the CodeControlGroup
provides a transparent and secure governance framework for the evolution of the zkVM's core logic. Its root, the CodeControlRoot
, serves as the final commitment to the system's complete authorized history, anchoring the validity of the entire recursive proof chain in a foundation of cryptographic certainty and governance consensus.
4.2.2. The Four-Stage Recursive Proving Pipeline
Overview
The protocol's proving workflow is a sequential pipeline consisting of four distinct stages. Before delving into the stages, it is important to understand the basic data structures involved. Each Block has a unique Block Number, which serves as the Index for contextual verification within the CodeControlGroup
. Blocks are grouped into a Batch for aggregation. The criterion for forming a batch is a key, governable system parameter, which can be either a fixed number of blocks or a specific time duration. Finally, the protocol's timeline is organized into Epochs to manage system-wide reconfigurations.
The four stages of the pipeline are: Single Block Proving, Batch Aggregation, Batch Recursion, and Proof Wrapping. This structure operates as a nested pipeline: within each batch, proofs flow sequentially through the stages, while a higher-level pipeline links consecutive batches together through the recursive stage. Each stage receives specific inputs, performs computations within the zkVM, and generates outputs that either feed into the next stage or contribute to the wrapped proof. This recursive architecture enables the efficient aggregation and compression of proofs, thereby enhancing system scalability. The following diagram illustrates this nested pipeline structure.
Pipeline Design Rationale The multi-stage pipeline design is a deliberate architectural choice made to optimize the trade-offs among proving efficiency, system complexity, and security.
- Parallelization in Stage 1 for Efficiency: Proving the state transition of a single block is the most computationally intensive task in the entire process. By isolating the proving process for each block, the protocol can initiate proving tasks without waiting for a complete batch to be formed. This allows blocks to be processed in parallel as soon as they are generated, maximizing the utilization of prover resources and significantly improving overall proving efficiency.
- Timing in Stage 2 for Simplified Complexity: Compared to the first stage, the task of aggregating multiple block proofs into a single batch proof is far less computationally intensive and much faster. Therefore, the protocol chooses to initiate the aggregation stage only after all blocks within a batch have been proven, rather than adopting a more complex incremental aggregation approach. This design effectively reduces the management complexity of the
CodeControlGroup
, as the context for the aggregation operation is a well-defined, completed batch. - Separation of Duties in Stage 3 for Integrity: Batch recursion is the key to ensuring integrity and achieving recursive compression. Separating it from the aggregation process is intended to create a clear division of responsibilities. The aggregation stage focuses on "intra-batch" state continuity, while the recursion stage handles "inter-batch" linking, connecting the validity of the current batch to the entire history of the chain. Its proving task is also more advanced and does not need to be executed concurrently with aggregation.
In summary, the entire system employs a pipelined execution of proofs not only within a single batch but also constitutes a higher-level pipeline across multiple batches. This nested pipeline design ensures high efficiency while keeping the verification logic of the CodeControlGroup
within manageable limits, thereby guaranteeing the system's security and the convenience of upgrades.
4.2.3. Stage 1: Single Block Proving
The objective of this stage is to generate a validity proof for the execution of a single block. The process involves two steps:
- Off-Chain Simulation: Before proof generation begins, the system first simulates the execution of the block outside the zkVM. This step aims to acquire all necessary input data for the proof, including the read-write sets and their corresponding Merkle proofs.
- Stateless Proof Generation: The input data obtained from the previous step is provided to a stateless zkVM instance. The zkVM re-executes the state transition in a closed environment and generates a zero-knowledge proof.
The output of this stage is a Single Block Proof, which asserts the correctness of the block's execution. Its core content encapsulates the state roots before and after the block's execution (FromState
and ToState
), the unique block identifier (BlockNumber
), and the commitment to the program used to generate this proof (CodeCommitment
).
4.2.4. Stage 2: Batch Aggregation
This stage aims to aggregate the Single Block Proof from multiple consecutive blocks within a batch into a single proof. It performs two core functions:
- Verifying State Continuity: It checks and ensures that the state transitions between adjacent block proofs are continuous. That is, the
ToState
of block must be identical to theFromState
of block . - Recording Program Commitments: It extracts the
CodeCommitment
from each input proof and records it. A key feature of this stage is that it only records the commitments; verification against theCodeControlGroup
is deferred to the next stage.
The output of this stage is a Batch Aggregated Proof, which represents the correctness of the entire batch's execution. This proof encapsulates the overall state transition of the batch, including the block height range of the batch (starting BlockNumber
and ending BlockNumber
), the initial state root of the first block in the batch (FromState
), the final state root of the last block (ToState
), and a complete list of the program commitments (CodeCommitment
) recorded from all proofs within the batch.