SPV bitcoind? (was: Introducing BitcoinKit.framework)



Summary:

The context is a discussion on creating an SPV (Simplified Payment Verification) bitcoind, with the aim of reducing disk storage usage while maintaining full functionality. The first step outlined is to store only block headers in blkXXXX.dat files instead of full block contents, and disable listening and addr announcements to the P2P network. The mempool logic also needs to be rewritten so it throws out irrelevant transactions. The second step is to use getheaders to catch up with the chain until the minimum wallet birthday is reached, throwing out headers downloaded until one goes past the key birthday minus some slack period. The third step involves implementing client-side support for Bloom filtering and switching from downloading full blocks to filteredblocks, verifying the Merkle branches then applying them to the wallet. The fourth step is optional, involving monitoring broadcast propagation for received transactions, assuming a non-MITMd internet connection as a rough proxy for "likely to be valid and mined upon". Finally, optimization is required, which depends on various factors such as CPU, network, and disk strength. Aggressive checkpointing is necessary to avoid users having to download more than a month or two's worth of headers. Profiling and optimizing are crucial to ensure a relatively flat profile whilst doing initial catchup and chain sync.


Updated on: 2023-06-06T20:11:13.841658+00:00