<oembed><type>rich</type><version>1.0</version><author_name>npub1ncnj8arudstdxzfhxk7k4nwgkrw3hyw8sgt0wqqmm5hh2c4knmgs2lqt2n</author_name><author_url>https://nostr.ae/npub1ncnj8arudstdxzfhxk7k4nwgkrw3hyw8sgt0wqqmm5hh2c4knmgs2lqt2n</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-12-11&#xA;📝 Original message:On Mon, Dec 11, 2017 at 1:04 PM, Gregory Maxwell &lt;greg at xiph.org&gt; wrote:&#xA;&#xA;&gt; On Mon, Dec 11, 2017 at 8:40 PM, Jim Posen via bitcoin-dev&#xA;&gt; &lt;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt; &gt; Firstly, I don&#39;t like the idea of making the net header encoding&#xA;&gt; dependent&#xA;&gt; &gt; on the specific header validation rules that Bitcoin uses (eg. the fact&#xA;&gt; that&#xA;&gt; &gt; difficulty is only recalculated every 2016 blocks). This would be&#xA;&gt; coupling&#xA;&gt;&#xA;&gt; In the last proposal I recall writing up, there was a one byte flag on&#xA;&gt; each header to indicate what was included.&#xA;&gt;&#xA;&gt;&#xA;Is there a link somewhere to that proposal? The only thing I could find was&#xA;your forwarded email&#xA;&lt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-September/014904.html&gt;&#xA;on&#xA;this thread.&#xA;&#xA;&#xA;&gt; Nbits _never_ needs to be sent even with other consensus rules because&#xA;&gt; its more or less necessarily a strict function of the prior headers.&#xA;&gt; This still holds in every clone of Bitcoin I&#39;m aware of; sending it&#xA;&gt; with the first header in a group probably makes sense so it can be&#xA;&gt; checked independently.&#xA;&gt;&#xA;&gt; &gt; with insufficient benefit.&#xA;&gt;&#xA;&gt; another &gt;18% reduction in size beyond the removal of prev. is not&#xA;&gt; insubstantial by any means.  I don&#39;t think it should lightly be&#xA;&gt; ignored.&#xA;&gt;&#xA;&gt;&#xA;Omitting nBits entirely seems reasonable, I wrote up a possible&#xA;implementation here&#xA;&lt;https://github.com/bitcoin/bitcoin/compare/master...jimpo:compact-headers-difficulty&gt;.&#xA;The downside is that it is more complex because it leaks into the&#xA;validation code. The extra 4 byte savings is certainly nice though.&#xA;&#xA;&#xA;&gt; Prev omission itself is not, sadly, magically compatible:  I am quite&#xA;&gt; confident that if there is a bitcoin hardfork it would recover the&#xA;&gt; nbits/4-guarenteed always-zero bits of prev to use as extra nonce for&#xA;&gt; miners. This has been proposed many times, implemented at least once,&#xA;&gt; and the current requirement for mining infrastructure to reach inside&#xA;&gt; the coinbase txn to increment a nonce has been a reliable source of&#xA;&gt; failures.  So I think we&#39;d want to have the encoding able to encode&#xA;&gt; leading prev bits.&#xA;&gt;&#xA;&gt; Many altcoins also change the header structures. If the better thing&#xA;&gt; is altcoin incompatible, we should still do it. Doing otherwise would&#xA;&gt; competitively hobble Bitcoin especially considering the frequent&#xA;&gt; recklessly incompetent moves made by various altcoins and the near&#xA;&gt; total lack of useful novel development we&#39;ve seen come out of the&#xA;&gt; clones.&#xA;&gt;&#xA;&gt; Probably the most important change in a new header message wouldn&#39;t be&#xA;&gt; the encoding, but it would be changing the fetching mechanism so that&#xA;&gt; header sets could be pulled in parallel, etc.&#xA;&gt;&#xA;&gt; I would rather not change the serialization of existing messages,&#xA;&gt; nodes are going to have to support speaking both messages for a long&#xA;&gt; time, and I think we already want a different protocol flow for&#xA;&gt; headers fetching in any case.&#xA;&gt;&#xA;&#xA;Can you elaborate on how parallel header fetching might work? getheaders&#xA;requests could probably already be pipelined, where the node requests the&#xA;next 2,000 headers before processing the current batch (though would make&#xA;sense to check that they are all above min difficulty first).&#xA;&#xA;I&#39;m open to more ideas on how to optimize the header download or design the&#xA;serialization format to be more flexible, but I&#39;m concerned that we forgo a&#xA;40-45% bandwidth savings on the current protocol for a long time because&#xA;something better might be possible later on or there might be a hard fork&#xA;that at some point requires another upgrade. I do recognize that supporting&#xA;multiple serialization formats simultaneously adds code complexity, but in&#xA;this case the change seems simple enough to me that the tradeoff is worth&#xA;it.&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20171211/995788a9/attachment-0001.html&gt;</html></oembed>