Passer au contenu

Bitcoin accepté au paiement  |  Expédié depuis Laval, QC, Canada  |  Soutien expert depuis 2016

Compact Block Filters (BIP157/158)

Network & Protocol

Definition

Compact Block Filters let a lightweight Bitcoin wallet decide which blocks contain transactions it cares about without telling any peer what addresses it is watching. BIP158 defines the filter format; BIP157 defines the peer-to-peer messages a client uses to request filters and filter headers from full nodes. Together they underpin the privacy-preserving light-client model popularized by the Neutrino implementation and adopted by several self-custody wallets that refuse to leak their owner's financial graph to random servers.

The problem they solve

A light wallet cannot download and validate every block, so it must somehow learn which blocks touch its keys. The first-generation answer, BIP37 bloom filters, had the client send a probabilistic summary of its own addresses to a full node and let the node do the matching. That design leaked catastrophically: research showed the filters revealed most or all of a wallet's addresses to whichever peers it queried, and serving the filters also exposed nodes to denial-of-service abuse. BIP157/158 invert the direction of trust entirely.

Golomb-coded sets

Under BIP158, each block gets one deterministic basic filter: a Golomb-Coded Set (GCS) built from the scriptPubKeys of the block's outputs and of the previous outputs being spent. The items are hashed with SipHash into a numeric range, sorted, reduced to successive deltas, and compressed with Golomb-Rice coding — a construction that approaches the information-theoretic minimum size for a probabilistic membership set. The basic filter uses parameters M = 784,931 and P = 19, giving a false-positive probability of roughly one in 784,931 per queried item. A client checking its scripts against a filter gets every true match with certainty, plus an occasional false positive that it resolves by downloading the full block — which is harmless for privacy, since fetching a whole block reveals nothing about which transaction inside it mattered.

Why the model is more private

The crucial inversion is direction: the full node computes the same filter for everyone and serves it on request; the client matches locally against its own wallet scripts. The node never learns the client's addresses — it only sees that someone wanted filters for certain heights, the same data every other filter client requests. Filter headers (a hash chain over the filters) let a client cross-check that multiple peers agree on filter contents, so a lying node can be detected rather than trusted. The trade-offs are bandwidth and availability: a client downloads filters for every block plus occasional full blocks, which costs more than an address-revealing query would; and in Bitcoin Core, building the filter index and serving filters to peers are opt-in — an operator must enable the block-filter index and peer service explicitly. Every node that does so quietly improves the light-wallet ecosystem's capacity.

The sovereignty angle

Compact block filters occupy a pragmatic middle ground on the self-sovereignty spectrum. Running your own full node remains the gold standard — you validate everything and query no one. But for a phone wallet, or for the family members you are onboarding, a BIP157 client is the difference between broadcasting a watchlist of your addresses to strangers and revealing essentially nothing. The chain of custody still starts with headers-first sync and proof-of-work verification, and inclusion is still checked transaction-by-transaction via merkle proofs; the filters simply answer "which blocks should I even look at?" without turning that question into a confession.

If you already run a full node with disk to spare, enabling the filter index and peer service is a cheap public good: it costs modest storage and bandwidth, and every light wallet that finds your node gets a privacy-respecting sync path it would otherwise have to hunt for. Decentralization is mostly made of small, unglamorous contributions like this one — infrastructure quietly offered so the next person's sovereign setup has something honest to lean on.

In Simple Terms

Compact Block Filters let a lightweight Bitcoin wallet decide which blocks contain transactions it cares about without telling any peer what addresses it is watching.…

Explore the Full Glossary

Browse all Bitcoin mining terms from A to Z. Whether you are a beginner or expert, deepen your understanding of the mining ecosystem.

Glossaire du minage

ASIC Miner Database

Compare 500+ miners with real-time profitability data, home mining scores, and detailed specs.

Comparer les mineurs