Compact Block Filters (Neutrino)

Light-client filters that let a wallet scan for its own outputs without revealing its addresses to a server.

Basically

Compact block filters let your Bitcoin wallet find transactions that belong to you without revealing your addresses to a server. Your wallet downloads a small summary of each block and checks it on your own device.

Key Takeaways

  • Compact block filters (BIP 157/158) let light clients find relevant transactions without revealing their addresses to the server. Full nodes build deterministic Golomb-coded set filters for each block, and clients download and test them locally.
  • Unlike BIP 37 bloom filters, where the server filters for the client and learns which addresses the wallet controls, compact block filters move all matching to the client. This gives SPV-style light clients much better privacy.
  • The protocol powers non-custodial Lightning mobile wallets like Blixt and Breez. Users can run full Lightning nodes on phones without trusting a server to report on-chain activity honestly.

What Are Compact Block Filters?

Compact block filters let lightweight Bitcoin clients find blocks containing transactions relevant to their wallets while protecting their privacy. BIP 157 defines the peer-to-peer protocol, and BIP 158 defines the filter data structure: instead of sending address information to a full node, the client downloads a small, compressed summary of each block and checks it locally.

The protocol is often called "Neutrino" after Lightning Labs' reference implementation. Olaoluwa Osuntokun (roasbeef), Alex Akselrod, and Jim Posen designed it to solve a fundamental problem: earlier light client protocols like BIP 37 bloom filters leaked wallet addresses to serving nodes, undermining privacy for mobile and resource-constrained users.

Each filter is a Golomb-coded set (GCS) that compactly encodes the scriptPubKeys present in a block. A typical filter ranges from a few hundred bytes to around 15 KB, far smaller than the full block it summarises, and clients only fetch full blocks when their own addresses produce a match.

How It Works

The compact block filter system has two layers. BIP 158 defines how filters are constructed from block data, and BIP 157 defines how clients request and verify those filters over the peer-to-peer network.

Filter Construction (BIP 158)

A full node builds one filter per block. It follows the process below.

The result is a deterministic, compressed set that any node will produce identically for the same block. The false positive rate is approximately 1 in 784,931 per element tested, so a spurious match is rare and simply means downloading one unnecessary full block.

Golomb-Coded Sets

Golomb-coded sets are probabilistic data structures similar to bloom filters, but they are immutable and produce a fixed-size output for a given set. The encoding sorts hashed values and stores only the gaps between them, which follow a geometric distribution and can be compressed efficiently with Golomb-Rice coding. The structure is related to the Merkle trees used in Bitcoin block headers: both are compact representations that allow verification without holding all the underlying data.

Each gap is divided by 2^P, where P = 19, to produce a quotient and remainder. The quotient is encoded in unary as a run of ones followed by a zero, and the remainder is stored as P bits, producing compact filters roughly 1/100th the size of the blocks they summarise.

Client-Side Matching

A light client syncs with the network in several phases. The phases are set out below.

P2P Protocol Messages (BIP 157)

BIP 157 introduces six new messages for requesting and serving filters. The messages are listed below.

Full nodes signal support by setting the NODE_COMPACT_FILTERS service bit. Only one filter type is currently defined, the "basic" filter (type 0x00), and an extended filter type was removed before finalisation because it lacked clear use cases.

Compact Block Filters vs. Bloom Filters

BIP 37 bloom filters, used by early SPV wallets like those built on BitcoinJ, follow a fundamentally different model: the client constructs a bloom filter containing its addresses and sends it to a full node, which filters transactions server-side. Research has demonstrated that this approach offers "virtually zero privacy," because typical implementations include both the public key and its hash in the filter, dramatically reducing the effective false positive rate and letting the server deduce wallet addresses.

Compact block filters eliminate these problems by moving all filtering to the client. The server produces the same deterministic filter for every requester and learns nothing about which addresses any particular client controls. The trade-off is bandwidth: compact block filter clients download every filter regardless of relevance, whereas bloom filter clients only receive matching transactions.

Why It Matters

Compact block filters solve a practical problem for anyone building a self-custodial Bitcoin wallet on a mobile device. Running a full Bitcoin node is impractical on a phone because the blockchain exceeds 600 GB, but relying on a third-party server to watch your addresses means trusting that server with your privacy and trusting it to report honestly. For a broader comparison of these trade-offs, see the self-custodial vs. custodial wallets research article.

