Motivation

Bitcoin's full nodes play a vital role in maintaining the network's security and decentralization. However, as the Bitcoin blockchain grows, syncing to the network's tip has become increasingly challenging, especially for new nodes. This process demands significant bandwidth and storage, which can be prohibitive in regions with limited access to high-speed internet and large storage solutions.

Syncing Bitcoin from genesis is notoriously difficult. Existing Bitcoin software, such as Bitcoin Core, requires downloading and verifying every piece of data from the blockchain's inception in January 2009 to the present day. While Bitcoin Core offers a fast sync option, it relies on a trust assumption. Typically, fast sync involves downloading a state snapshot at a specific block and applying it directly to the database, bypassing the need to replay all historical transactions. However, this method requires downloading the snapshot from an external server and manually verifying it, as detailed in BTC Pay Server's fast sync documentation. This approach compromises decentralization by depending on the trust of the snapshot provider.

Solution

Subcoin introduces a decentralized fast sync mechanism to the Bitcoin network, enabling new nodes to quickly sync to the latest state without compromising trustlessness. Fast sync, also known as state sync, is a common concept in modern blockchain protocols, particularly in account-based systems with smart contracts, where the chain state can become too large to sync from genesis efficiently. For example, reprocessing all transactions from the genesis block on Ethereum can take weeks, making the full sync infeasible, thus necessitating fast/snap sync for most users.

Subcoin's core concept is straightforward: it embeds the Bitcoin chain within a Substrate chain, leveraging the existing state sync strategy provided by the Substrate framework to download the Bitcoin state efficiently. This integration allows users to synchronize to the latest Bitcoin state rapidly and in a decentralized manner, requiring no changes to the Bitcoin protocol itself. This innovation makes the Bitcoin network more accessible and efficient for new participants, regardless of their technical resources.

<aside> 💡 NOTE: Subcoin is not a new blockchain but a derived chain of Bitcoin, architecturally similar to how Layer 2 is derived from Layer 1 in the modular blockchain design. The difference is that Subcoin does not have its own state but is a pure replica of the Bitcoin chain.

</aside>

Related work

Subcoin VS Utreexo

Utreexo leverages the same technique as Subcoin at a high level, using the Merkle tree as the cryptographic accumulator for the state. The distinction is that Utreexo uses a more specialized data structure aimed at optimizing the storage and processing of Bitcoin's UTXOs. In contrast, Subcoin directly applies a state trie, commonly used by chains with a global state, on top of the Bitcoin state. Utreexo offers more specialized optimizations, while Subcoin benefits from the extensive, reusable infrastructures provided by the Substrate framework.

Subcoin VS ZeroSync

ZeroSync uses STARK proof, which is extremely efficient and can verify the Bitcoin state instantly. The state proof produced by ZeroSync relies on Utreexo to augment the chain with a UTXO set commitment. In the future, Subcoin could serve as an additional Bitcoin state commitment provider for ZeroSync.

Technical Overview

Rationale For Using Substrate

Substrate (polkadot-sdk) is ideal for implementing a blockchain protocol without starting from scratch. As a leading blockchain development framework, Substrate is supported by a dedicated team with extensive experience in building production-grade blockchain software. Subcoin will continuously benefit from new features and updates within the Substrate ecosystem. Additionally, there have been many attempts to write a Rust Bitcoin client, but most have failed. Using Substrate is practical for implementing a sustainable blockchain protocol, especially for small teams and individuals, given the challenges of writing a Rust Bitcoin client from scratch.

Subcoin Overview

Subcoin introduces an innovative approach to encapsulating the Bitcoin chain with the Substrate framework, effectively creating a new Substrate chain by embedding Bitcoin blocks within Substrate blocks. This integration is achieved by wrapping each Bitcoin block into a corresponding Substrate block, resulting in the Subcoin chain.