Compact Block Filters (BIP 157/158)

Definition: Compact Block Filters (BIP 157/158) are compact, probabilistic summaries that let Bitcoin light clients screen blocks for data they may need without downloading every full block. BIP 157 defines the peer-to-peer protocol for retrieving filters and filter headers; BIP 158 defines the initial “basic” filter format. A possible match tells a client to inspect the full block; it does not prove a payment occurred or replace Bitcoin’s consensus validation.12

Date created BIP 157 and BIP 158 were assigned on May 24, 2017; both specifications are marked Deployed.12
Protocol specifications BIP 157 BIP 158
Directories Bitcoin Technology & Infrastructure

In-Depth Explanation

What a compact filter does

A light client can download Bitcoin block headers, then use compact filters to look for scripts or other data associated with its wallet. Instead of first sending its addresses to a server and asking for matching transactions, it downloads a small filter for each block range and checks the filters locally. If a filter might match, the client requests the full block and examines its transactions. This can reduce bandwidth compared with downloading every block, while avoiding the direct address-filter query used by BIP 37.12

How BIP 157 and BIP 158 fit together

The two proposals define different parts of the same system:

Specification What it defines
BIP 157 Peer services for requesting compact filters, filter headers, and checkpoints; clients use the header chain to detect inconsistent or invalid filter data.
BIP 158 The filter construction, using Golomb-coded sets, and the initial “basic” filter type for light wallets and applications.

The basic filter is probabilistic: it can report a match for an item that is not present, so a match must be checked against the full block. The format is designed to avoid false negatives for items it includes. BIP 157’s filter-header mechanism helps clients compare filters across peers; the specification states that at least one honest peer is needed for clients to identify the correct filters.12

Compact filters are not compact block relay

The names are similar, but the jobs differ. BIP 152 compact block relay helps full nodes announce and reconstruct newly mined blocks using short transaction IDs. BIP 157 and BIP 158 let light clients search block contents more efficiently. Compact filters do not make blocks smaller and are not the messages used to propagate new blocks between peers.3

History

  • May 24, 2017: BIP 157 was assigned to specify client-side block-filtering services and filter headers. It requires BIP 158.1
  • May 24, 2017: BIP 158 was assigned to specify compact filters for light clients, including the initial basic filter type.2
  • Current status: both BIPs are marked Deployed. That status describes deployed peer-service specifications; compact filters are not a separate Bitcoin consensus rule.12

Limitations and Criticism

  • A filter match can be a false positive, so the client still has to download and inspect the corresponding full block.
  • Compact filters reduce data transfer for light clients, but those clients do not independently download and validate every transaction in every block as a full node does.
  • Filter headers help detect peers serving inconsistent data, but clients still rely on peer connectivity and the BIP 157 model’s honest-peer assumption; filters are not an independently trusted proof of a wallet balance.1
  • Local matching avoids sending a direct address filter to a server, but network timing and requested block ranges can still reveal activity. Compact filters should not be described as a guarantee of anonymity.1

Page updated: November 15, 2026.

Related Terms

Related Articles

CryptoGloss does not yet have an article focused on BIP 157/158. These broader articles cover wallet design, Bitcoin block rewards, cryptographic proof systems, and transaction ordering.

See Also

Sources

  1. Olaoluwa Osuntokun, Alex Akselrod, and Jim Posen, “BIP 157: Client Side Block Filtering,” Bitcoin Improvement Proposals, assigned May 24, 2017, status Deployed, https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki (accessed November 15, 2026).
  2. Olaoluwa Osuntokun and Alex Akselrod, “BIP 158: Compact Block Filters for Light Clients,” Bitcoin Improvement Proposals, assigned May 24, 2017, status Deployed, https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki (accessed November 15, 2026).
  3. Matt Corallo, “BIP 152: Compact Block Relay,” Bitcoin Improvement Proposals, assigned April 27, 2016, status Deployed, https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki (accessed November 15, 2026).