BIP 158 Flexibility and Filter Size



Summary:

The Bitcoin Improvement Proposal (BIP) contains code for generating test vectors for gcs filters. The aim of the code is to help implementations ensure the correctness of their gcs filters and it produces CSV files containing test vectors of various testnet blocks and at various false positive rates. When the BIP draft was published last year, code was put up along with an interactive website showing the process used to arrive at the current false positive rate. The goal was to minimize the bandwidth required to download each filter plus the expected bandwidth from downloading "large-ish" full segwit blocks. The code simulated a few wallet types in terms of the number of addresses, focusing on a "mid-sized" wallet. One could also model the selection as a Bernoulli process where researchers attempt to compute the probability that after k queries, they have k "successes". A success would mean the queries item wasn't found in the filter while a failure is a filter match (false positive or not). A failure in the process requires fetching the entire block.Riccardo Casatta asked for more details on the process, such as charts and explanations. He also expressed his belief that 2^-20 is super low and choosing a lot higher alpha will shrink the total filter size by gigabytes at the cost of having to wastefully download just some megabytes of blocks. Gregory Maxwell suggested making input prevouts filter based on the scriptpubkey being spent to eliminate multiple data type mixing entirely.


Updated on: 2023-05-20T08:23:46.101947+00:00