BIP 158 Flexibility and Filter Size



Summary:

Tamas Blummer has processed the historic blockchain and created a filter with spent input scripts and output scripts. The resulting chart shows the history of same-block address re-use, with a notable drop in relative filter size during the early history and in the time window where SatoshiDICE was popular. The current filter size is between 2.0% - 2.5% of block sizes. Tamas also created 1600 random (P2SH) scripts and totaled the false positive block download data size if observing 100, 200, 400, 800, 1600 of them. The result suggests that even for 1600, the false positive overhead is less than 0.1% of blockchain data size.Simulations with other parameters could be executed using this patch branch: https://github.com/tamasblummer/rust-bitcoin-spv/tree/blockfilterstats A run takes a few hours on a fast machine with release build and local bitcoind. The calculation can not be reduced to the recent history as the process builds in-memory utxo from genesis.Based on some discussions, Laolu plans to make modifications to the BIP. Firstly, he will use P=2^19 and M=784931 as gcs parameters and bind these to the filter instance so future filter types may use distinct parameters. Secondly, he will use the prev output script rather than the prev input script in the regular filter. Thirdly, he will remove the txid from the regular filter. Finally, the extended filter will be done away with altogether. These changes should slash the size of the filters yet still ensure that they're useful enough for the target use case.


Updated on: 2023-06-13T02:31:57.285686+00:00