<oembed><type>rich</type><version>1.0</version><author_name>npub1g6vxlp4e0nyhs2dqxxcryztyf5f5hyuaq93nw4r87zcnv0sdsa0qqsl5wd</author_name><author_url>https://nostr.ae/npub1g6vxlp4e0nyhs2dqxxcryztyf5f5hyuaq93nw4r87zcnv0sdsa0qqsl5wd</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2019-10-12&#xA;📝 Original message:On Thu, Oct 10, 2019 at 5:20 PM Braydon Fuller via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt;  It would be interesting to have a succinct chainwork proof&#xA;&gt; for all cases. Chainwork being a sum of the total proof-of-work in a&#xA;&gt; chain. Such proofs currently only require a few headers for common cases&#xA;&gt; and the other cases can be identified.&#xA;&gt;&#xA;&#xA;I wonder if a &#34;seed&#34; based system would be useful.&#xA;&#xA;A seed is defined as a header with a very low digest.&#xA;&#xA;When a new peer connects, you ask him to send you the header with the&#xA;lowest digest on his main chain.&#xA;&#xA;Chains ending at the strongest seeds are kept preferentially when&#xA;discarding chains.&#xA;&#xA;This requires a way to download chains backwards, which the protocol&#xA;doesn&#39;t support at the moment.&#xA;&#xA;The most chain work chain is overwhelmingly likely to contain the header&#xA;with the strongest digest.&#xA;&#xA;This means that the honest peer&#39;s chain would be kept preferentially.&#xA;&#xA;It also means that a node that is synced to the main chain can easily&#xA;discard noise from dishonest peers.  Before downloading, they could ask the&#xA;peer to provide a header with at least 1% of the POW of the best header on&#xA;the main chain starting at the fork point.  If they can&#39;t then their fork&#xA;probably has less POW than the main chain.&#xA;&#xA;&#xA;&gt; A peer could&#xA;&gt; broadcast a few low-work header chains, reconnect and repeat ad nauseam.&#xA;&gt;&#xA;&#xA;I meant connected peer rather than peer.  If a peer disconnects and then&#xA;reconnects as a new peer, then their allocation of bandwidth/RAM resets to&#xA;zero.&#xA;&#xA;Each peer would be allocated a certain bandwidth per minute for headers as&#xA;in a token bucket system.   New peers would start with empty buckets.&#xA;&#xA;If an active (outgoing) peer is building on a header chain, then that chain&#xA;is preferentially kept.  Essentially, the last chain that each outgoing&#xA;peer built on may not be discarded.&#xA;&#xA;In retrospect, that works out as the same as throttling peer download, just&#xA;with a different method for throttling.&#xA;&#xA;In your system, peers who extend the best chain don&#39;t get throttled, but&#xA;the other peers do (but with a gradual transition).&#xA;&#xA;This could be accomplished by adding 80 bytes into the peers bucket if it&#xA;extends the main chain.&#xA;&#xA;&#xA;&gt; For example, let&#39;s assume a case that the initial chain of headers was&#xA;&gt; dishonest and with low chainwork. The initial block download retrieves&#xA;&gt; the header chain from a single loader peer first. Once recent time is&#xA;&gt; reached, header chains are downloaded from all outgoing peers.&#xA;&#xA;&#xA;The key it that it must not be possible to prevent a single honest peer&#xA;from making progress by flooding with other peers and getting the honest&#xA;peer&#39;s chain discarded.&#xA;&#xA;I think parallel downloading would be better than focusing on one peer&#xA;initially.  Otherwise, a dishonest peer can slowly send their headers to&#xA;prevent moving to parallel mode.&#xA;&#xA;Each connected peer is given a bandwidth and RAM allowance.  If a connected&#xA;peer forks off their own chain before reaching current time, then the fork&#xA;is just discarded.&#xA;&#xA;The RAM allowance would be sufficient to hold one header per minute since&#xA;genesis.&#xA;&#xA;The header chains are relatively small (50MB), so it is not unreasonable to&#xA;expect the honest peer to send the entire chain in one go.&#xA;&#xA;I wonder if there is a formula that gives the minimum chain work required&#xA;to have a particular chain length by now.&#xA;&#xA;1 minute per header would mean that the difficulty would increase every&#xA;adjustment, so it couldn&#39;t be maintained without an exponentially rising&#xA;total chain work.&#xA;&#xA;On Sat, Oct 12, 2019 at 2:41 AM Braydon Fuller via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt;   - Nodes are vulnerable during the initial sync when joining the&#xA;&gt; network until the minimum chainwork is achieved.&#xA;&#xA;&#xA;Nodes should stay &#34;headers-only&#34; until they have hit the threshold.&#xA;&#xA;It isn&#39;t really any different from a checkpoint anyway.&#xA;&#xA;Download headers until you hit this header is about the same as download&#xA;headers until you hit this chain work.&#xA;&#xA;It would be different if header chains were downloaded from the final&#xA;checkpoint backwards.&#xA;&#xA;You would start at a final checkpoint and work backwards.  Each ancestor&#xA;header is committed to by the final checkpoint, so it would not be possible&#xA;a dishonest peer to fool the node during IBD.&#xA;&#xA;&#xA;&gt; This is possible if the&#xA;&gt; loader peer is the attacker. To mitigate this there would need to be a&#xA;&gt; minimum chainwork defined based on the current chainwork. However, such&#xA;&gt; could also be used to prevent nodes from joining the network as it&#39;s&#xA;&gt; rejecting rather that throttling.&#xA;&gt;&#xA;&#xA;I think mixing two different concepts makes this problem more complex than&#xA;needed.&#xA;&#xA;It looks like they are aiming for hard-coding&#xA;&#xA;A) &#34;The main chain has at least C chainwork&#34;&#xA;B) &#34;All blocks after A is satisfied have at least X POW&#34;&#xA;&#xA;To me, this is equivalent to a checkpoint, without it having it be called a&#xA;checkpoint.&#xA;&#xA;The point about excluding checkpoints is that it means that (in theory) two&#xA;clients can&#39;t end up on incompatible forks due to different checkpoints.&#xA;&#xA;The &#34;checkpoint&#34; is replaced by a statement by the dev team that&#xA;&#xA;&#34;There exists at least one valid chain with C chainwork&#34;&#xA;&#xA;which is equivalent to&#xA;&#xA;&#34;The longest valid chain has at least C chainwork&#34;&#xA;&#xA;Two client making those statements can&#39;t cause a permanent&#xA;incompatibility.  If they pick a different C, then eventually, once the&#xA;main chain has more than the larger chain work, they will agree again.&#xA;&#xA;Checkpoints don&#39;t automatically heal.&#xA;&#xA;Adding in a minimum POW requirement could break the requirement for that to&#xA;happen.&#xA;&#xA;Just because B was met on the original main chain, a fork isn&#39;t required to&#xA;meet it.&#xA;&#xA;  - It&#39;s technically a consensus change each time the minimum difficulty&#xA;&gt; or best chainwork is updated. It is a similar consensus change as&#xA;&gt; maintaining the last checkpoint, as it&#39;s used to prevent forking prior&#xA;&gt; to the last checkpoint.&#xA;&gt;&#xA;&#xA;I agree on the min difficulty being a consensus change.&#xA;&#xA;The minimum chain work is just the devs making a true statement and then&#xA;using it to optimize things.&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20191012/24bb4eaa/attachment.html&gt;</html></oembed>