Chainway and Kasar Labs — Bitcoin DA Adapter Solutions Does Bitcoin Need a ZK Rollup?

Jesse H
8 min readSep 26, 2023

--

Bitcoin is on the verge of zero-knowledge (ZK) Rollups. two different projects have recently brought this development to life, a development that could not only help Bitcoin scale on a larger scale, but also provide additional privacy guarantees for users who decide to use it.

Chainway last week announced the open-sourcing of its Data Availability (DA) Adapter, a technology that allows developers to take advantage of Bitcoin’s security and finality to develop Rollups using Sovereign’s Software Development Kit (SDK).Sovereign provides developers with bundled services for building different types of Rollups, while Chainway was released to enable Bitcoin’s first ZK Rollup.

Kasar Labs, in partnership with Taproot Wizards, coincidentally released the DA Adapter for Bitcoin at the same time. The adapter allows developers to plug a Madara stack into Bitcoin to run a Starknet Rollup based on the Cairo programming language created by StarkWare.

What is ZK Rollup?

Rollups batch process and publish non-standard Bitcoin transactions (e.g., transactions from certain sidechains) into blocks on the underlying blockchain (e.g., Bitcoin). This greatly reduces the computational cost of validating these transactions, while benefiting to some extent from the security of the Layer-1 blockchain. In this sense, Rollup transactions exist on Bitcoin. Users will then run a node for that sidechain that knows how to interpret the data posted to Bitcoin and establish account balances. However, this means that everyone needs to run a full node for that other protocol, which is not scalable. This is where ZK comes in.

ZK Rollup utilizes zero-knowledge proofs, which are cryptographic proofs that ensure computational integrity without compromising privacy. It allows a prover to prove the correctness of a computational statement to a verifier with mathematical certainty, without revealing details of the specific information used to compute the proof. This is important in the context of Rollup because it only requires the observer to know the final proof in order to validate the statements or transactions. The use of ZK proofs allows those using Rollup to obtain proofs of the most recent state from Bitcoin with mathematical certainty, while maintaining complete privacy.

The benefits of ZK Rollup include eliminating the need for users to receive payments online, accessing payment data on the chain only when possible, eliminating the need to manage liquidity, and not relying on the low fees of the Bitcoin base layer. In addition, using ZK Rollup, developers can add any desired programming environment, such as Turing-complete smart contracts, on top of Bitcoin.

ZK proofs use two main mathematical techniques: SNARK and STARK. the former, the Succinct Non-Interactive Argument from Knowledge, predates the latter and is used in cryptocurrencies such as Zcash, which provide a high level of privacy for users. Scalable Transparent Arguments for Knowledge was developed later and aims to provide better security and scalability on top of the desired privacy. This is because SNARK relies on a trusted setup to generate proofs, whereas STARK aims to not require trust at all. Finally, SNARK is vulnerable to quantum computing, but STARK is quantum secure.

Given Bitcoin’s history of virtually no failures and resistance to deep reorganization, it is the most suitable cryptocurrency for Rollup transactions, which rely on the main chain to access critical data that users need to spend. The main chain also ensures that Rollup remains active and available.

In order to properly implement ZK Rollup on Bitcoin and allow users to credibly bridge their Bitcoins between Rollups, a soft fork of Bitcoin is required. This soft fork will add a new opcode to the oldest cryptocurrency that will allow Bitcoin itself to be aware of and be able to verify the ZK proof. If this were to happen, users would simply run a Bitcoin node and be able to credibly verify proofs issued by a specific Rollup, learn about their accounts and balances, and be able to withdraw funds from the Rollup.

The two projects mentioned in Part I do not assume that Bitcoin undergoes consensus changes. Instead, they utilize the Ordinals protocol to avoid the need for new opcodes. More specifically, they utilize the concept of inscription envelopes introduced by Ordinals, an innovation that allows developers and users to encapsulate any type of data through the use of specific flags and several opcodes. In the case of the Ordinals inscription, this flag is “ord”.

The flags and opcodes at the beginning of the envelope serve a dual purpose. First, they let Bitcoin nodes know that they can skip envelopes of information that are not relevant to the Bitcoin network. Second, they do the opposite for users and applications that are aware of the envelope, letting them know that it contains content of interest to them. In the case of ZK Rollup, users can scan Bitcoin blocks for these envelopes, get updates on the status of the Rollup, and mathematically validate it using the ZK proof.

Now that we have an understanding of ZK proofs, let’s go back to the two previously mentioned programs and explore the unique aspects of their design.

SOVEREIGN

The Sovereign SDK itself has three main goals. First, it aims to provide a standard interface for communication between Rollup and the DA layer, making it easier for Rollup to be deployed on new DA layers and enabling new chains to support existing Rollups. second, it integrates with cryptographic compilers to convert the business logic of the code into a cryptographically verifiable form. Finally, it provides default implementations of common blockchain primitives such as tokens, non-homogenized tokens, and cross-chain bridges.

