A Bloom Filter is a space-efficient probabilistic data structure that tests whether an element is a member of a set, accepting a controllable false-positive rate while guaranteeing zero false negatives. Invented by Burton Howard Bloom in 1970, the structure uses multiple hash functions to map elements to bit positions within a fixed-size bit array. Membership queries are answered in constant time regardless of set size, making Bloom Filters indispensable in high-throughput systems where exact lookup is prohibitively expensive. They are widely deployed in databases, networking, distributed caches, and blockchain nodes.

Content

  • A Bloom Filter is initialised as a bit array of m bits, all set to zero, paired with k independent hash functions. To insert an element, each hash function maps the element to a bit position, which is set to one. To query membership, the same k hash functions are applied; if all k positions are set, the element is probably present — if any bit is zero, the element is definitely absent. The probability of a false positive decreases as m grows and increases with the number of elements inserted.
  • The principal trade-off is between memory footprint, false-positive rate, and throughput. An optimal Bloom Filter for n expected elements with a desired false-positive probability p requires approximately -n·ln(p) / (ln 2)² bits. This is dramatically smaller than any exact hash set representation, enabling billions of membership checks within a few megabytes of RAM — a critical advantage for kernel-level network packet filtering, DNS cache poisoning prevention, and cryptocurrency UTXO set lookups.
  • Variants extend the basic structure: counting Bloom Filters replace single bits with small integer counters to support deletions; Cuckoo Filters improve lookup performance and deletion at the cost of slightly more complex insertion logic; Scalable Bloom Filters grow dynamically to maintain a target false-positive rate as the set expands beyond initial capacity estimates. Each variant introduces different space-accuracy-mutability trade-offs suited to different deployment contexts.
  • In blockchain systems, Bloom Filters appear in the Bitcoin SPV (Simplified Payment Verification) protocol, where lightweight nodes download block headers and use Bloom Filters to request only transactions relevant to their wallet without revealing their full address set to peers. Ethereum similarly encodes a 2048-bit Bloom Filter in each block header to accelerate log event lookups without scanning all transaction receipts.