Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 43 additions & 5 deletions docs/basics/download-UTXO-snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,54 @@
sidebar_position: 3
---

# Download UTXO Snapshot (Coming Soon)
# Download UTXO Snapshot

Subcoin offers a dedicated tool for downloading a Bitcoin Core-compatible UTXO snapshot from the Subcoin P2P network directly. This eliminates the need for Bitcoin Core users to rely on trusted snapshot providers for performing a fast sync.
Subcoin offers a dedicated tool `snapcake` for downloading a Bitcoin Core-compatible UTXO snapshot from the Subcoin P2P network directly. This eliminates the need for Bitcoin Core users to rely on trusted snapshot providers for performing a fast sync.

## Tool: `snapcake`
## Command to Download a UTXO Snapshot

To download the UTXO snapshot, simply use the following command:
To download the UTXO snapshot for a specified block, simply use the following command:

```bash
snapcake
snapcake --bootnodes <BOOTNODES> --block-number 840000
```

TODO: public bootnodes

### Notes

- Supported Block:

While snapcake supports downloading the snapshot at any block as long as the peer does not prune the state, only the UTXO snapshot at hardcoded block height 840000 is currently supported for importing into Bitcoin Core.

- Snapshot Format Compatibility:

The snapshot format may change in future versions of Bitcoin Core. Currently, snapcake supports the snapshot format used in Bitcoin Core v28.0.

- Snapshot integrity:

The expected `sha256sum` for the snapshot at block 840000 is:

```text
dc4bb43d58d6a25e91eae93eb052d72e3318bd98ec62a5d0c11817cefbba177b
```
This checksum matches the one documented in the official [Bitcoin Core pull request](https://github.com/bitcoin/bitcoin/pull/28553#issue-1920247340).

## Verify the Downloaded Snapshot

To ensure the integrity of the downloaded snapshot, verify its checksum using the `sha256sum` command:

```bash
# Replace <path-to-snapshot-file> with the path to your downloaded snapshot.
# By default, the file is stored at:
# snapshots/840000_0000000000000000000320283a032748cef8227873ff4872689bf23f1cda83a5/snapshot.dat
sha256sum <path-to-snapshot-file>
```

The output should match the expected checksum:

```text
dc4bb43d58d6a25e91eae93eb052d72e3318bd98ec62a5d0c11817cefbba177b
```

## Using the Snapshot in Bitcoin Core
Expand Down
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const config = {
src: 'img/subcoin-logo.svg',
},
items: [
{to: '/blog', label: 'Blog', position: 'left'},
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
Expand All @@ -95,6 +94,7 @@ const config = {
label: 'Dev Guide',
position: 'left',
},
{to: '/blog', label: 'Blog', position: 'left'},
{to: '/docs/donate', label: 'Donate', position: 'left'},
{
href: 'https://github.com/subcoin-project/subcoin',
Expand Down
32 changes: 21 additions & 11 deletions src/components/HomepageFeatures/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import clsx from 'clsx';
import Heading from '@theme/Heading';
import styles from './styles.module.css';
import Link from '@docusaurus/Link';

const FeatureList = [
{
title: 'Decentralized Fast Sync',
Svg: require('@site/static/img/blockchain.svg').default,
description: (
<>
Subcoin enables new Bitcoin participants to quickly sync the latest Bitcoin state in a decentralized manner,
achieving the fast sync functionality of Bitcoin Core without depending on a trusted snapshot provider.
</>
),
},
{
title: 'Written in Rust',
Svg: require('@site/static/img/rust.svg').default,
Expand All @@ -33,11 +24,30 @@ const FeatureList = [
</>
),
},
{
title: 'Decentralized Fast Sync',
Svg: require('@site/static/img/blockchain.svg').default,
description: (
<>
Subcoin node enables new Bitcoin participants to quickly sync the latest Bitcoin state in a decentralized manner,
achieving the fast sync functionality of Bitcoin Core without depending on a trusted snapshot provider.
</>
),
},
{
title: 'Trustless UTXO Snapshot Provider for Bitcoin Core',
Svg: require('@site/static/img/snapshot_provider.svg').default,
description: (
<>
Subcoin provides a dedicated tool <Link to="/docs/basics/download-UTXO-snapshot"> Snapcake </Link> that serves as a trustless UTXO snapshot provider for Bitcoin Core without running a Subcoin node, downloading the Bitcoin state from the Subcoin P2P network and generating a Bitcoin Core-compatible UTXO snapshot which can be directly imported into Bitcoin Core.
</>
),
},
];

function Feature({Svg, title, description}) {
return (
<div className={clsx('col col--4')}>
<div className={clsx('col col--6')}>
<div className="text--center">
<Svg className={styles.featureSvg} role="img" />
</div>
Expand Down
6 changes: 6 additions & 0 deletions static/img/snapshot_provider.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading