<div dir="ltr">Sorry if I continue on the subject even if <div class="gmail_default" style="font-size:small;display:inline">​custom filter types are considered in BIP 157/158</div><div class="gmail_default" style="font-size:small;display:inline">.</div><div><div class="gmail_default" style="font-size:small;display:inline">I am doing it</div> because<div class="gmail_default" style="font-size:small;display:inline">​:</div></div><div><div class="gmail_default" style="font-size:small;display:inline">1)​</div> with a fixed target FP=2^-20  (or 1/784931)<div class="gmail_default" style="font-size:small;display:inline">​ and the multi layer filtering maybe it&#39;s reasonable to consider less than ~20 bits for the golomb encoding of the per-block filter (one day committed in the blockchain) </div></div><div><div class="gmail_default" style="font-size:small;display:inline">2) based on the answer received, privacy leak if downloading a subset of filters doesn&#39;t look a concern</div></div><div><div class="gmail_default" style="font-size:small;display:inline">3) </div><span style="font-size:small">As far as I know, anyone is considering to use a map instead of a filter for the upper layers of the filter​.</span></div><div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><font size="2">Simplistic example:</font></div><div class="gmail_default"><font size="2">Suppose to have a 2 blocks blockchain, every block contains N items for the filter:</font><br></div><div class="gmail_default" style="font-size:small">1) In the current discussed filter we have 2 filters of 20N bits</div><div class="gmail_default" style="font-size:small">2) In a two <span style="color:rgb(34,34,34);font-family:sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">layer</span> solution, we have 1 map of (10+1)2N bits and 2 filters of 10N bits</div><div class="gmail_default" style="font-size:small">The additional bit in the map discriminate if the match is in the first or in the second block.</div></div><div class="gmail_default" style="font-size:small">Supposing to have 1 match in the two blocks, the filter size downloaded in the first case is always 40N bits, while the expected downloaded size in the second case is 22N+2^-10*10N+10N ~= 32N with the same FP because independence.</div><div class="gmail_default" style="font-size:small">This obviously isn&#39;t a full analysis of the methodology, the expected downloaded size in the second case could go from the best case 22N bits to the worst case of 42N bits...</div><div class="gmail_default" style="font-size:small"></div><div><br></div><div><div class="gmail_default" style="font-size:small">@Gregory<br></div></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">&gt; I don&#39;t know </span><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">what portion of coins created are spent in the same 144 block</span><br style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">window...</span><br></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">About 50%</span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><a href="https://github.com/RCasatta/coincount" target="_blank">source code</a></span><br></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">From block 393216 to 458752  (still waiting for results on all the blockchain)</span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:sans-serif;font-size:13px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><div class="gmail_default" style="font-size:small">Total outputs 264185587</div><div class="gmail_default" style="font-size:small">size: 2 spent: 11791058 ratio:0.04463172322871649</div><div class="gmail_default" style="font-size:small">size: 4 spent: 29846090 ratio:0.11297395266305728</div><div class="gmail_default" style="font-size:small">size: 16 spent: 72543182 ratio:0.2745917475051355</div><div class="gmail_default" style="font-size:small">size: 64 spent: 113168726 ratio:0.4283682818775424</div><div class="gmail_default" style="font-size:small">size: 144 spent: 134294070 ratio:0.508332311103709</div><div class="gmail_default" style="font-size:small">size: 256 spent: 148824781 ratio:0.5633342177747191</div><div class="gmail_default" style="font-size:small">size: 1024 spent: 179345566 ratio:0.6788620379960395</div><div class="gmail_default" style="font-size:small">size: 4096 spent: 205755628 ratio:0.7788298761355213</div><div class="gmail_default" style="font-size:small">size: 16384 spent: 224448158 ratio:0.849585174379706</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Another point to consider is that if we don&#39;t want the full transaction history of our wallet but only the UTXO, the upper layer map could contain only the item which are not already spent in the considered <span style="color:rgb(34,34,34);font-family:sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">window</span>. As we can see from the previous result if the window is 16384 ~85% of the elements are already spent suggesting a very high time locality. (apart 144, I choose power of 2 windows so there are an integer number of bits in the map)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It&#39;s possible we need ~20 bits anyway for the per-block filters because there are always connected wallets which one synced, always download the last filter, anyway the upper layer map looks very promising for longer sync.</div></span></div><div><div class="gmail_default" style="font-size:small;display:inline"></div></div><br><div class="gmail_quote"><div dir="ltr">Il giorno mer 6 giu 2018 alle ore 03:13 Olaoluwa Osuntokun &lt;<a href="mailto:laolu32@gmail.com" target="_blank">laolu32@gmail.com</a>&gt; ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>It isn&#39;t being discussed atm (but was discussed 1 year ago when the BIP</div><div>draft was originally published), as we&#39;re in the process of removing items</div><div>or filters that aren&#39;t absolutely necessary. We&#39;re now at the point where</div><div>there&#39;re no longer any items we can remove w/o making the filters less</div><div>generally useful which signals a stopping point so we can begin widespread</div><div>deployment.  </div><div><br></div><div>In terms of a future extension, BIP 158 already defines custom filter types,</div><div>and BIP 157 allows filters to be fetched in batch based on the block height</div><div>and numerical range. The latter feature can later be modified to return a</div><div>single composite filter rather than several individual filters.</div><div><br></div><div>-- Laolu</div><div><br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jun 4, 2018 at 7:28 AM Riccardo Casatta via bitcoin-dev &lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:small">I was wondering why this multi-layer multi-block filter proposal isn&#39;t getting any comment,</div><div style="font-size:small">is it because not asking all filters is leaking information?</div><div style="font-size:small"><br></div><div style="font-size:small">Thanks</div></div><br><div class="gmail_quote"><div dir="ltr">Il giorno ven 18 mag 2018 alle ore 08:29 Karl-Johan Alm via bitcoin-dev &lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt; ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, May 18, 2018 at 12:25 AM, Matt Corallo via bitcoin-dev<br>
&lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br>
&gt; In general, I&#39;m concerned about the size of the filters making existing<br>
&gt; SPV clients less willing to adopt BIP 158 instead of the existing bloom<br>
&gt; filter garbage and would like to see a further exploration of ways to<br>
&gt; split out filters to make them less bandwidth intensive. Some further<br>
&gt; ideas we should probably play with before finalizing moving forward is<br>
&gt; providing filters for certain script templates, eg being able to only<br>
&gt; get outputs that are segwit version X or other similar ideas.<br>
<br>
There is also the idea of multi-block filters. The idea is that light<br>
clients would download a pair of filters for blocks X..X+255 and<br>
X+256..X+511, check if they have any matches and then grab pairs for<br>
any that matched, e.g. X..X+127 &amp; X+128..X+255 if left matched, and<br>
iterate down until it ran out of hits-in-a-row or it got down to<br>
single-block level.<br>
<br>
This has an added benefit where you can accept a slightly higher false<br>
positive rate for bigger ranges, because the probability of a specific<br>
entry having a false positive in each filter is (empirically speaking)<br>
independent. I.e. with a FP probability of 1% in the 256 range block<br>
and a FP probability of 0.1% in the 128 range block would mean the<br>
probability is actually 0.001%.<br>
<br>
Wrote about this here: <a href="https://bc-2.jp/bfd-profile.pdf" rel="noreferrer" target="_blank">https://bc-2.jp/bfd-profile.pdf</a> (but the filter<br>
type is different in my experiments)<br>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-6972841931057250559m_6246143091615729883m_-8470615826258348836m_1798458504075039611m_-7236474083222447233gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Riccardo Casatta - <a href="https://twitter.com/RCasatta" target="_blank">@RCasatta</a></div></div>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
</blockquote></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-6972841931057250559m_6246143091615729883m_-8470615826258348836gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Riccardo Casatta - <a href="https://twitter.com/RCasatta" target="_blank">@RCasatta</a></div></div></div>