6

I'm trying to run a light bitcoind node for testing purposes on mainnet, with minimum startup time.

./bin/bitcoind \
-prune=550 \
-txindex=0 \
-assumevalid=00000000000000000004c176952213ad9a228ced92f883fb4a472f20b474ca7a \
-checkblocks=0 \
-checklevel=0 \
-disablewallet=1

blockheader synchronization is quite fast (<5min) but I'm not being able to start the IBD from a certain block or block height, it always starts from block=1.

is there any way to skip the IBD verification until certain block height/block hash (thought that was what assumevalid does, but I could be wrong!).

3 Answers 3

9

Such a thing is not implemented in Bitcoin Core, though there is some work towards that (the "assumeutxo" project).

What assumevalid does is just assume that all scripts/signatures in blocks up to a certain point are valid. It doesn't let one skip processing those blocks in their entirety, it only means the signature checks can be skipped. But the goal of validation is to build up your local node's view of the UTXO set (basically the database of who owns which coins). In order to build up that database, you need to see all transactions, and that database is essential - without it, it's not possible to validate the blocks that come after it.

The assumeutxo project is an effort to add something like assumevalid, but for the outcome of building the UTXO set. In a potential future it may be possible to trust a particular hash of the UTXO set at some point in the past, fetch that precomputed UTXO set at that point from somewhere, and validate everything afterwards.

3

There's an option to fast-sync by downloading a snapshot of the datadir from a synced pruned node.

This involves a stronger trust assumption compared to the proposed assumeutxo (as well as of assumevalid) as you're giving away full control over your datadir. This may potentially open your node up to certain types of attacks - for example, a buffer overflow may be found that affects reading (expected to be previously verified) blocks from disk, but not when reading them from the P2P network. Or feeding your node with inconsistent database state that triggers some unexpected edge-case.

I'm aware of two distributors that publish pruned datadir snapshots:

  1. prunednode.today, which is maintained by the Specter wallet developers and integrated into Specter
  2. BTCPay's fastsync, also integrated as an option into BTCPay. Instructions for downloading the snapshots are available here.

However, both of them are for mainnet. I'm not aware of testnet snapshot being available anywhere.

Using a snapshot could also be a good option if you already have a synced node and want to setup a new one on a new machine.


In a project I'm working on, I integrated prunednode.today as a way to quickly setup a pruned node (+block explorer, electrum server and more). This one-liner gets everything up and running:

docker run -it --rm --name ez -v ~/eznode:/data eznode/eznode TRUSTED_FASTSYNC=1

More information available at https://ezno.de/packages#fast-sync

1
  • is it impossible for Bitcoin core to add validation checks that are fast enough if you use a prune snapshot? wouldn't that be better solution then assumeutxo, since that requires additionally hard-coding of block hash in the source code with every release or so?
    – WhoIsNinja
    Dec 25, 2022 at 1:07
0

I created a copy of prunednode.today. I will host snapshots from all networks (mainnet, testnet and signet).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.