Tool to create a binary-encoded hints file for the "SwiftSync" proposal.
The resulting data is a bit-vector of all transaction outputs ever created up to block number N, where each bit indicates the answer to the question "Is this transaction output part of the UTXO set at block height N?".
The input UTXO set database for a certain snapshot at height N can be generated by Bitcoin Core with the following commands:
$ ./build/bin/bitcoin-cli -rpcclienttimeout=0 -named dumptxoutset $PWD/utxos.dat rollback=N
$ ./contrib/utxo-tools/utxo_to_sqlite.py utxos.dat utxos.sqlite3
The hints data file can then be generated by running the script via uv as follows:
$ uv run swiftsync-gen.py -v <bitcoin-datadir> utxos.sqlite3 swiftsync.bin
Note that no Bitcoin Core instance should be running on the provided datadir, as otherwise the block data can't be accessed.
This work has been supported by a Brink grant (https://brink.dev/).