<oembed><type>rich</type><version>1.0</version><author_name>npub1f2nvlx49er5c7sqa43src6ssyp6snd4qwvtkwm5avc2l84cs84esecrwet</author_name><author_url>https://nostr.ae/npub1f2nvlx49er5c7sqa43src6ssyp6snd4qwvtkwm5avc2l84cs84esecrwet</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2016-05-10&#xA;📝 Original message:On Tue, May 10, 2016 at 5:28 AM, Rusty Russell via bitcoin-dev&#xA;&lt;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt; I used variable-length bit encodings, and used the shortest encoding&#xA;&gt; which is unique to you (including mempool).  It&#39;s a little more work,&#xA;&gt; but for an average node transmitting a block with 1300 txs and another&#xA;&gt; ~3000 in the mempool, you expect about 12 bits per transaction.  IOW,&#xA;&gt; about 1/5 of your current size.  Critically, we might be able to fit in&#xA;&gt; two or three TCP packets.&#xA;&#xA;Hm. 12 bits sounds very small even giving those figures. Why failure&#xA;rate were you targeting?&#xA;&#xA;I&#39;ve mostly been thing in terms of 3000 txn, and 20k mempools, and&#xA;blocks which are 90% consistent with the remote mempool, targeting&#xA;1/100000 failure rates (which is roughly where it should be to put it&#xA;well below link failure levels).&#xA;&#xA;If going down the path of more complexity, set reconciliation is&#xA;enormously more efficient (e.g. 90% reduction), which no amount of&#xA;packing/twiddling can achieve.&#xA;&#xA;But the savings of going from 20kb to 3kb is not interesting enough to&#xA;justify it*.  My expectation is that later we&#39;ll deploy set&#xA;reconciliation to fix relay efficiency, where the savings is _much_&#xA;larger,  and then with the infrastructure in place we could define&#xA;another compactblock mode that used it.&#xA;&#xA;(*Not interesting because it mostly reduces exposure to loss and the&#xA;gods of TCP, but since those are the long poles in the latency tent,&#xA;it&#39;s best to escape them entirely, see Matt&#39;s udp_wip branch.)&#xA;&#xA;&gt; I would also avoid the nonce to save recalculating for each node, and&#xA;&gt; instead define an id as:&#xA;&#xA;Doing this would greatly increase the cost of a collision though, as&#xA;it would happen in many places in the network at once over the on the&#xA;network at once, rather than just happening on a single link, thus&#xA;hardly impacting overall propagation.&#xA;&#xA;(The downside of the nonce is that you get an exponential increase in&#xA;the rate that a collision happens &#34;somewhere&#34;, but links fail&#xA;&#34;somewhere&#34; all the time-- propagation overall doesn&#39;t care about&#xA;that.)&#xA;&#xA;Using the same nonce means you also would not get a recovery gain from&#xA;jointly decoding using compact blocks sent from multiple peers (which&#xA;you&#39;ll have anyways in high bandwidth mode).&#xA;&#xA;With a nonce a sender does have the option of reusing what they got--&#xA;but the actual encoding cost is negligible, for a 2500 transaction&#xA;block its 27 microseconds (once per block, shared across all peers)&#xA;using Pieter&#39;s suggestion of siphash 1-3 instead of the cheaper&#xA;construct in the current draft.&#xA;&#xA;Of course, if you&#39;re going to check your whole mempool to reroll the&#xA;nonce, thats another matter-- but that seems wasteful compared to just&#xA;using a table driven size with a known negligible failure rate.&#xA;&#xA;64-bits as a maximum length is high enough that the collision rate&#xA;would be negligible even under fairly unrealistic assumptions-- so&#xA;long as it&#39;s salted. :)&#xA;&#xA;&gt; As Peter R points out, we could later enhance receiver to brute force&#xA;&gt; collisions (you could speed that by sending a XOR of all the txids, but&#xA;&gt; really if there are more than a few collisions, give up).&#xA;&#xA;The band between &#34;no collisions&#34; and &#34;infeasible many&#34; is fairly&#xA;narrow.  You can add a small amount more space to the ids and&#xA;immediately be in the no collision zone.&#xA;&#xA;Some earlier work we had would send small amount of erasure coding&#xA;data of the next couple bytes of the IDs.  E.g. the receiver in all&#xA;the IDs you know, mark totally unknown IDs as erased and the let the&#xA;error correction fix the rest. This let you algebraically resolve&#xA;collisions _far_ beyond what could be feasibly bruteforced. Pieter&#xA;went and implemented... but the added cost of encoding and software&#xA;complexity seem not worth it.</html></oembed>