[Bitcoin-development] Bloom Filter Implementation

Mike Hearn mike at plan99.net
Wed Aug 15 10:07:14 UTC 2012

This is great, thanks!

A few remarks:

If you have to update the filter after every block, IBD will require a
round-trip after every single block download instead of doing bulk
requests with getblocks. That sounds like it'd kill any performance
gains won by the feature. There needs to be a way to do bulk getblocks
on hundreds/thousands of blocks at a time and then have the data
stream in. Perhaps the server node can update the filter for you, as
the rules are deterministic?

As you know the remote end will request the transactions given their
hashes anyway, why not save the bandwidth for the hashes and the
network round-trip by just providing the transactions immediately in
the block? I was imagining something like:

// A CMerkleTx without the redundant block hash
class CLiteMerkleTx : public CTransaction {
  std::vector<uint256> vBranch;
  int nIndex;

class CMerkleBlock {
    int nVersion;
    uint256 hashPrevBlock;
    uint256 hashMerkleRoot;
    unsigned int nTime;
    unsigned int nBits;
    unsigned int nNonce;

    std::vector<CLiteMerkleTx> vMatchedTxns;

More information about the bitcoin-dev mailing list