<oembed><type>rich</type><version>1.0</version><author_name>npub19helcfnqgk2jrwzjex2aflq6jwfc8zd9uzzkwlgwhve7lykv23mq5zkvn4</author_name><author_url>https://nostr.ae/npub19helcfnqgk2jrwzjex2aflq6jwfc8zd9uzzkwlgwhve7lykv23mq5zkvn4</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2018-05-19&#xA;📝 Original message:Riccardo wrote:&#xA;&gt; The BIP recall some go code for how the parameter has been selected which&#xA;&gt; I can hardly understand and run&#xA;&#xA;The code you&#39;re linking to is for generating test vectors (to allow&#xA;implementations to check the correctness of their gcs filters. The name of&#xA;the file is &#39;gentestvectors.go&#39;. It produces CSV files which contain test&#xA;vectors of various testnet blocks and at various false positive rates.&#xA;&#xA;&gt; it&#39;s totally my fault but if possible I would really like more details on&#xA;&gt; the process, like charts and explanations&#xA;&#xA;When we published the BIP draft last year (wow, time flies!), we put up code&#xA;(as well as an interactive website) showing the process we used to arrive at&#xA;the current false positive rate. The aim was to minimize the bandwidth&#xA;required to download each filter plus the expected bandwidth from&#xA;downloading &#34;large-ish&#34; full segwit blocks. The code simulated a few wallet&#xA;types (in terms of number of addrs, etc) focusing on a &#34;mid-sized&#34; wallet.&#xA;One could also model the selection as a Bernoulli process where we attempt&#xA;to compute the probability that after k queries (let&#39;s say you have k&#xA;addresses) we have k &#34;successes&#34;. A success would mean the queries item&#xA;wasn&#39;t found in the filter, while a failure is a filter match (false&#xA;positive or not). A failure in the process requires fetching the entire&#xA;block.&#xA;&#xA;-- Laolu&#xA;&#xA;On Fri, May 18, 2018 at 5:35 AM Riccardo Casatta via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; Another parameter which heavily affects filter size is the false positive&#xA;&gt; rate which is empirically set&#xA;&gt; &lt;https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki#construction&gt;&#xA;&gt; to 2^-20&#xA;&gt; The BIP recall some go code&#xA;&gt; &lt;https://github.com/Roasbeef/bips/blob/83b83c78e189be898573e0bfe936dd0c9b99ecb9/gcs_light_client/gentestvectors.go&gt;&#xA;&gt; for how the parameter has been selected which I can hardly understand and&#xA;&gt; run, it&#39;s totally my fault but if possible I would really like more details&#xA;&gt; on the process, like charts and explanations (for example, which is the&#xA;&gt; number of elements to search for which the filter has been optimized for?)&#xA;&gt;&#xA;&gt; Instinctively I feel 2^-20 is super low and choosing a lot higher alpha&#xA;&gt; will shrink the total filter size by gigabytes at the cost of having to&#xA;&gt; wastefully download just some megabytes of blocks.&#xA;&gt;&#xA;&gt;&#xA;&gt; 2018-05-17 18:36 GMT+02:00 Gregory Maxwell via bitcoin-dev &lt;&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&gt;:&#xA;&gt;&#xA;&gt;&gt; On Thu, May 17, 2018 at 3:25 PM, Matt Corallo via bitcoin-dev&#xA;&gt;&gt; &lt;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt;&gt; &gt; I believe (1) could be skipped entirely - there is almost no reason why&#xA;&gt;&gt; &gt; you&#39;d not be able to filter for, eg, the set of output scripts in a&#xA;&gt;&gt; &gt; transaction you know about&#xA;&gt;&gt;&#xA;&gt;&gt; I think this is convincing for the txids themselves.&#xA;&gt;&gt;&#xA;&gt;&gt; What about also making input prevouts filter based on the scriptpubkey&#xA;&gt;&gt; being _spent_?  Layering wise in the processing it&#39;s a bit ugly, but&#xA;&gt;&gt; if you validated the block you have the data needed.&#xA;&gt;&gt;&#xA;&gt;&gt; This would eliminate the multiple data type mixing entirely.&#xA;&gt;&gt; _______________________________________________&#xA;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; --&#xA;&gt; Riccardo Casatta - @RCasatta &lt;https://twitter.com/RCasatta&gt;&#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180518/b40519c4/attachment.html&gt;</html></oembed>