Home › Glossary › Bloom filter

Bloom filter

Also called: BIP 37, BIP37, connection Bloom filtering, filterload, SPV Bloom filter.

A Bloom filter is a compact probabilistic set; BIP 37 used one so light wallets could ask full nodes for only the transactions matching their addresses.

A Bloom filter is a compact data structure for testing whether an item is in a set. It can give false positives but never false negatives. In Bitcoin the term usually means connection Bloom filtering from BIP 37, by Mike Hearn and Matt Corallo, which let lightweight (SPV) wallets sync without downloading every transaction.

How BIP 37 Bloom filtering works

  1. The wallet builds a Bloom filter containing its public keys, addresses and outpoints, tuned to include some false positives as cover.
  2. It sends the filter to a full node with filterload (at most 36,000 bytes and 50 hash functions); filteradd and filterclear update or remove it.
  3. The node relays only matching transactions and answers block requests with merkleblock messages: the block header plus a partial Merkle tree proving the matching transactions are in the block.

Why Bloom filters fell out of favor

  • Privacy. In practice the filters revealed far more about the wallet than intended, since a node can test any address against them and compare filters over time.
  • Load on nodes. Each client makes the node scan data with its own filter, which can be abused for denial of service.

BIP 111 added the NODE_BLOOM service bit so nodes can say whether they offer the service, and Bitcoin Core turned it off by default in version 0.19. The modern alternative is compact block filters (BIP 157, BIP 158), which reverse the model: the node publishes one filter per block and the wallet does the matching itself.

BIPs that define Bloom filter

  • BIP 37: Connection Bloom filtering: Deployed. Lets lightweight wallets hand a full node a Bloom filter (a compact, approximate summary of what they care about) so they receive only relevant transactions. This made phone wallets practical,…
  • BIP 111: NODE_BLOOM service bit: Deployed. Adds a way for nodes to announce whether they offer 'bloom filtering', a service that lets lightweight wallets request only transactions relevant to them. Nodes can then decline to provide this…
  • BIP 157: Client Side Block Filtering: Deployed. Defines a protocol for lightweight wallets in which full nodes publish compact summaries (filters) of each block, and wallets download them to check locally which blocks matter. Unlike the older…
  • BIP 158: Compact Block Filters for Light Clients: Deployed. Specifies how to build the compact block filters used by the BIP 157 light-client protocol, a compressed summary of the addresses and data touched in each block. Wallets use these filters to decide…

Related terms

  • Compact block filters: Compact block filters (BIP 157 and 158) are small per-block summaries that let light wallets find their transactions without revealing their addresses.
  • SPV (Simplified Payment Verification): SPV (Simplified Payment Verification) is how light wallets check payments using only block headers and Merkle proofs, without downloading full blocks.
  • Merkle tree: A Merkle tree hashes many items into one 32-byte root, so any single item can be proven to be included with a short proof instead of the whole list.