BIP 158 Flexibility and Filter Size



Summary:

Johan Torås Halseth proposed a method for light wallets to download the minimum amount of data required to operate by letting full nodes decide which subsets of elements they serve filters for. The full node would advertise that it could serve filters for the subsets 110 (txid+script+outpoint), 100 (txid only), 011 (script+outpoint) etc. This essentially removes the notion of decided filter types and instead leaves the decision to full-nodes. This would require a "getcftypes" message. The obvious benefit of this would be minimal bandwidth usage for the light client, but there are also some less obvious ones. We wouldn’t have to decide up front what each filter type should contain, only the possible elements a filter can contain. The main disadvantage of this as Johan sees it is that there’s an exponential blowup in the number of possible filter types in the number of element types. However, this would let us start out small with only the elements we need, and in the worst case the node operators just choose to serve the subsets corresponding to what now is called “regular” + “extended” filters anyway, requiring no more resources.


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