As mentioned earlier, Chainway’s DA adapter is designed to make it easier for applications built with the Sovereign SDK to connect to Bitcoin. In other words, the adapter makes it possible for Sovereign Rollup to utilize Bitcoin as its DA layer, which was previously not possible. Data availability is critical to Rollup, as it allows for trusted validation of calculations performed outside of the main chain and is a requirement for users to be able to verify or modify their balances and withdraw funds from Rollup.

In order for Sovereign Rollup transactions to be included in a Bitcoin block, users pass their transactions to a so-called sequencer. The sequencer, which is run by the foundation itself in Chainway’s DA adapter design, is responsible for establishing this connection between the sidechain and Bitcoin, ensuring that all transactions passed by users are posted to Bitcoin in the form of ZK proofs.

This sounds a bit centralized, and it is. However, given the existence of ZK-STARKs, a proof-of-validity technology, the sequencer can’t actually act in bad faith. This is because the proof privately confirms the legitimacy of the transaction, which can be verified by anyone. For example, sequencers cannot misappropriate user funds or conduct unauthorized transactions. However, they could theoretically scrutinize a user’s transactions by not including them in the Bitcoin block and retaining that data. If this occurs, the user has the option of posting their transaction data to Bitcoin by recording that information into Bitcoin.

Chainway said that in the future they plan to implement decentralized sorting through a small set of sequencers, where participation will be permissionless and based on pledges.

STARKNET

Similar to Sovereign, Starknet aims to allow for the construction of Rollups. However, Starknet is a more opinionated ecosystem that includes explicit components such as Cairo, CairoVM, and Madara that developers can utilize to build.

Starknet is a ZK Rollup currently running on Ether, which means Rollup relies on the blockchain created by Vitalik Buterin as its DA layer. It utilizes STARK proofs to provide users with the required assumptions of privacy and security, as well as to improve scalability and reduce transaction costs by batching transactions before publishing proofs and new state to Layer-1. Cairo is a Turing-complete programming language for writing provable programs in which one party can prove to another that a computation has been executed correctly without that party having to re-execute the same program. It is the first production-grade platform for generating STARK proofs for general computation.

The Cairo virtual machine takes the bytecode generated by the compiler and runs it on the computer. The output of the run is a trace of the program, which can then be sent to the STARK proof generator to prove the validity of statements expressed in the Cairo code.

Madara is a sequencer for Starknet stacks to help developers support Starknet-based ZK Rollup.

Until recently, all of these software stacks were only available on Ether. Now, Kasar Labs and Taproot Wizards have launched a DA adapter for Bitcoin designed to allow developers to anchor Rollups built with the open-source version of Starknet to the original and most secure cryptocurrency network.

Does Bitcoin Need a ZK Rollup?

Essentially, Bitcoin doesn’t need it. It works very well in the state it is in today, and there is not much reason to think that Bitcoin needs to change significantly. Scalability, on the other hand, is a real need, and technologies like the Lightning Network have proven to be very useful in allowing for greater participation by users who would otherwise not be able to participate in transactions in the Bitcoin economy.

ZK Rollup offers a way to look at Bitcoin from a different perspective. Both of these projects do not require any actual changes to Bitcoin itself, but if the full capabilities of the technology are to be realized, consensus changes will need to be made by introducing new opcodes. For now, it appears that this zero-knowledge based research into Rollup technology is attempting to push the boundaries of Bitcoin’s potential, which would be a good thing in terms of expanding Bitcoin’s user base, much like the Lightning Network.

Similar to the Lightning Network, Rollup functions by merging multiple transactions together and then posting a single feed to Bitcoin. Of course, ZK Rollup takes a very different approach than the Lightning Network, and rightly so. The technology doesn’t try to compete with the proven second tier of cheap payments that Bitcoin users already love. Instead, Rollup focuses on other problems and tries to provide other solutions.

For those looking to do more with Bitcoin, this extended technology that ultimately enables private, complex calculations and relies on mathematical proofs sounds appealing. Even so, bridging Bitcoin inside and outside Rollup without trust at all would depend on that opcode. But even so, the idea exists.

It’s unclear whether ZK Rollup will gain any traction on Bitcoin. Bitcoin already has a sidechain, and Liquid has been active on Bitcoin for years, but its transaction volume is still small. Arguably, the presence of a federation model is a disadvantage in Liquid’s case, and ZK Rollup is more advantageous in this case. Perhaps Rollup may suffer the same fate as Liquid, i.e., low volume and low interest, as bitcoin users continue to choose to simply “HODL bitcoin and hold”. Or it could open a new chapter in the development and use of bitcoin.

Whether the end result is a success or a failure, exploring the development of these high-quality studies is a natural and necessary endeavor. Regardless of the outcome, new things can be learned from them. Regardless, one thing is certain — Bitcoin will continue to hash and generate blocks, allowing all users to enjoy the monetary certainty of hard currency without having to care about any of those things.

--

--