Chainway is thrilled to announce a significant leap forward in building a sovereign rollup secured by Bitcoin and Zero Knowledge Proofs. Two weeks ago, we inscribed a historical paper on Bitcoin: "A Sovereign Rollup Secured by Bitcoin and Zero Knowledge Proofs", where we mentioned using Bitcoin as a data availability layer. Following this mission, we are now pleased to open-source our Sovereign SDK Data Availability Adapter. This adapter is a key piece in leveraging Bitcoin as a data availability layer for Chainway's rollup. To understand the pivotal role of this adapter, we need to address the importance of data availability for blockchains and Layer 2 solutions as well as why Bitcoin stands out as an ideal data availability layer.
Any meaningful discussion about the security of a blockchain requires understanding data availability (DA). But before we dive into DA, let's talk about Layer 2 solutions and why we need them.
Blockchains are distributed computers that have the same shared state across all nodes, with state changes processed block by block until the most recent state. Every time users initiate a transaction, it enters a mempool, where all the pending transactions are stored. If the user pays enough transaction fees, aka bribe, to miners, the transaction is included in the next block and published to all other nodes. The transaction, thus the block containing it, is permanently marking its place on the blockchain.
When the block is published to all other nodes, each node takes full responsibility to download all the data in the block, process it, and validate every single transaction that this block includes. These full nodes ensure that each transaction is legitimate, for instance, they validate that you aren't misappropriating funds and that your balance covers the transaction costs. However, this rigorous validation process naturally comes with scalability constraints. Requiring each node to validate every transaction limits the number of transactions the network can handle per second. If the validation process was expedited by enhancing node hardware, fewer entities would afford to run these nodes. The fewer nodes there are, the more centralized and vulnerable the network becomes.
This highlights the Blockchain Trilemma: the challenge of achieving scalability, security, and decentralization all at once. Central to this dilemma is data availability, stressing the imperative for transaction data to remain accessible and verifiable.
This is where Layer 2 (L2) solutions, like rollups, come into play. An L2 is essentially a secondary layer built atop the main blockchain (Layer 1 or L1) to enhance its capabilities. While the L1 remains the source of ultimate trust and security, L2 solutions process transactions off the main chain and then batch and submit these transactions as a single entry back to L1. This dramatically increases transaction throughput without compromising the security attributes of the main chain.
While L2 solutions operate "on top" of L1s to offer better scalability and lower fees, they inherently rely on the censorship resistance, decentralization, liveness, and reorg resistance of the underlying Layer 1 blockchain. These are what makes Bitcoin such a strong base layer for L2s but we will talk more about that later. Please note that every single L2 inherits different security properties from the base layer. For example, the security of a zero-knowledge rollup built on Bitcoin is totally different from the security of a sidechain to Bitcoin.
Rollups batch multiple transactions and submit them to the L1. By doing so, they enhance the L1's throughput and make transactions cheaper by processing them off-chain. These off-chain transactions get grouped into compressed batches, proved and posted on the L1, with each batch on the L1 representing thousands of individual transactions. However, to be able to dispute invalid batched transactions or state changes or to ensure the liveness of the rollup, we need to access the data of these transactions all the time. If rollup operators withhold the necessary data, significant security and trust concerns emerge such as inability to independently verify and confirm the state change or guarantee the functionality of the rollup for users. We need to access the data of these transactions on the L1.
Let's examine two well-known methods for rollups. Optimistic Rollups use mechanisms known as fraud proofs to ensure the sequencer acts with integrity. Essentially, they operate on the belief that the sequencer is acting correctly unless evidence to the contrary is presented through a fraud proof. But to be able to challenge the sequencers acting dishonestly, we will need access to the transaction data. This is why the data has to be on an accessible blockchain. Data availability is crucial; otherwise, it's impossible to dispute invalid rollup operations.
ZK Rollups, on the other hand, have a more straightforward approach to ensuring integrity. Here, whenever a sequencer processes a group of transactions, they need to provide a validity proof, like a ZK-SNARK/STARK. This proof confirms the legitimacy of the transactions, and anyone can verify it. However, the issue of data availability is still crucial. For users to know their current balances within the rollup and make any desired transactions, they must have access to this data. Without having access to the data, rollups liveness will fail and all the funds on the rollup will get frozen.
Bitcoin is the most battle-tested blockchain and has demonstrated robust security and decentralization with the highest number of nodes compared to other blockchains. Given its secure nature, Bitcoin provides a strong platform to be leveraged as a data availability layer.
Rollups are L2 scaling solutions that process transactions off-chain and then batch them for on-chain finality. Ensuring DA for rollups is essential as it allows for trustless verification of computations happening outside the main chain.
But how can Bitcoin play a role here? Bitcoin's robust security can serve as an anchor for rollups, ensuring that data is always available, and any attempts to tamper with or misrepresent the off-chain data can be identified. The risk of network splits or data inconsistencies is minimized, as all rollup data is reconciled and stored on Bitcoin.
Given Bitcoin's globally distributed network, integrating it as a DA layer for rollups can increase the security and reliability of these off-chain solutions. Even if a rollup faces DA issues, any node that connects to the rollup can determine the rollup's state by scanning Bitcoin blocks, which serve as the only source of truth.
Bitcoin's role as a DA layer for L2s requires that it be robust, resistant to attacks, and reliable as a source of truth. Liveness, censorship resistance, and reorg resistance are pivotal in ensuring that the DA layer functions effectively for any L2 solutions.
Liveness: Ensures Bitcoin continuously processes transactions, crucial for L2 solutions to regularly update or commit data. Bitcoin has a perfect record of liveness as an L1, something other L1s have occasionally struggled with.
Censorship Resistance: Prevents malicious actors from blocking specific L2 data/transactions on Bitcoin. While we have seen censorship on other L1 chains, Bitcoin has proved to be the L1 with the best record of censorship resistance. If a rollup attempts to censor a user's transaction, the user can simply send their transaction directly to Bitcoin knowing it will not be censored there.
Reorg Resistance: Protects against sudden and deep changes in Bitcoin's transaction history, maintaining the integrity of L2 commitments. Bitcoin has never experienced a successful reorg attack. Pulling off a deep reorg on the Bitcoin network would be a prohibitively costly attack due to Bitcoin's proof of work consensus mechanism and the significant amount of computational power distributed globally across various mining entities.
Consequently, users can trust the rollups' integrity, knowing that its data is anchored on Bitcoin. This ensures that their assets and interactions on L2 solutions are as secure as those on Bitcoin.
While leveraging Bitcoin's robust architecture is an obvious solution to the data availability problem, realizing this potential requires specific tools. The Sovereign SDK not only provided a building block for our data availability adapter, but is our building block for building our fully Bitcoin secured rollup. Our DA adapter is, therefore, our first and most important step to building this rollup using the Sovereign SDK.
"The Sovereign SDK is a free and open-source toolkit for building zk-rollups that is currently under development.
At a high level, the Sovereign SDK aims to do three things. First, it will provide a standard interface that allows rollups to communicate with data availability layers. This standard interface will make it easy for rollups to deploy on new data availability layers - and for new chains to support existing rollups. Second, it will integrate with cryptographic compilers. Developers will be able to write their code in standard programming languages, and the SDK will automatically convert their business logic into a form that's cryptographically verifiable. Finally, it will provide default implementations of common blockchain primitives like tokens, NFTs, and bridges." from sovereign.xyz.
Our open-source Sovereign SDK Data Availability Adapter is a continuation of the sovereign SDK's philosophy. We've built it with the explicit goal of enabling developers to benefit from Bitcoin's security as their chosen data availability layer for rollup solutions.
Data availability adapter for Sovereign SDK is the software that connects rollup's state transition function with the data availability layer. It implements several interfaces that are automatically connected to the state transition function behind the scenes.
Very briefly, a data availability adapter has to scan every block on the data availability layer, extract relevant rollup data from it, generate proof of extracted data, and finally publish rollup data into the data availability layer block. Extracting data from the data availability layer can be very helpful for different kinds of rollups, for example Based Rollups (where sequencing is done by the DA layer), or for proving forced transactions to be censorship resistant.
We made our Sovereign SDK Data Availability Adapter open source for two main reasons. First, we are committed to building our Bitcoin secured rollup in public. We believe this is the best way to ensure our users can verify the quality and trustworthiness of our rollup. This leads us to our second reason. We want to benefit from the collective intelligence of developers for our robust, transparent, and secure rollup. Open sourcing our adapter and building in public is the best way to achieve this result. We hope that this decision promotes transparency, facilitates collaboration and accelerates adoption of our rollup.
Promoting Transparency: By offering our infrastructure as open-source, we enable developers across the globe to dive deep, understand, review, and verify every nuance of our software.
Facilitating Collaboration: We believe in the global developer community. Their collective insights, critiques, and contributions will optimize our system.
Accelerating Adoption: By providing unrestricted access, we ensure that projects can effortlessly implement and reap the benefits of our solutions.
Delve into specifics of our Bitcoin data availability adapter by visiting Chainway's Github repository. Insights and contributions from the developer community are essential to us. Don't forget to give a star!
While data availability remains a cornerstone of blockchains, leveraging Bitcoin as a DA layer offers the best solution for ensuring the security and integrity of L2 solutions like rollups. As we venture into an era of L2 solutions and rollups, integrating Bitcoin's security ensures we provide a rollup that relies on Bitcoin's unmatched data availability, liveness, censorship resistance, and reorg resistance. Bitcoin becomes the only source of truth for our rollup.