LearnBitcoin

Glossary

Bloom Filter

A probabilistic data structure enabling SPV wallets to request only relevant transactions, though with known privacy drawbacks.

A Bloom filter is a probabilistic data structure that lets you check "is this item in a set?" cheaply, with no false negatives and a tunable rate of false positives. In Bitcoin, Bloom filters were introduced by BIP-37 (2012) as a way for SPV clients to request only transactions that might match their addresses.

The original workflow:

  1. SPV client builds a Bloom filter encoding its addresses (with some intentional fuzziness via false positives).
  2. Client sends the filter to a full node.
  3. Full node sends back only blocks/transactions that match the filter (plus some unrelated false-positive matches).
  4. Client checks each result locally to see which are real matches.

The fatal privacy flaw: by inspecting the filter, a malicious or curious full node can probabilistically reverse-engineer which addresses the SPV client cares about. The false-positive rate is supposed to provide cover, but in practice it's too easy to extract patterns when a client repeatedly queries with overlapping filters.

Serving these filters also turned out to be a denial-of-service risk for the node doing the work. BIP-111 (2015) gave nodes a way to say whether they offer Bloom filtering at all, so operators could switch it off. In Bitcoin Core the switch is the -peerbloomfilters setting. It stayed on by default, so operators had to opt out, until version 0.19.0.1 (November 2019) changed the default to off. As of October 2026 it is still off by default, and an operator can turn it back on.

The successor is BIP-158 compact block filters, where the full node generates the filter and the client downloads and queries it locally, so the wallet never hands its addresses to anyone. It still has to fetch each block that matches, and BIP-157 suggests getting those from peers picked at random so no single node sees the whole picture. The filter itself is a close cousin of a Bloom filter (a Golomb-coded set, chosen because it's smaller). It's the same basic trick with the information flowing the other way, and privacy is much better for it. Some mobile wallets work this way instead of using BIP-37, such as Blixt, which runs lnd with the Neutrino light client.

Bloom filters as a general data structure are still widely used, for example in database software such as PostgreSQL and RocksDB. Bitcoin Core uses them internally too, to keep track of which transactions and addresses each peer already knows about so it doesn't announce them again. The BIP-37 use, where a wallet hands its filter to someone else's node, is the part Bitcoin Core has left off by default since 0.19.0.1.

Key takeaways

  • Helps SPV wallets reduce bandwidth by filtering transactions
  • Potentially reveals information about user addresses
  • BIP 157/158 compact block filters are a more private alternative

Corrected

  • Was: The entry said Bitcoin Core's Bloom filter service first became opt-in and was later disabled by default in v0.19. It also called Bloom filters a historical artifact in Bitcoin.

    Now: Bitcoin Core served Bloom filters by default, with a -peerbloomfilters setting to switch them off, until version 0.19.0.1 (November 2019) made off the default. As of October 2026 it is still off by default and can be turned back on. Core also uses Bloom filters internally to track which transactions and addresses each peer already knows. Details

Sources (15)

External references (2)

Related terms (7)

Published . Revised . One correction logged for this page.

Edit this page on GitHub