<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-31&#xA;📝 Original message:Hi y&#39;all,&#xA;&#xA;I&#39;ve made a PR to the BIP repo to modify BIP 158 based on this thread, and&#xA;other recent threads giving feedback on the current version of the BIP:&#xA;&#xA;  * https://github.com/bitcoin/bips/pull/687&#xA;&#xA;I&#39;ve also updated the test vectors based on the current parameters (and&#xA;filter format), and also the code used to generate the test vectors. Due to&#xA;the change in parametrization, the test vectors now target (P=19 M=784931),&#xA;and there&#39;re no longer any cases related to extended filters.&#xA;&#xA;One notable thing that I left off is the proposed change to use the previous&#xA;output script rather than the outpoint. Modifying the filters in this&#xA;fashion would be a downgrade in the security model for light clients, as it&#xA;would allow full nodes to lie by omission, just as they can with BIP 37. As&#xA;is now, if nodes present conflicting information, then the light client can&#xA;download the target block, fully reconstruct the filter itself, then ban any&#xA;nodes which advertised the incorrect filter. The inclusion of the filter&#xA;header checkpoints make it rather straight forward for light clients to&#xA;bisect the state to find the conflicting advertisement, and it&#39;s strongly&#xA;recommended that they do so.&#xA;&#xA;To get a feel for the level of impact these changes would have on existing&#xA;applications that depend on the txid being included in the filter, I&#39;ve&#xA;implemented these changes across btcutil, btcd, btcwallet, and lnd (which&#xA;previously relied on the txid for confirmation notifications). For lnd at&#xA;least, the code impact was rather minimal, as we use the pkScript for&#xA;matching a block, but then still scan the block manually to find the precise&#xA;transaction (by txid) that we were interested in (if it&#39;s there).&#xA;&#xA;-- Laolu&#xA;&#xA;&#xA;On Mon, May 28, 2018 at 9:01 PM Olaoluwa Osuntokun &lt;laolu32 at gmail.com&gt;&#xA;wrote:&#xA;&#xA;&gt; &gt; The additional benefit of the input script/outpoint filter is to watch&#xA;&gt; for&#xA;&gt; &gt; unexpected spends (coins getting stolen or spent from another wallet) or&#xA;&gt; &gt; transactions without a unique change or output address. I think this is a&#xA;&gt; &gt; reasonable implementation, and it would be nice to be able to download&#xA;&gt; that&#xA;&gt; &gt; filter without any input elements.&#xA;&gt;&#xA;&gt; As someone who&#39;s implemented a complete integration of the filtering&#xA;&gt; technique into an existing wallet, and a higher application I disagree.&#xA;&gt; There&#39;s not much gain to be had in splitting up the filters: it&#39;ll result&#xA;&gt; in&#xA;&gt; additional round trips (to fetch these distinct filter) during normal&#xA;&gt; operation, complicate routine seed rescanning logic, and also is&#xA;&gt; detrimental&#xA;&gt; to privacy if one is fetching blocks from the same peer as they&#39;ve&#xA;&gt; downloaded the filters from.&#xA;&gt;&#xA;&gt; However, I&#39;m now convinced that the savings had by including the prev&#xA;&gt; output&#xA;&gt; script (addr re-use and outputs spent in the same block as they&#39;re created)&#xA;&gt; outweigh the additional booking keeping required in an implementation (when&#xA;&gt; extracting the precise tx that matched) compared to using regular outpoint&#xA;&gt; as we do currently. Combined with the recently proposed re-parametrization&#xA;&gt; of the gcs parameters[1], the filter size should shrink by quite a bit!&#xA;&gt;&#xA;&gt; I&#39;m very happy with the review the BIPs has been receiving as of late. It&#xA;&gt; would&#39;ve been nice to have this 1+ year ago when the draft was initially&#xA;&gt; proposed, but better late that never!&#xA;&gt;&#xA;&gt; Based on this thread, [1], and discussions on various IRC channels, I plan&#xA;&gt; to make the following modifications to the BIP:&#xA;&gt;&#xA;&gt;   1. use P=2^19 and M=784931 as gcs parameters, and also bind these to the&#xA;&gt;      filter instance, so future filter types may use distinct parameters&#xA;&gt;   2. use the prev output script rather than the prev input script in the&#xA;&gt;      regular filter&#xA;&gt;   3. remove the txid from the regular filter(as with some extra&#xA;&gt; book-keeping&#xA;&gt;      the output script is enough)&#xA;&gt;   4. do away with the extended filter all together, as our original use&#xA;&gt; case&#xA;&gt;      for it has been nerfed as the filter size grew too large when doing&#xA;&gt;      recursive parsing. instead we watch for the outpoint being spent and&#xA;&gt;      extract the pre-image from it if it matches now&#xA;&gt;&#xA;&gt; The resulting changes should slash the size of the filters, yet still&#xA;&gt; ensure&#xA;&gt; that they&#39;re useful enough for our target use case.&#xA;&gt;&#xA;&gt; [1]:&#xA;&gt; https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-May/016029.html&#xA;&gt;&#xA;&gt; -- Laolu&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180531/5499982f/attachment-0001.html&gt;</html></oembed>