SwiftSync is a protocol to accelerate the initial block download for Bitcoin clients. The protocol requires hints as to what coins will remain unspent at a particular block height throughout the chain history. This crate is an implementation of a file that encodes such hints. In essence, it is an concise encoding of the UTXO set.
The file encodes monotonically increasing indices within a block for which coins remain unspent. Given a block of M elements, suppose N are not spent, then the file encodes these positions with
The technique used for this encoding was developed by Elias and Fano, which you may read about here.
cargo add hintsfile
use hintsfile::Hintsfile;
// Load a file
let hints = Hintsfile::from_reader(&mut file)?;This crate compiles with a toolchain of 1.80.0 or higher.