Compact block filters let a mobile wallet verify blockchain state independently while downloading only a few hundred megabytes of data. The client never reveals which addresses belong to the user, and it can detect if a server is lying by cross-checking filters from multiple peers, making genuine self-custody viable on resource-constrained devices.

Layer-2 protocols like Lightning and Spark benefit greatly from compact block filters. Lightning nodes must monitor the blockchain for critical on-chain events such as channel opens, force-closes, and HTLC timeouts, and missing a force-close transaction could result in lost funds. Unlike bloom filters, where a malicious server could silently omit a critical transaction, compact block filters let the client verify filter completeness by comparing responses from multiple peers.

Neutrino (Lightning Labs)

Neutrino is the reference client-side implementation, written in Go and maintained by Lightning Labs. It was built specifically for LND and designed to run on mobile devices. When LND operates in "Neutrino mode," it connects to compact-block-filter-serving peers instead of requiring a local full node.

Bitcoin Core

Bitcoin Core added server-side compact block filter support incrementally. The additions are listed below.

Building the filter index requires approximately 5 GB of additional disk space. The initial computation takes about one hour.

Kyoto (BDK)

Kyoto is a Rust implementation of BIP 157/158 designed for the Bitcoin Dev Kit (BDK) ecosystem. It targets mobile devices with a low memory footprint of 30 to 80 MB during sync. The bdk-ffi 1.2 release brought compact block filter support to iOS and Android developers through foreign language bindings, making privacy-preserving light clients accessible to the mobile HD wallet ecosystem.

Lightning Mobile Wallets

Non-custodial Lightning wallets are the primary use case for compact block filters. Wallets like Blixt and Breez run full LND nodes on mobile devices and use Neutrino to sync blockchain state, letting users send and receive Lightning payments without trusting a custodian or leaking address information to a server. For a deeper look at these designs, see the Lightning mobile wallets architecture research article.

Private Wallet Recovery

An HD wallet recovering from a seed phrase must scan the blockchain for all addresses derived from its derivation paths. Compact block filters let the wallet perform this scan without revealing which addresses it controls to any server. A full recovery scan downloads approximately 1 GB of filter data and completes in minutes on a modern connection.

Lightweight On-Chain Monitoring

Applications can use compact block filters to watch efficiently for specific on-chain events, including confirmations, spends, and new outputs at known scripts. The approach is useful for watchtowers that guard Lightning channels, channel reserve monitoring, and any service that tracks UTXOs without running a full archival node. For more on how watchtowers protect Lightning users, see the watchtower deep dive.

Bandwidth Overhead

Compact block filter clients download every filter for every block, regardless of whether the block is relevant. This is the cost of privacy: the server cannot know which filters the client actually needs, so it sends them all. Ongoing monthly sync requires approximately 70 MB of filter data, which may be significant for users on metered connections compared to Electrum-style servers that send only matching transactions.

Limited Serving Nodes

Bitcoin Core does not enable blockfilterindex and peerblockfilters by default, so only a fraction of the network currently serves compact block filters: roughly 1,000 out of approximately 11,000 reachable nodes. This can affect connection reliability for light clients, particularly during initial sync. Running a full node with these options enabled contributes to the network's light client infrastructure.

No Filter Commitment in Blocks

Compact block filters are not committed to in the Bitcoin block structure, unlike block headers. A client cannot cryptographically prove that a filter is correct without downloading the full block and recomputing it. The security model relies on connecting to multiple honest peers, because colluding peers could serve false filters if they control every connection. Adding a filter commitment, for example in the coinbase transaction, would strengthen security but would require a soft fork.

Block Download Privacy Leak

Filter downloading reveals nothing about the client's wallet, but fetching a full block after a filter match signals to the serving peer that the block likely contains a relevant transaction. Mitigations include downloading matched blocks from random outbound peers and routing requests through anonymity networks, but this residual leak is inherent to the protocol's design. For more on Lightning-specific privacy trade-offs, see the Lightning Network privacy analysis.

The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.

0

← All 1876 glossary terms