laitimes

RoochBTC: Implements Bitcoin Layer 2 with an on-chain indexer

The fairness of Bitcoin's inscription encourages the organic growth of communities that believe in a decentralized future. For Rooch, our mission is to accelerate this process by providing more use cases for this community.

In this post, I would like to discuss all the possible solutions for building a Bitcoin app with more features. In addition, we will propose a new solution that leverages on-chain indexers to build full-chain applications that integrate Bitcoin assets such as Ordinals and BRC20. We'll also be sharing some of Rooch's latest developments on the launch of RoochBTC.

Bitcoin L2 Solution

Although inscription technology provides Bitcoin with a new avenue to launch new types of crypto assets, the Bitcoin blockchain network itself has limitations in building applications based on these assets. The root cause is that Bitcoin Script does not support the description of complex logic, and cannot support more complex application scenarios. In addition, the transaction costs of the Bitcoin network are also a high barrier for users to use any application built directly with the Bitcoin blockchain.

To address both of these issues, we've seen some advanced Bitcoin L2 solutions being proposed. Here I will broadly divide them into 3 categories.

RoochBTC: Implements Bitcoin Layer 2 with an on-chain indexer
Lightning Network

The Bitcoin Lightning Network is one of the earliest and most widely adopted Bitcoin L2 solutions. The solution allows users to build payment channels between two participants, allowing them to lock their funds on the Bitcoin network and conduct invoice-based off-chain transactions without any restrictions.

The advantage of the Lightning Network is that it can significantly reduce transaction costs without compromising security. The entire payment process does not rely on the trust of third parties. Of course, the downside is that the application scenario is limited to payment.

RGB / BitVM

RGB and BitVM were recently introduced to the community and have garnered a lot of attention due to their potential to enable Turing-complete smart contract scenarios for Bitcoin.

The essence of both solutions is similar to that of the Lightning Network, in that they want to off-chain the transaction load and let all users verify the transaction themselves. But RGB and BitVM go beyond verifying simple payment transactions, they also provide applications with a VM-based platform to build more complex logic, while ensuring that users can still verify the results of a range of complex transactions.

As these solutions are implemented and matured, basically all types of smart contract logic can be supported, which will bring huge benefits to the Bitcoin ecosystem. In addition, the security of all transactions is guaranteed by client verification. Third parties are not required unless compromised by the need to improve the user experience.

However, we can still foresee their limitations in use cases, as they still require all participants to be online and constantly sign transactions to verify off-chain execution.

Sidechain / Rollups

When it comes to scaling Bitcoin, sidechains and rollups are the most intuitive solutions. As a user, you can transfer your Bitcoin assets to another platform that can implement various use cases.

The million-dollar challenge here is how to securely enable the transfer of assets between Bitcoin and the sidechain. How to lock and unlock the state of Bitcoin in a secure and decentralized way.

Bitcoin's Taproot upgrade makes it easy to sign transactions with multiple private keys by enabling signature aggregation. Many sidechains and rollup solutions have leveraged this feature to set up a "council" to help users transfer assets from Bitcoin to their own chains.

The disadvantage of this solution is that the security of the user's assets will inevitably be compromised. Once a user decides to transfer their assets to a sidechain, they will not have direct control over their assets, they must trust the committee that locks the assets and the security of the sidechain or rollup itself.

So, by comparison, we can see that there is no perfect solution yet, and all solutions need to compromise between security and application scenarios.

Implement Bitcoin L2 with an on-chain indexer

At Rooch, we want to propose a novel solution that leverages on-chain indexers to scale the Bitcoin ecosystem.

How it works

RoochBTC: Implements Bitcoin Layer 2 with an on-chain indexer

Rooch has the flexibility to be customized into any infrastructure, and in this use case, we will use Ethereum and external DA for security. On top of Rooch, a Bitcoin light client is implemented using a smart contract that has the ability to validate Bitcoin block headers. All Bitcoin block headers and UTXO states are synchronized to Rooch as objects in MoveVM, where the UTXO is indexed and cross-validated by the light client and all block headers. The indexed Bitcoin UTXO information can then be used in the smart contract of the full-chain application built on Rooch.

