BIP 157, Client Side Block Filtering, specifies a Bitcoin peer-to-peer protocol that lets lightweight clients request deterministic summaries of blocks, check those summaries against one another and obtain complete blocks that might concern their wallets. The maintained BIP credits Olaoluwa Osuntokun, Alex Akselrod and Jim Posen and carries an assigned date of 24 May 2017. BIP 158 separately defines how to construct the initial basic filter. The two documents describe different parts of the same system. BIP 157 — maintained specification · BIP 158
Reversing the Bloom-filter model
Under BIP 37, a lightweight wallet submitted a customised Bloom filter to a full node, which used it to decide which transactions to return. That revealed information about the wallet's interests and imposed work on the serving node. BIP 111 subsequently allowed full nodes to advertise or decline that service; it did not change what the wallet disclosed when it used BIP 37. BIP 157 reverses the direction: a serving node prepares the same deterministic filter for a given block and filter type; the client checks the filter against its own private set of scripts and requests a full block when it might match. The protocol was proposed partly to address BIP 37 privacy and denial-of-service problems. Motivation · BIP 111 specification
The privacy difference is meaningful but bounded. A node supplying the filter need not learn the wallet's script set. A peer observing which full blocks the client subsequently requests may still learn something. The specification recommends retrieving matching blocks from randomly chosen peers; it does not promise network anonymity. Client operation
The separate responsibilities of BIP 157 and BIP 158
BIP 157 defines the network messages, filter-header commitments, checkpoints and recommended client workflow. BIP 158 defines the Golomb-coded set format and what the basic filter contains. A client can implement the former protocol only usefully when it and its serving peers agree on the latter filter's type and contents. Protocol specification · Filter construction
The message family includes getcfilters/cfilter for actual block filters, getcfheaders/cfheaders for sequential filter hashes, and getcfcheckpt/cfcheckpt for sparse checkpoints. A cfcheckpt response covers filter-header checkpoints at positive multiples of 1,000 blocks. The BIP bounds getcfilters requests to up to 1,000 blocks and getcfheaders requests to up to 2,000. These limits are wire-protocol rules, not Bitcoin difficulty periods. Messages and limits
For each block and filter type, the filter hash is the double-SHA256 of the serialized filter. The 32-byte filter header hashes that value together with the preceding filter header, starting from an all-zero predecessor at genesis. A disagreement in the filter-header sequence can be isolated, after which a client can fetch the full Bitcoin block and recompute the specified filter. This is a useful way to identify a lying or mistaken peer when a truthful comparison is available. It is not the same thing as the chain of Bitcoin proof-of-work headers. Filter headers and client operation
Trust and completeness
Following the header-and-inclusion-proof security model of Simplified payment verification, the specified client first synchronises Bitcoin block headers and evaluates the chain's proof of work. It then obtains filter headers, compares peers and tests filters against their header commitments. Finally, it downloads and inspects complete matching blocks. This last step is particularly important: a filter is a probabilistic search aid, not a Merkle proof of a particular payment and not a substitute for transaction or block validation. Client operation · Merkle tree
The BIP describes a security guarantee conditioned on having at least one honest peer and using the comparison/dispute-resolution workflow. If every consulted peer colludes to give the same false filter-header sequence, that sequence is not anchored by Bitcoin consensus. Likewise, a client that skips checking filter headers or matching full blocks has weakened the protocol's intended assurance. These are protocol-model boundaries, not claims about a measured attack on a specific wallet. Abstract, client operation and rationale
Before the numbered BIPs: the filter reversed
The idea did not first appear as finished BIPs 157 and 158. On 9 May 2016, a bitcoin-dev contributor signing as bfd proposed a deterministic, block-level Bloom Filter Digest: servers would prepare reusable per-block filters rather than evaluate each wallet's individually supplied BIP 37 filter. The message also floated a possible future soft fork committing filter hashes in blocks. This was a public conceptual precursor, not the later Golomb-coded wire specification or an enacted consensus rule. On 17 February 2017, Chris Belcher argued that observing which full blocks a client downloaded could still expose a wallet's transaction graph. His analysis concerned that earlier proposal but exposes a privacy trade-off also relevant when interpreting BIP 157. 2016 original proposal · Belcher's contemporary response
On 1 June 2017 at 19:01 UTC, Olaoluwa Osuntokun publicly proposed Compact Client Side Filtering for Light Clients with Alex Akselrod. Their message linked an unnumbered, mutable gcs_light_client.mediawiki draft and three implementation repositories. They described Golomb–Rice coded sets and named lightweight Lightning Network support for lnd as a central motivation. The contemporaneous announcement already distinguished normal/basic and extended filters, and reported experimental filter-size measurements. These were author-supplied measurements, not an independently reproduced archive benchmark. Original public announcement
The linked surviving draft commit retains a 1 June 2017 author timestamp but a 9 November 2017 committer timestamp. It presents a combined proposal containing both filter construction and peer-to-peer messages, with the header BIP: ???; its surviving revisions continued through 30 November 2017. The canonical addition on 22 January 2018 split the record into numbered BIPs 157 (transport and verification) and 158 (filter construction). That canonical commit itself bears a 1 June 2017 author timestamp and a 22 January 2018 committer timestamp. A retroactive author date does not authenticate every byte of an earlier mutable June branch. The announcement is direct evidence that the proposal existed then; the November Git objects preserve actual versioned draft bytes.
A development history with several milestones
bitcoin/bips file history. This repository event follows their assigned date. Original repository additionlnd **0.5-beta** with a Neutrino light-client implementation. Its accompanying Lightning App was a **testnet alpha**; this is contemporary first-party release testimony, not evidence of universal mainnet use. Lightning Labs release announcementBlockFilterIndex storage/indexing implementation. This was groundwork for network serving, not proof that Bitcoin Core peers could yet answer BIP 157 requests. Merged indexing PRbtcutil regression-test, matching-fix and optimisation commits were recorded on 25 April. On 26 April, Neutrino PR #148 merged a dependency bump incorporating them. The corrected software component predates the desktop app's May fix announcement.lnd 0.6.1-beta-rc2. That tagged lnd dependency file pins the corrected btcutil and Neutrino commits. This is a source-level dependency chain, not a forensic inspection of every distributed app binary.lnd node. The announcement supports platform and release claims, not a census of installations or a security audit. Contemporary first-party announcementneutrino.addpeer to **unpin** the Lightning Labs btcd cluster. That wording documents an operator-facing client-discovery adjustment, not the complete topology of the live peer network.getcfilters request maximum from 100 to 1,000 blocks. The maintained protocol should not be projected unaltered onto the earliest implementations. Specification revision-blockfilterindex and local getblockfilter RPC access. Its notes expressly state that this version **did not serve the filters over P2P**. Primary release notes · Dated release noticeNODE_COMPACT_FILTERS signaling (13 August). The earlier all-in-one PRs **#16442 and #18876 closed without merger**; their closure must not erase the merged smaller work. First-party split plan · Checkpoints · Cache · Headers · Filters · Signaling-blockfilterindex=1 and -peerblockfilters=1. Availability of a feature in a release does not mean it is active on every node. First-party release notesFrom experimental Neutrino to mainnet apps
An early Lightning Labs desktop demonstration was publicly offered on 12 October 2017, with Neutrino synchronising testnet and the authors pointing readers toward their still-developing BIP draft. The company's October 2018 technical overview again described its then-current Neutrino client releases as testnet-only and mainnet support as work in progress. Thus neither announcement should be retroactively described as a mainnet wallet release. 2017 demonstration · 2018 technical overview
The first directly identified mainnet product milestone is 23 April 2019, when Lightning Labs announced the desktop Lightning App 0.5.0-alpha for Windows, macOS and Linux. Its version-pinned README confirms that the packaged application selected mainnet by default and used Neutrino as the normal light-client mode; its release-version commit and GitHub release preserve contemporary software artifacts. The product was explicitly labelled an alpha for testers. The available evidence establishes a shipped and offered mainnet application, not independently measured installations, successful peer sessions or loss-free operation. First-party announcement
Implementation experience quickly complicated the simple launch story. The 7 May 2019 0.5.1-alpha release notes reported a Neutrino filter-matching correction. The corresponding upstream code and regression test can now be identified below; the announcement itself does not establish any actual loss of funds or number of affected users. On 19 June 2019, Lightning Labs extended the mainnet alpha to iOS and Android, still warning that testing and stability work remained. Mobile announcement
Serving infrastructure is a separate historical question. The app's June 2019 release notes mention migrating the desktop client to the named btcd-mainnet.lightning.computer server cluster. The August release notes later describe using neutrino.addpeer to unpin a Lightning Labs btcd cluster. These are first-party product-maintenance statements, not a complete network map. They demonstrate why a working 2019 Neutrino mainnet app and '''Bitcoin Core's opt-in BIP 157 serving release in January 2021''' are not conflicting dates. Clients could use supporting software other than Bitcoin Core. They also illustrate the difference between making filters deterministic and proving that a wallet has independently discovered sufficiently diverse, honest peers.
Tracing the 2019 matching bug through dependencies
The 7 May release's brief warning can be narrowed by following versioned source rather than speculating about an attacker. On 25 April 2019, the btcsuite/btcutil repository added TestGCSMatchZeroHash. Its deterministic case used a 13-item filter and a chosen four-byte input (decimal 16060032) whose keyed hash, after range reduction, was zero. The test checks both when that item is included and when it is excluded, through Match and MatchAny. This is a preserved regression test, not a measurement of frequency in actual Bitcoin blocks.
The companion matching-fix commit reveals the failure: the old single-item Match scan began with a zero accumulator and iterated only while lastValue < term. For a reduced target term of zero it skipped the scan entirely, returning a false negative even if the encoded set included the item. The revision reads up to the stated number of filter entries and explicitly compares each decoded value, including zero. It also rewrote ZipMatchAny's merge comparison: its old equal-zero starting condition could return an unearned positive for a zero-valued query. Thus the source shows both a missed-match edge case in one algorithm and an incorrect positive in another, not a defect in the mathematical BIP 158 filter definition.
On 26 April, Neutrino PR #148 incorporated btcutil revision 9e5f4b9a998d, which followed that test and fix. Versioned lnd 0.6-beta dependencies still pinned earlier btcutil/neutrino revisions; 0.6.1-beta-rc2 pins btcutil 9e5f4b9a998d and neutrino a655679fe131. The 7 May app release names both the lnd upgrade and the matching fix. This is an unusually clear chain from test → library fix → client dependency → announced app release.
The code comparison supports the zero-hash mechanism and dependency propagation; it does not establish which users downloaded the binaries, how often this rare condition occurred on mainnet, whether any specific transaction was missed, or whether funds were lost. A compiled-artifact comparison or a controlled run of the pre-fix and post-fix code remains separate work.
What the release history establishes
The contemporary records show successive capabilities: construct filters (Core source merged in 2018), index them (2019 merge), query locally (2019 release) and serve them over P2P if configured (2021 release). Lightning Labs had demonstrated a separate Neutrino client path in 2018. None of these source records gives a trustworthy 2026 network-wide adoption fraction. The current BIP status word must not stand in for one.
A BIP 157 server and a client are also different roles. A Bitcoin Core node with -blockfilterindex can build filters without advertising NODE_COMPACT_FILTERS to peers. Conversely, a lightweight wallet consuming those filters has not become a fully validating node simply because it checks a filter-header chain.
Where this fits
Electrum's original 2011 remote-server queries and its later block-header/Merkle verifier represent another light-client lineage. BIP 157 provides a standardised filter-fetching alternative to sending wallet interest sets to servers. BIP 155 concerns discovering peer addresses, BIP 324 concerns encrypted node transport, and BIP 330 concerns unconfirmed transaction-announcement reconciliation. BIP 157 does none of those jobs.
BIP 158 also explains why the default compact filter should not be mistaken for an Ordinals or Bitmap index: it indexes specific output scripts, not inscription bodies, Bitcoin transaction IDs or arbitrary application metadata. On-chain provenance requires different evidence.
Open research
Find an independently timestamped June 2017 snapshot of the draft bytes and compare its wire format with the November 2017 combined draft and January 2018 separate BIPs. The June mailing-list announcement proves circulation, not the exact bytes of the later Git objects.
Measure the number of publicly reachable Bitcoin Core nodes actually advertising
NODE_COMPACT_FILTERS under a documented sampling method; do not infer this from the BIP's *Deployed* label.Reproduce the April 2019
TestGCSMatchZeroHash against the pre-fix and post-fix btcutil revisions, then compare a verifiable Lightning App 0.5.0/0.5.1 distribution artifact with its tagged lnd and Neutrino dependencies. The recorded regression test and source-level fix do not establish user impact or fund loss.Recover a dated, independently verifiable 2019 Lightning App release package and compare its bundled
lnd/Neutrino source revision and peer bootstrap settings with the tagged repository. Product announcements and Git tags do not establish live peer diversity.