<oembed><type>rich</type><version>1.0</version><author_name>npub1zw7cc8z78v6s3grujfvcv3ckpvg6kr0w7nz9yzvwyglyg0qu5sjsqhkhpx</author_name><author_url>https://nostr.ae/npub1zw7cc8z78v6s3grujfvcv3ckpvg6kr0w7nz9yzvwyglyg0qu5sjsqhkhpx</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2016-05-10&#xA;📝 Original message:Pieter Wuille via bitcoin-dev &lt;bitcoin-dev at lists.linuxfoundation.org&gt; writes:&#xA;&gt; On 05/03/2016 12:13 AM, lf-lists at mattcorallo.com (Matt Corallo) wrote:&#xA;&gt;&gt; Hi all,&#xA;&gt;&gt; &#xA;&gt;&gt; The following is a BIP-formatted design spec for compact block relay&#xA;&gt;&gt; designed to limit on wire bytes during block relay. You can find the&#xA;&gt;&gt; latest version of this document at&#xA;&gt;&gt; https://github.com/TheBlueMatt/bips/blob/master/bip-TODO.mediawiki.&#xA;&gt;&#xA;&gt; Hi Matt,&#xA;&gt;&#xA;&gt; thank you for working on this!&#xA;&#xA;Indeed!  Sorry for the delayed feedback.&#xA;&#xA;&gt;&gt; |shortids||List of uint64_ts||8*shortids_length bytes||Little&#xA;&gt;&gt; Endian||The short transaction IDs calculated from the transactions which&#xA;&gt;&gt; were not provided explicitly in prefilledtxn&#xA;&gt;&#xA;&gt; I tried to derive what length of short ids is actually necessary (some&#xA;&gt; write-up is on&#xA;&gt; https://gist.github.com/sipa/b2eb2e486156b5509ac711edd16153ed but it&#39;s&#xA;&gt; incomplete).&#xA;&#xA;I did this for IBLT testing.&#xA;&#xA;I used variable-length bit encodings, and used the shortest encoding&#xA;which is unique to you (including mempool).  It&#39;s a little more work,&#xA;but for an average node transmitting a block with 1300 txs and another&#xA;~3000 in the mempool, you expect about 12 bits per transaction.  IOW,&#xA;about 1/5 of your current size.  Critically, we might be able to fit in&#xA;two or three TCP packets.&#xA;&#xA;The wire encoding of all those bit arrays was:&#xA;  [varint-min-numbits] - Shortest bit array length&#xA;  [varint-array-size]  - Number of bit arrays.&#xA;          [varint-num].... - Number of entries in array N (x varint-array-size)&#xA;  [packed-bit-arrays...]&#xA;&#xA;  Last byte was padded with zeros.&#xA;  See: https://github.com/rustyrussell/bitcoin-iblt/blob/master/wire_encode.cpp#L12&#xA;&#xA;I would also avoid the nonce to save recalculating for each node, and&#xA;instead define an id as:&#xA;&#xA;        [&lt;64-bit-short-id&gt;][txid]&#xA;&#xA;Since you only ever send as many bits as needed to distinguish, this only&#xA;makes a difference if there actually are collisions.&#xA;&#xA;As Peter R points out, we could later enhance receiver to brute force&#xA;collisions (you could speed that by sending a XOR of all the txids, but&#xA;really if there are more than a few collisions, give up).&#xA;&#xA;And a prototype could just always send 64-bit ids to start.&#xA;&#xA;Cheers,&#xA;Rusty.</html></oembed>