We will also provide a contract interpreter on Rooch so that applications can easily access different inscription information such as Ordinals, BRC20, ARC20, etc.

It's important to note that all UTXOs are not locked on the Bitcoin network, only their state information is synced to Rooch. That is, in this paradigm, no Bitcoin assets can be transferred from Bitcoin to Rooch. Only the latest Bitcoin UTXO status will be synced to Rooch in real-time and guaranteed correct.

This seems to be a strange solution to scaling Bitcoin, as the solution itself does not help to change the state of Bitcoin in any way. But in fact, there are a lot of useful use cases that we can enable. Here's an example.

Imagine a full-chain game where you can think of your Ordis as a seed. You can grow them. You can water them. Once you've taken care of your Ordi and grown it into crops, you'll be able to earn some yield tokens.

Although it is a very simple game, you will still find it difficult to achieve it with all the solutions we have discussed above. But with Rooch's on-chain indexer, you can easily build games like this.

RoochBTC: Implements Bitcoin Layer 2 with an on-chain indexer

Once the user connects to the application and provides a signature, a Rooch account is generated for the user. In this account, the user's Ordi will be available for the application contract to read. With proof of ownership of the Ordi seed, users can call the app contract to grow it into a tree NFT, which will automatically be owned by the same account. NFTs can be acquired through contracts to generate profit tokens or transfer to other accounts.

In this game, the user's Ordi never leaves the Bitcoin network and is kept in the user's Bitcoin wallet. The logic of the game is entirely based on the user's ownership of Ordi. If Ordi is transferred to another account, the game contract can decide whether to transfer the derivative assets to that account as well, depending on the game design. For example, in the Ordi Farm Game, the Tree NFT should be transferred to the new account as it should follow the seed, and all profit tokens should remain in the old account as they have been harvested from the tree.

Comparison with existing solutions

Now let's see what happens if we take a different solution to build the same application:

  • Lightning Network - Not feasible. The Lightning Network does not provide a smart contract environment for implementing game mechanics.
  • P2P protocol using Offchain VM - viable but poor user experience. Since the game is essentially a competition between all Ordi holders in order to grow their assets, all participants are required to sign each other's transactions in order to acknowledge that their "planting" and "watering" actions are valid.
  • Multi-signature based sidechains/rollups - fully doable, but require asset custody. Users must deposit their Ordi into a third-party custodial wallet, which is controlled by a multi-sig based committee, which causes trust issues.

In the case of an on-chain indexer-based build as proposed in this article, the full game logic can be implemented with a seamless user experience and no asset custody is required throughout the game lifecycle.

Full-chain games and more application scenarios

The above example illustrates the potential of the use cases that can be implemented with on-chain indexers on Rooch. The essence of this paradigm is to allow applications to leverage ownership of Bitcoin assets as anchors, giving applications the freedom to design logic and derive more generic tokens from these anchored assets.

We believe this feature of on-chain indexers makes this solution particularly suitable for building fully on-chain games or autonomous world (AW) applications in the Bitcoin ecosystem, unlike DeFi, which typically focus on building complex logic and executing user-earned tokens, or using token ownership as proof of entry rather than manipulating tokens themselves.

We also believe that more types of applications are possible, and we believe that gaming is just the first scenario where this Bitcoin scaling solution can be adopted. We are happy to work with the community to build a thriving Bitcoin ecosystem.

RoochBTC - The first frontier of the Rooch network

Rooch is a modular blockchain platform designed to support full-chain applications and provide them with access to assets on all other blockchain chains.

While we're not ready to launch the full mainnet yet, we've decided to launch RoochBTC soon, hoping to show the community what we've been doing and give you some hands-on experience.

The RoochBTC network will index the full Bitcoin mainnet state on-chain, as well as everything needed to develop a full-chain application using Bitcoin assets. This includes SDKs, wallet APIs, documentation, and samples.

We will also be releasing a demo application for Bitcoin asset holders to try out and experience the future of Bitcoin full chain applications.

So, stay tuned!