<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <updated></updated>
  <generator>https://nostr.ae</generator>

  <title>Nostr notes by </title>
  <author>
    <name></name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://nostr.ae/npub12jllrss5nmygfhg7j9ztk2te80t96kumx7cllfc29skut6phqh5qfhfxgj.rss" />
  <link href="https://nostr.ae/npub12jllrss5nmygfhg7j9ztk2te80t96kumx7cllfc29skut6phqh5qfhfxgj" />
  <id>https://nostr.ae/npub12jllrss5nmygfhg7j9ztk2te80t96kumx7cllfc29skut6phqh5qfhfxgj</id>
  <icon></icon>
  <logo></logo>




  <entry>
    <id>https://nostr.ae/nevent1qqszlnk27sw8zhqpr477djnxdj6gu30va2jte87ttlm5x4yhdahcs4szyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7s2pghg3</id>
    
      <title type="html">📅 Original date posted:2019-10-01 📝 Original message: ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqszlnk27sw8zhqpr477djnxdj6gu30va2jte87ttlm5x4yhdahcs4szyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7s2pghg3" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsy3ty57fwknd249fsu7e0sqa823rfsj3ms4vpekkj0r64pkgwhcmg527wry&#39;&gt;nevent1q…7wry&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-10-01&lt;br/&gt;📝 Original message:&lt;br/&gt;Thanks Christian for pulling together this concise summary.&lt;br/&gt;&lt;br/&gt;1.  General agreement on the usefulness of noinput / anyprevoutanyscript /&lt;br/&gt;&amp;gt;     anyprevout.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;I certainly support the unification and adoption of the sighash_noinput and&lt;br/&gt;anyprevoutput* proposals to enable eltoo, but also to make possible better&lt;br/&gt;off-chain protocol designs generally.&lt;br/&gt;&lt;br/&gt;Among the various advantages previously discussed, the particular use case&lt;br/&gt;benefits from eltoo I want to take advantage of is less interactive payment&lt;br/&gt;channel negotiation.&lt;br/&gt;&lt;br/&gt;In talking with people about eltoo this summer, I found most people&lt;br/&gt;generally support adding this as an option to Lightning. The only general&lt;br/&gt;concern I heard, if any,  was the vague idea that rebindable transactions&lt;br/&gt;could be somehow misused or abused.&lt;br/&gt;&lt;br/&gt;I believe when these concerns are made more concrete they can be classified&lt;br/&gt;and addressed.&lt;br/&gt;&lt;br/&gt;I don&amp;#39;t find too compelling the potential problem of a &amp;#39;bad wallet&lt;br/&gt;designer&amp;#39;, whether lazy or dogmatic, misusing noinput. I think there are&lt;br/&gt;simpler ways to cut corners and there will always be plenty of good wallet&lt;br/&gt;options people can choose.&lt;br/&gt;&lt;br/&gt;Because scripts signed with no_input signatures are only really exchanged&lt;br/&gt;and used for off-chain negotiations, very few should ever appear on chain.&lt;br/&gt;Those that do should represent non-cooperative situations that involve&lt;br/&gt;signing parties who know not to reuse or share scripts with these public&lt;br/&gt;keys again. No third party has any reason to spend value to a&lt;br/&gt;multisignature script they don&amp;#39;t control, whether or not a no_input&lt;br/&gt;signature exists for it.&lt;br/&gt;&lt;br/&gt;2.  Is there strong support or opposition to the chaperone signatures&lt;br/&gt;&amp;gt;     introduced in anyprevout / anyprevoutanyscript? I think it&amp;#39;d be best to&lt;br/&gt;&amp;gt;     formulate a concrete set of pros and contras, rather than talk about&lt;br/&gt;&amp;gt;     abstract dangers or advantages.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;As I mentioned before, I don&amp;#39;t think the lazy wallet designer advantage is&lt;br/&gt;enough to justify the downsides of chaperone signatures. One additional&lt;br/&gt;downside is the additional code complexity required to flag whether or not&lt;br/&gt;a chaperone output is included. By comparison, the code changes for&lt;br/&gt;creating a no_input digest that skips the prevout and prevscript parts of a&lt;br/&gt;tx is much less intrusive and easier to maintain.&lt;br/&gt;&lt;br/&gt;3.  The same for output tagging / explicit opt-in. What are the advantages&lt;br/&gt;&amp;gt; and&lt;br/&gt;&amp;gt;     disadvantages?&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;I see the point ZmnSCPxj makes about tagged outputs negatively impacting&lt;br/&gt;the anonymity set of taproot transactions. The suggested work around would&lt;br/&gt;impose a cost to unilateral closes of an additional translation transaction&lt;br/&gt;and not using the work around would cause a hit to anonymity for off-chain&lt;br/&gt;script users. I feel both costs are too high relative to the benefit gained&lt;br/&gt;of preventing sloppy reuse of public keys.&lt;br/&gt;&lt;br/&gt;4.  Shall we merge BIP-118 and bip-anyprevout. This would likely reduce the&lt;br/&gt;&amp;gt;     confusion and make for simpler discussions in the end.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;I believe they should be merged. I also think both chaperone signatures and&lt;br/&gt;output tagging should become part of the discussion of security&lt;br/&gt;alternatives, but not part of the initial specification.&lt;br/&gt;&lt;br/&gt;I understand the desire to be conservative with protocol changes that could&lt;br/&gt;be misused. However, with just taproot and taproot public key types the&lt;br/&gt;anyprevout functionality is already very opt-in and not something that&lt;br/&gt;might accidentally get used. Belt-and-suspender protections like chaperone&lt;br/&gt;signatures and tagged outputs have their own impacts on code complexity,&lt;br/&gt;on-chain transaction sizes and transaction anonymity that also must be&lt;br/&gt;considered.&lt;br/&gt;&lt;br/&gt;I believe efforts like descriptors will help people follow best practices&lt;br/&gt;when working with complex scripts without pushing extra complexity for&lt;br/&gt;safety into the consensus layer of bitcoin. Anywhere we can make core code&lt;br/&gt;simpler, and handle foot-guns in higher level non-consensus code, the&lt;br/&gt;better.&lt;br/&gt;&lt;br/&gt;_______________________________________________&lt;br/&gt;&lt;br/&gt;&amp;gt; Lightning-dev mailing list&lt;br/&gt;&amp;gt; Lightning-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191001/f57d3131/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20191001/f57d3131/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:56:23Z</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsqrksc3nwaulxmx0aw3jrzpm0jfw0ana6g9pt8ypup4t2rhqaa5yszyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7se5pspx</id>
    
      <title type="html">📅 Original date posted:2019-09-16 📝 Original message: ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsqrksc3nwaulxmx0aw3jrzpm0jfw0ana6g9pt8ypup4t2rhqaa5yszyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7se5pspx" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsyn6wankjgy3kslg6vgggccq2jhg3mj59pg2kly059d929senp3gqpr5k4f&#39;&gt;nevent1q…5k4f&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2019-09-16&lt;br/&gt;📝 Original message:&lt;br/&gt;Thanks for the feedback ZmnSCPxj.&lt;br/&gt;&lt;br/&gt;I imagine a future where most people do not typically have single-signer&lt;br/&gt;&amp;gt; ownership of coins onchain, but are instead share-owners of coins, with&lt;br/&gt;&amp;gt; single-signer ownership occurring onchain only in the case of dispute or&lt;br/&gt;&amp;gt; for long-term cold storage.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;The change-in-membership ritual you describe seems like a good start for&lt;br/&gt;elaborating on this idea.&lt;br/&gt;&lt;br/&gt;Some aspects of multi-party Decker-Russell-Osuntokun channels have analogs&lt;br/&gt;to a signet blockchain that use a n-of-n federation of signers. But other&lt;br/&gt;places, like change-in-membership, do not have direct analogs.&lt;br/&gt;&lt;br/&gt;For example, some signet concepts with multi-party channel analogs:&lt;br/&gt;&lt;br/&gt;block script:&lt;br/&gt;* the first &amp;#39;update&amp;#39; and &amp;#39;settle&amp;#39; transactions, aka &amp;#39;setup&amp;#39; and &amp;#39;refund&amp;#39;&lt;br/&gt;transactions, define the set of signers that must sign subsequent channel&lt;br/&gt;updates&lt;br/&gt;&lt;br/&gt;genesis block:&lt;br/&gt;* the initial &amp;#39;funding&amp;#39; transaction, aka outpoint of the commitment&lt;br/&gt;transaction, which establishes the funded channel&lt;br/&gt;&lt;br/&gt;utxo set:&lt;br/&gt;* the specific set of on-chain outputs from the &amp;#39;settlement&amp;#39; transaction&lt;br/&gt;that spends the balance of the latest &amp;#39;update&amp;#39; transaction signed by the&lt;br/&gt;complete set of channel parties.&lt;br/&gt;&lt;br/&gt;mempool:&lt;br/&gt;* the set of proposals for specific changes to the set of outputs from the&lt;br/&gt;latest &amp;#39;settlement&amp;#39; transaction (similar to update_add_htlc,&lt;br/&gt;update_fail_htlc, etc)&lt;br/&gt;&lt;br/&gt;Concepts where layer two channels do not have an obvious analog to a layer&lt;br/&gt;one signet blockchain:&lt;br/&gt;&lt;br/&gt;cooperative close:&lt;br/&gt;* when all parties mutually agree to close the channel&lt;br/&gt;* close the channel with a layer one transaction which finalizes the&lt;br/&gt;outputs from the most recent channel output state&lt;br/&gt;* should be optimized for privacy and low on-chain fees&lt;br/&gt;&lt;br/&gt;membership change (ZmnSCPxj ritual):&lt;br/&gt;* when channel parties want to leave or add new members to the channel&lt;br/&gt;* close and reopen a new channel via something like a channel splicing&lt;br/&gt;transaction to the layer one blockchain&lt;br/&gt;* should be optimized for privacy and low on-chain fees paid for by parties&lt;br/&gt;entering and leaving the channel&lt;br/&gt;&lt;br/&gt;balance change (similar to membership change):&lt;br/&gt;* when channel parties want to add or remove some of the finalized value in&lt;br/&gt;the channel&lt;br/&gt;* close and reopen a new channel via something like a channel splicing&lt;br/&gt;transaction to the layer one blockchain&lt;br/&gt;* should be optimized for privacy and low on-chain fees paid for by parties&lt;br/&gt;adding and removing value from the channel&lt;br/&gt;&lt;br/&gt;uncooperative close:&lt;br/&gt;* when one or more nodes fails to sign the next channel state update&lt;br/&gt;* use a layer one transaction to commit both finalized and un-finalized&lt;br/&gt;outputs from the most recent channel output state&lt;br/&gt;* script timeouts determine when channel parties should uncooperatively&lt;br/&gt;close the channel if not all parties have signed the next &amp;#39;update&amp;#39; and&lt;br/&gt;&amp;#39;settlement&amp;#39; transaction&lt;br/&gt;&lt;br/&gt;uncooperative membership change:&lt;br/&gt;* a subset of channel parties might want to cooperatively sign a channel&lt;br/&gt;splicing transaction to &amp;#39;splice out&amp;#39; uncooperative parties&lt;br/&gt;&lt;br/&gt;mining, mining reward and difficulty adjustment&lt;br/&gt;* no equivalent concept for multi-party channels&lt;br/&gt;&lt;br/&gt;transaction fees:&lt;br/&gt;* updates to layer two channels do not incur transactions fees&lt;br/&gt;* invalid updates dropped to layer one should be paid by cheating node&lt;br/&gt;* splice in/out transactions should be paid by requesting signers only&lt;br/&gt;* do transaction fees prevent &amp;#39;griefing&amp;#39; attacks?&lt;br/&gt;&lt;br/&gt;privacy:&lt;br/&gt;* disassociate a particular update from signer(s)&lt;br/&gt;* disassociate IP address of signers from signature&lt;br/&gt;* using SIGHASH_ALL for cooperative closes&lt;br/&gt;&lt;br/&gt;liveness:&lt;br/&gt;* if signers know they will be offline, can they pre-sign updates that just&lt;br/&gt;commit their own outputs, rather then splice out?&lt;br/&gt;* contingent tap-leafs to splice out non-responsive signers&lt;br/&gt;&lt;br/&gt;The &amp;#34;block&amp;#34; that would need to be signed by the participants would actually&lt;br/&gt;&amp;gt; be a Decker-Russell-Osuntokun update&#43;state transaction, and would commit to&lt;br/&gt;&amp;gt; the UTXO set rather than the transaction set.&lt;br/&gt;&amp;gt; Unless I misunderstand your meaning here.&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt; Oops, ya, I did mean a &amp;#34;block&amp;#34; to be a particular Decker-Russell-Osuntokun&lt;br/&gt;update&#43;state transaction.&lt;br/&gt;&lt;br/&gt;I think it will be useful to have these ideas in the back of my mind as I&lt;br/&gt;work on making eltoo scripts that support multi-party channels.&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;Richard Myers&lt;br/&gt;Decentralized Applications Engineer, goTenna&lt;br/&gt;gotenna.com&lt;br/&gt;@gotenna&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20190916/afc6b87e/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/20190916/afc6b87e/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-09T12:56:04Z</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsfufad57w2hxtasnv5lqt4tghx99n0c0v6nw25g26f5ud4kp5c3jqzyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7s2nqvw7</id>
    
      <title type="html">📅 Original date posted:2022-04-24 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsfufad57w2hxtasnv5lqt4tghx99n0c0v6nw25g26f5ud4kp5c3jqzyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7s2nqvw7" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqst62vwckkrykyddgg56kvnt0y56gzgsml8xlurm8pgal6r3vru8xgxpw7qe&#39;&gt;nevent1q…w7qe&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-04-24&lt;br/&gt;📝 Original message:Hi darosior,&lt;br/&gt;&lt;br/&gt;Thanks for sharing your thoughts on this.&lt;br/&gt;&lt;br/&gt;&amp;gt; I would like to know people&amp;#39;s sentiment about doing (a very slightly tweaked version of) BIP118 in place of&lt;br/&gt;&amp;gt; (or before doing) BIP119.&lt;br/&gt;&lt;br/&gt;Sounds good to me. Although from an activation perspective it may not be either/or, both proposals do compete for scarce reviewer time so their ordering will necessarily be driven by reviewer&amp;#39;s priorities. My priority is eltoo which is why I focus on BIP-118.&lt;br/&gt;&lt;br/&gt;&amp;gt; SIGHASH_ANYPREVOUTANYSCRIPT, if its &amp;#34;ANYONECANPAY&amp;#34; behaviour is made optional [0], can emulate CTV just fine.&lt;br/&gt;&lt;br/&gt;For someone not as versed in CTV, why is it necessary that ANYONECANPAY be optional to emulate CTV? Is there a write-up that explains how APO-AS w/out ANYONECANPAY approximates CTV?&lt;br/&gt;&lt;br/&gt;In the case of eltoo commit txs, we use bring-your-own-fee (BYOF) to late-bind fees; that means ANYONECANPAY will always be paired with APO-AS for eltoo. Settlement txs in eltoo use just APO and do not necessarily need to be paired with ANYONECANPAY.&lt;br/&gt;&lt;br/&gt;I would guess making ANYONECANPAY the default for APO-AS was a way to squeeze in one more sighash flag. Perhaps there&amp;#39;s another way to do it?&lt;br/&gt;&lt;br/&gt;Including SIGHASH_GROUP with APO for eltoo is also tempting. Specifically so the counter-party who commits a settlement tx can use for fees their settled to_self balance. How to rejigger the sighash flags to accommodate both APO and GROUP may be worth some discussion.&lt;br/&gt;&lt;br/&gt;The BIP-118 proposal will certainly benefit from having input from reviewers looking at other protocols than eltoo.&lt;br/&gt;&lt;br/&gt;  -- Richard
    </content>
    <updated>2023-06-07T23:08:00Z</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqs9psfn69q70fm8d57s0vjn5v5e3hu4ahzve2ss4fsn04v34ch7ldgzyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7scudxkg</id>
    
      <title type="html">📅 Original date posted:2020-08-03 📝 Original message:Thanks ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqs9psfn69q70fm8d57s0vjn5v5e3hu4ahzve2ss4fsn04v34ch7ldgzyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7scudxkg" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsttq97hgf7nylsl6hdaxqyh0rnjq0wq0lef0utqyeflyy7xtphnsqr8mp2t&#39;&gt;nevent1q…mp2t&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-08-03&lt;br/&gt;📝 Original message:Thanks AJ for the updated BIP - very exciting!&lt;br/&gt;&lt;br/&gt;I&amp;#39;m also interested in this in the context of a Taproot version of&lt;br/&gt;Decker-Russell-Osuntokun (eltoo). Thanks ZmnSCPxj for summarizing your&lt;br/&gt;thoughts on how this would work. I have had some difficulty understanding&lt;br/&gt;when someone might want to use ANYPREVOUT vs. ANYPREVOUTANYSCRIPT and this&lt;br/&gt;is a clever demonstration of how the differences can be exploited.&lt;br/&gt;&lt;br/&gt;I sketched out the protocol you described to help my understand it (below)&lt;br/&gt;and some questions came to mind:&lt;br/&gt;&lt;br/&gt;1) If you do a collaborative close, would you need to use script-path&lt;br/&gt;spending, or could you use key-path spending instead to improve privacy?&lt;br/&gt;&lt;br/&gt;2) You mention 1.5 round trips for the (two party) MuSig signing session.&lt;br/&gt;Must there be separate 1.5 round trips for each of the two signatures&lt;br/&gt;produced (update, settlement) for each state update?&lt;br/&gt;&lt;br/&gt;3) A related question: can the 1.5 round trips for signing be combined with&lt;br/&gt;the 1.5 round trips required to update the channel (ie. A signs settlement&lt;br/&gt;tx, B signs settlement &amp;amp; update txs, A signs update tx)?&lt;br/&gt;&lt;br/&gt;Perhaps something like this:&lt;br/&gt; -&amp;gt; A provides partial signature for settlement tx&lt;br/&gt; &amp;lt;- B provides complete signature for settlement tx and partial signature&lt;br/&gt;for update tx&lt;br/&gt; -&amp;gt; A provides complete signature for update tx&lt;br/&gt;&lt;br/&gt;4) I&amp;#39;m not sure why AJ&amp;#39;s formulation included an addition sig(X), but&lt;br/&gt;otherwise is it similar to what you&amp;#39;re suggesting?&lt;br/&gt;&lt;br/&gt;&lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-May/001996.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-May/001996.html&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;All the best,&lt;br/&gt;&lt;br/&gt;  -- Richard&lt;br/&gt;&lt;br/&gt;------- my interpretation of your scheme ----&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;  [Fund Channel]&lt;br/&gt;    |&lt;br/&gt;    |&lt;br/&gt;    |&lt;br/&gt;    v&lt;br/&gt;   P=Musig(A,B)&#43;scripts (Taproot internal key, aka script path key?)&lt;br/&gt;   Q=Musig(A,B) (Taproot output key, aka root key?)&lt;br/&gt;&lt;br/&gt;   OR ----------- [Cooperative Close]&lt;br/&gt;   |||            Sig(Q) -----&#43;&lt;br/&gt;   |||                        |----&amp;gt; Sig(A)...&lt;br/&gt;   |||                        |&lt;br/&gt;   |||                        |----&amp;gt; Sig(B)...&lt;br/&gt;   |||&lt;br/&gt;   |||&lt;br/&gt;   ||&#43;--&amp;gt;[Update(n)]&lt;br/&gt;   ||    nlocktime/state &amp;gt; n&lt;br/&gt;   ||    Sig(P)&#43;ANYPREVOUTANYSCRIPT&lt;br/&gt;   ||&lt;br/&gt;   ||     OR ----------&amp;gt;[Settle(n)]           [Uncooperative Close @&lt;br/&gt;state n]&lt;br/&gt;   ||      |            Sig(P)&#43;ANYPREVOUT&lt;br/&gt;   ||      |            csv [delay] --------&#43;---&amp;gt; Sig(A)...    [HTLCs&lt;br/&gt;&amp;amp; Settled&lt;br/&gt;   ||      |                                |&lt;br/&gt;Outputs ]&lt;br/&gt;   ||      |                                |---&amp;gt; Sig(B)...&lt;br/&gt;   ||      v&lt;br/&gt;   |&#43;----&amp;gt;[Update(n&#43;1)]&lt;br/&gt;   |      nlocktime/state &amp;gt; n&#43;1&lt;br/&gt;   |      Sig(P)&#43;ANYPREVOUTANYSCRIPT&lt;br/&gt;   |&lt;br/&gt;   |      OR -----------&amp;gt;[Settle(n&#43;1)]        [Uncooperative Close @&lt;br/&gt;state n&#43;1]&lt;br/&gt;   |       |             Sig(P)&#43;ANYPREVOUT&lt;br/&gt;   |       |             csv [delay] -------&#43;---&amp;gt; Sig(A)...    [HTLCs&lt;br/&gt;&amp;amp; Settled&lt;br/&gt;   |       |                                |&lt;br/&gt;Outputs ]&lt;br/&gt;   v       v                                |---&amp;gt; Sig(B)...&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Fri, Jul 10, 2020 at 5:30 AM ZmnSCPxj via bitcoin-dev&lt;br/&gt;&amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;...&lt;br/&gt;&lt;br/&gt;&amp;gt; Slightly off-topic, but I suppose a Decker-Russell-Osuntokun construction&lt;br/&gt;&amp;gt; could, in theory, have only a single internal taproot pubkey, `P = MuSig(A,&lt;br/&gt;&amp;gt; B)` for a channel between A and B.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; So the funding outpoint would be spent with a taprooted P &#43; a single&lt;br/&gt;&amp;gt; tapscript `&amp;lt;1&amp;gt; OP_CHECKSIG`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Update transactions would be signed with the internal taproot pubkey using&lt;br/&gt;&amp;gt; `SIGHASH_ANYPREVOUTANYSCRIPT`.&lt;br/&gt;&amp;gt; The update transaction output would be spendable with a taprooted P &#43; a&lt;br/&gt;&amp;gt; single tapscript `&amp;lt;index &#43; 1&amp;gt; OP_CHECKLOCKTIMEVERIFY OP_DROP &amp;lt;1&amp;gt;&lt;br/&gt;&amp;gt; OP_CHECKSIG`.&lt;br/&gt;&amp;gt; Each update transaction would have a monotonically-increasing `nLockTime`,&lt;br/&gt;&amp;gt; i.e. the above `index`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Then a state transaction would be signed with the internal taproot pubkey&lt;br/&gt;&amp;gt; using `SIGHASH_ANYPREVOUT`, which commits to the exact script including&lt;br/&gt;&amp;gt; `&amp;lt;index &#43; 1&amp;gt;`, which is unique for each update transaction.&lt;br/&gt;&amp;gt; Thus a state transaction can only spend the specific update transaction,&lt;br/&gt;&amp;gt; but the update transaction can spend the funding outpoint or any update&lt;br/&gt;&amp;gt; transaction outpoint.&lt;br/&gt;&amp;gt; State transaction input would have an `nSequence` requiring a relative&lt;br/&gt;&amp;gt; locktime of the agreed-upon unilateral close delay.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The above assumes MuSig signing, which requires 1.5 round trips for a&lt;br/&gt;&amp;gt; channel, or three broadcast rounds for a multiparticipant (n &amp;gt;= 3)&lt;br/&gt;&amp;gt; construction.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Regards,&lt;br/&gt;&amp;gt; ZmnSCPxj&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20200803/fadaa364/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20200803/fadaa364/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:26:07Z</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqspu0k4us9n73785lrhq7e2mkd2f8fahtwvze46dpfxva9fde0xt6qzyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7stau763</id>
    
      <title type="html">📅 Original date posted:2020-05-20 📝 Original ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqspu0k4us9n73785lrhq7e2mkd2f8fahtwvze46dpfxva9fde0xt6qzyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7stau763" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsvujyhe2n8xxagm7dut2jdawke4ec6h5hpgtjrrfe32mvf6x7t2aqlms0ls&#39;&gt;nevent1q…s0ls&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-05-20&lt;br/&gt;📝 Original message:I&amp;#39;ve been looking at using compressed block headers from the perspective of&lt;br/&gt;a node that wants to use SMS messages to sync block headers. I realized&lt;br/&gt;that it would be helpful if sendheaders2 took a parameter for how often to&lt;br/&gt;send compact blockheaders. For example, in the case of an SMS transport&lt;br/&gt;layer, it would make sense to request 4 headers at a time to optimally fill&lt;br/&gt;a 160 byte SMS message.&lt;br/&gt;&lt;br/&gt;Although using SMS messages would be about the most expensive way to&lt;br/&gt;receive block headers, it is also the most universally available to&lt;br/&gt;smartphone users, even where mobile data might be expensive or unavailable.&lt;br/&gt;If we assume an SMS costs a bulk sender 0.025 USD per SMS, then sending 4&lt;br/&gt;at a time (4 x 39 &#43; 1 byte &amp;lt; 160 byte max SMS) reduces costs 1/4 to 252&lt;br/&gt;instead of 1008 messages at a total weekly cost of ~7 instead of 26 USD.&lt;br/&gt;Still not ideal, but a huge savings.&lt;br/&gt;&lt;br/&gt;Since you&amp;#39;re proposing a new message anyway, it doesn&amp;#39;t break compatibility&lt;br/&gt;to add a parameter for how often sendheaders2 chunks up recent headers.&lt;br/&gt;&lt;br/&gt;On Fri, May 8, 2020 at 3:34 PM Will Clark via bitcoin-dev &amp;lt;&lt;br/&gt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hello list,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I would like to propose a compressed block header scheme for IBD and block&lt;br/&gt;&amp;gt; announcements. This proposal is derivative of previous proposals found on&lt;br/&gt;&amp;gt; this list (see links in spec below) with some modifications and&lt;br/&gt;&amp;gt; clarifications.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The below specification (also found at&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://github.com/willcl-ark/compressed-block-headers/blob/v1.0/compressed-block-headers.adoc&#34;&gt;https://github.com/willcl-ark/compressed-block-headers/blob/v1.0/compressed-block-headers.adoc&lt;/a&gt;&lt;br/&gt;&amp;gt; ) details the compression recommended along with the generated bandwidth&lt;br/&gt;&amp;gt; savings in the best-case scenario.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I look forward to any feedback anyone has to offer on the specification&lt;br/&gt;&amp;gt; itself, as well as any additions or objections to the motivation.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Will&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; = Compressed block headers&lt;br/&gt;&amp;gt; Will Clark &amp;lt;will8clark at gmail.com&amp;gt;&lt;br/&gt;&amp;gt; v1.0, May 2020:&lt;br/&gt;&amp;gt; :toc: preamble&lt;br/&gt;&amp;gt; :toclevels: 4&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This work is a derivation of these mailing list posts:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1.&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-August/014876.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-August/014876.html&lt;/a&gt;[bitcoin-dev:&lt;br/&gt;&amp;gt; &amp;#34;Compressed&amp;#34; headers stream - 2017] (with resurrection&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-December/015385.html[here]&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-December/015385.html[here]&lt;/a&gt;&lt;br/&gt;&amp;gt; )&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 2.&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-March/015851.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-March/015851.html&lt;/a&gt;[bitcoin-dev:&lt;br/&gt;&amp;gt; Optimized Header Sync]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;#39;&amp;#39;&amp;#39;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; == Motivation&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Block headers as exchanged by nodes over the p2p network are currently 81&lt;br/&gt;&amp;gt; bytes each.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For low bandwidth nodes who are doing a headers-only sync, reducing the&lt;br/&gt;&amp;gt; size of the headers can provide a significant bandwidth saving. Also, nodes&lt;br/&gt;&amp;gt; can support more header-only peers for IBD and protection against eclipse&lt;br/&gt;&amp;gt; attacks if header bandwidth is reduced.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; === Background&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Currently headers are sent over the p2p network as a vector of&lt;br/&gt;&amp;gt; `block_headers`, which are composed of the following sized fields:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;lt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Field               |Size&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |Version             |4 bytes&lt;br/&gt;&amp;gt; |Previous block hash |32 bytes&lt;br/&gt;&amp;gt; |Merkle root hash    |32 bytes&lt;br/&gt;&amp;gt; |Time                |4 bytes&lt;br/&gt;&amp;gt; |nBits               |4 bytes&lt;br/&gt;&amp;gt; |nonce               |4 bytes&lt;br/&gt;&amp;gt; |txn_count           |1 byte&lt;br/&gt;&amp;gt; |*Total*             |81 bytes&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Some fields can be removed completely, others can be compressed under&lt;br/&gt;&amp;gt; certain conditions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; == Proposed specification&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; === block_header2 data type&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The following table illustrates the proposed `block_header2` data type&lt;br/&gt;&amp;gt; specification.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;lt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Field               |Size     |Compressed&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |Bitfield            |1 byte   | 1 byte&lt;br/&gt;&amp;gt; |Version             |4 bytes  |0 \| 4 bytes&lt;br/&gt;&amp;gt; |Previous block hash |32 bytes |0 \| 32 bytes&lt;br/&gt;&amp;gt; |Merkle root hash    |32 bytes |32 bytes&lt;br/&gt;&amp;gt; |Time                |4 bytes  |2 \| 4 bytes&lt;br/&gt;&amp;gt; |nBits               |4 bytes  |0 \| 4 bytes&lt;br/&gt;&amp;gt; |nonce               |4 bytes  |4 bytes&lt;br/&gt;&amp;gt; |*Total*             |81 bytes |range: 39 - 81 bytes&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This compression results in a maximum reduction from an 81 byte header to&lt;br/&gt;&amp;gt; best-case 39 byte header. With 629,474 blocks in the current blockchain, a&lt;br/&gt;&amp;gt; continuous header sync from genesis (requiring a single full 81 byte header&lt;br/&gt;&amp;gt; followed by only compressed `block_header2`) has been tested to have its&lt;br/&gt;&amp;gt; required bandwidth reduced from 50.98MB down to 25.86MB, a saving of 49%.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== Bitfield&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To make parsing of header messages easier and further increase header&lt;br/&gt;&amp;gt; compression, a single byte bitfield was suggested by gmaxwell footnote:[&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-December/015397.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-December/015397.html&lt;/a&gt;].&lt;br/&gt;&amp;gt; We propose the following amended bitfield meanings (bits re-ordered to&lt;br/&gt;&amp;gt; match `headers2` field order):&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;lt;,&amp;lt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Bit |Meaning &#43; field size to read&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |0 &#43;&lt;br/&gt;&amp;gt; 1 &#43;&lt;br/&gt;&amp;gt; 2    |version: same as the last *distinct* value 1st ... 7th (0 byte&lt;br/&gt;&amp;gt; field) or a new 32bit distinct value (4 byte field).&lt;br/&gt;&amp;gt; |3   |prev_block_hash: is omitted (0 byte field) or included (32 byte&lt;br/&gt;&amp;gt; field)&lt;br/&gt;&amp;gt; |4   |timestamp: as small offset (2 byte field) or full (4 byte field).&lt;br/&gt;&amp;gt; |5   |nbits: same as last header (0 byte field) or new (4 byte field).&lt;br/&gt;&amp;gt; |6   |possibly to signal &amp;#34;more headers follow&amp;#34; to make the encoding&lt;br/&gt;&amp;gt; self-delimiting.&lt;br/&gt;&amp;gt; |7   |currently undefined&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This bitfield adds 1 byte for every block in the chain, for a current&lt;br/&gt;&amp;gt; total increase of 629,474B.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== Version&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In most cases the Version field will be identical to one referenced in one&lt;br/&gt;&amp;gt; of the previous 7 unique versions, as indicated by bits 0,1,2 of the&lt;br/&gt;&amp;gt; Bitfield.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To block 629,474 there were 616,137 blocks whose version was in the&lt;br/&gt;&amp;gt; previous 7 distinct versions, and only 13,338 blocks whose version was not,&lt;br/&gt;&amp;gt; this includes any version bit manipulation done via overt ASIC boost.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;gt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Genesis to block |Current (B) |Compressed (B) |Saving (%)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |629,474          |2,517,896   |53,352         |98&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== Previous block hash&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The previous block hash will always be the&lt;br/&gt;&amp;gt; `SHA256(SHA256(&amp;lt;previous_header&amp;gt;))` so is redundant, presuming you have&lt;br/&gt;&amp;gt; the previous header in the chain.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;gt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Genesis to block |Current (B) |Compressed (B) |Saving (%)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |629,474          |20,143,168  |0              |100&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== Time&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The timestamp (in seconds) is consensus bound, based both on the time in&lt;br/&gt;&amp;gt; the previous&lt;br/&gt;&amp;gt; header: `MAX_FUTURE_BLOCK_TIME = 2 * 60 * 60 = 7200`, and being greater&lt;br/&gt;&amp;gt; than the `MedianTimePast` of the previous 11 blocks. Therefore this can be&lt;br/&gt;&amp;gt; safely represented as an offset from the previous headers&amp;#39; timestamp using&lt;br/&gt;&amp;gt; a 2 byte `signed short int`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;gt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Genesis to block |Current (B) |Compressed (B) |Saving (%)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |629,474          |2,517,896   |1,258,952      |50&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== nBits&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; nBits currently changes once every 2016 blocks. It could be entirely&lt;br/&gt;&amp;gt; calculated by the client from the timestamps of the previous 2015 blocks&lt;br/&gt;&amp;gt; footnote:[2015 blocks are used in the adjustment calculation due to an&lt;br/&gt;&amp;gt; off-by-one error:&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://bitcointalk.org/index.php?topic=43692.msg521772#msg521772&amp;#34&#34;&gt;https://bitcointalk.org/index.php?topic=43692.msg521772#msg521772&amp;#34&lt;/a&gt;;].&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To simplify &amp;#39;light&amp;#39; client implementations which would otherwise require&lt;br/&gt;&amp;gt; consensus-valid calculation of the adjustments, we propose to transmit this&lt;br/&gt;&amp;gt; according to the &amp;lt;&amp;lt;Bitfield&amp;gt;&amp;gt; specification above.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To block 629,474 there have been 298 nBits adjustments (vs an expected 311&lt;br/&gt;&amp;gt; -- there was none before block 32,256).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;gt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Genesis to block |Current (B) |Compressed (B) |Saving (%)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |629,474          |2,517,896   |1,196          |99.6&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== txn_count&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; txn_count is included to make parsing of these messages compatible with&lt;br/&gt;&amp;gt; parsing of `block` messages footnote:[&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://bitcoin.stackexchange.com/questions/2104/why-is-the-block-header-txn-count-field-always-zero&#34;&gt;https://bitcoin.stackexchange.com/questions/2104/why-is-the-block-header-txn-count-field-always-zero&lt;/a&gt;].&lt;br/&gt;&amp;gt; Therefore this field and its associated byte can be removed for&lt;br/&gt;&amp;gt; transmission of compact headers.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;gt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Genesis to block |Current (B) |Compressed (B) |Saving (%)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |629,474          |629,474     |0              |100&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; === Service Bit&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A new service bit would be required so that the nodes can advertise their&lt;br/&gt;&amp;gt; ability to supply compact headers.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; === P2P Messages&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Three new messages would be used by nodes that enable compact block header&lt;br/&gt;&amp;gt; support, two query messages: `getheaders2` and `sendheaders2` and one&lt;br/&gt;&amp;gt; response: `headers2`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== `getheaders2` -- Requesting compact headers&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The new p2p message required to request compact block headers would&lt;br/&gt;&amp;gt; require the same fields as the current `getheaders` message:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;lt;,&amp;lt;,&amp;lt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Field Size |Description          |Data type |Comments&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |4          |version              |uint32_t  |the protocol version&lt;br/&gt;&amp;gt; |1&#43;         |hash count           |var_int   |number of block locator hash&lt;br/&gt;&amp;gt; entries&lt;br/&gt;&amp;gt; |32&#43;        |block locator hashes |char[32]  |block locator object; newest&lt;br/&gt;&amp;gt; back to genesis block (dense to start, but then sparse)&lt;br/&gt;&amp;gt; |32         |hash_stop            |char[32]  |hash of the last desired&lt;br/&gt;&amp;gt; block header; set to zero to get as many blocks as possible (2000)&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== `sendheaders2` -- Request compact header announcements&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Since&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki[BIP-130]&#34;&gt;https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki[BIP-130]&lt;/a&gt;,&lt;br/&gt;&amp;gt; nodes have been able to request to receive new headers directly in&lt;br/&gt;&amp;gt; `headers` messages, rather than via an `inv` of the new block hash and&lt;br/&gt;&amp;gt; subsequent `getheader` request and `headers` response (followed by a final&lt;br/&gt;&amp;gt; `getdata` to get the tip block itself, if desired). This is requested by&lt;br/&gt;&amp;gt; transmitting an empty `sendheaders` message after the version handshake is&lt;br/&gt;&amp;gt; complete.]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Upon receipt of this message, the node is permitted, but not required, to&lt;br/&gt;&amp;gt; preemptively announce new headers with the `headers2` message (instead of&lt;br/&gt;&amp;gt; `inv`). Preemptive header announcement is supported by the protocol version&lt;br/&gt;&amp;gt; ≥ 70012 | Bitcoin Core version ≥ 0.12.0.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For the motivational use-case it makes sense to also update this mechanism&lt;br/&gt;&amp;gt; to support sending header updates using compact headers using a new message.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== `headers2` -- Receiving compact headers&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A `headers2` message is returned in response to `getheaders2` or at new&lt;br/&gt;&amp;gt; header announcement following a `sendheaders2` request. It contains both&lt;br/&gt;&amp;gt; `length` and `headers` fields. The `headers` field contains a variable&lt;br/&gt;&amp;gt; length vector of `block_header2`:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Field Size |Description |Data type       |Comments&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |1&#43;         |length      |var_int         |Length of `headers`&lt;br/&gt;&amp;gt; |39-81x?    |headers     |block_header2[] |Compressed block headers in&lt;br/&gt;&amp;gt; &amp;lt;&amp;lt;block_header2 data type&amp;gt;&amp;gt; format&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; === Implementation&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; * The first header in the first `block_header2[]` vector to a&lt;br/&gt;&amp;gt; newly-connected client MUST contain the full nBits`, `timestamp`, `version`&lt;br/&gt;&amp;gt; and `prev_block_hash` fields, along with a correctly populated `bitfield`&lt;br/&gt;&amp;gt; byte.&lt;br/&gt;&amp;gt; * Subsequent headers in a contiguous vector SHOULD follow the compressed&lt;br/&gt;&amp;gt; &amp;lt;&amp;lt;block_header2 data type&amp;gt;&amp;gt; format.&lt;br/&gt;&amp;gt; * Subsequent compressed headers supplied to an already-connected client&lt;br/&gt;&amp;gt; (requesting compressed headers), SHOULD follow the compressed&lt;br/&gt;&amp;gt; &amp;lt;&amp;lt;block_header2 data type&amp;gt;&amp;gt; format.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;Richard Myers&lt;br/&gt;Decentralized Applications Engineer, goTenna&lt;br/&gt;gotenna.com&lt;br/&gt;@gotenna&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20200520/f9b6f40d/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20200520/f9b6f40d/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:24:35Z</updated>
  </entry>

  <entry>
    <id>https://nostr.ae/nevent1qqsw25n2aw4sr7netu3rxmmxlapu262sy8h9nuxr0w8e5nlv0dwd3vgzyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7sl3grpt</id>
    
      <title type="html">📅 Original date posted:2020-05-11 📝 Original message:Thanks ...</title>
    
    <link rel="alternate" href="https://nostr.ae/nevent1qqsw25n2aw4sr7netu3rxmmxlapu262sy8h9nuxr0w8e5nlv0dwd3vgzyp2tluwzzj0v3pxar6g5fwef0yaavh2mnvmmrla8pgkzm30gxuz7sl3grpt" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsqkmyn0w26ffp2tlrfy8ddl9v2hnwgmqjezpm3296euftc5elpd4gptckw0&#39;&gt;nevent1q…ckw0&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2020-05-11&lt;br/&gt;📝 Original message:Thanks for resurrecting this idea for discussion Will.&lt;br/&gt;&lt;br/&gt;I see three reasons for reducing block header bandwidth:&lt;br/&gt;&lt;br/&gt; 1. support for long range block header broadcast via alternative&lt;br/&gt;communication modalities like radio where every byte counts&lt;br/&gt; 2. where repurposed mobile devices with SPV wallets are used because&lt;br/&gt;metered bandwidth and hardware costs are high relative to income&lt;br/&gt; 3. full nodes could potentially support twice as many header only peers&lt;br/&gt;(is that a thing?) for better eclipse protection&lt;br/&gt;&lt;br/&gt;Nodes could also run an additional daemon (eg. electrs) that serves&lt;br/&gt;compressed block headers to light clients, but then it would be less likely&lt;br/&gt;to see widespread use to reduce bandwidth between full nodes.&lt;br/&gt;&lt;br/&gt;What are the negatives?&lt;br/&gt; - higher computation? probably minimal compared to serving the same&lt;br/&gt;uncompressed headers.&lt;br/&gt; - memory for caching the last few versions? bounded to last seven, so not&lt;br/&gt;too large.&lt;br/&gt; - complexity/bugs? minor and opt in for node operators, though you could&lt;br/&gt;argue the gain isn&amp;#39;t worth any kind of change for nodes with high bandwidth&lt;br/&gt;connections.&lt;br/&gt; - use of low-bandwidth light clients should not be encouraged? that is a&lt;br/&gt;separate discussion, but I do not currently see any proposals to remove&lt;br/&gt;light client support.&lt;br/&gt;&lt;br/&gt;I&amp;#39;m curious what other people think. Are the motivations enough to justify&lt;br/&gt;a change to the protocol that produces a high percentage (but low absolute)&lt;br/&gt;bandwidth reduction for transmitting block headers?&lt;br/&gt;&lt;br/&gt;  -- Richard&lt;br/&gt;&lt;br/&gt;On Fri, May 8, 2020 at 3:34 PM Will Clark via bitcoin-dev &amp;lt;&lt;br/&gt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hello list,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I would like to propose a compressed block header scheme for IBD and block&lt;br/&gt;&amp;gt; announcements. This proposal is derivative of previous proposals found on&lt;br/&gt;&amp;gt; this list (see links in spec below) with some modifications and&lt;br/&gt;&amp;gt; clarifications.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The below specification (also found at&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://github.com/willcl-ark/compressed-block-headers/blob/v1.0/compressed-block-headers.adoc&#34;&gt;https://github.com/willcl-ark/compressed-block-headers/blob/v1.0/compressed-block-headers.adoc&lt;/a&gt;&lt;br/&gt;&amp;gt; ) details the compression recommended along with the generated bandwidth&lt;br/&gt;&amp;gt; savings in the best-case scenario.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I look forward to any feedback anyone has to offer on the specification&lt;br/&gt;&amp;gt; itself, as well as any additions or objections to the motivation.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Cheers,&lt;br/&gt;&amp;gt; Will&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; = Compressed block headers&lt;br/&gt;&amp;gt; Will Clark &amp;lt;will8clark at gmail.com&amp;gt;&lt;br/&gt;&amp;gt; v1.0, May 2020:&lt;br/&gt;&amp;gt; :toc: preamble&lt;br/&gt;&amp;gt; :toclevels: 4&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This work is a derivation of these mailing list posts:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 1.&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-August/014876.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-August/014876.html&lt;/a&gt;[bitcoin-dev:&lt;br/&gt;&amp;gt; &amp;#34;Compressed&amp;#34; headers stream - 2017] (with resurrection&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-December/015385.html[here]&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-December/015385.html[here]&lt;/a&gt;&lt;br/&gt;&amp;gt; )&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; 2.&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-March/015851.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-March/015851.html&lt;/a&gt;[bitcoin-dev:&lt;br/&gt;&amp;gt; Optimized Header Sync]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;#39;&amp;#39;&amp;#39;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; == Motivation&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Block headers as exchanged by nodes over the p2p network are currently 81&lt;br/&gt;&amp;gt; bytes each.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For low bandwidth nodes who are doing a headers-only sync, reducing the&lt;br/&gt;&amp;gt; size of the headers can provide a significant bandwidth saving. Also, nodes&lt;br/&gt;&amp;gt; can support more header-only peers for IBD and protection against eclipse&lt;br/&gt;&amp;gt; attacks if header bandwidth is reduced.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; === Background&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Currently headers are sent over the p2p network as a vector of&lt;br/&gt;&amp;gt; `block_headers`, which are composed of the following sized fields:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;lt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Field               |Size&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |Version             |4 bytes&lt;br/&gt;&amp;gt; |Previous block hash |32 bytes&lt;br/&gt;&amp;gt; |Merkle root hash    |32 bytes&lt;br/&gt;&amp;gt; |Time                |4 bytes&lt;br/&gt;&amp;gt; |nBits               |4 bytes&lt;br/&gt;&amp;gt; |nonce               |4 bytes&lt;br/&gt;&amp;gt; |txn_count           |1 byte&lt;br/&gt;&amp;gt; |*Total*             |81 bytes&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Some fields can be removed completely, others can be compressed under&lt;br/&gt;&amp;gt; certain conditions.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; == Proposed specification&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; === block_header2 data type&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The following table illustrates the proposed `block_header2` data type&lt;br/&gt;&amp;gt; specification.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;lt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Field               |Size     |Compressed&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |Bitfield            |1 byte   | 1 byte&lt;br/&gt;&amp;gt; |Version             |4 bytes  |0 \| 4 bytes&lt;br/&gt;&amp;gt; |Previous block hash |32 bytes |0 \| 32 bytes&lt;br/&gt;&amp;gt; |Merkle root hash    |32 bytes |32 bytes&lt;br/&gt;&amp;gt; |Time                |4 bytes  |2 \| 4 bytes&lt;br/&gt;&amp;gt; |nBits               |4 bytes  |0 \| 4 bytes&lt;br/&gt;&amp;gt; |nonce               |4 bytes  |4 bytes&lt;br/&gt;&amp;gt; |*Total*             |81 bytes |range: 39 - 81 bytes&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This compression results in a maximum reduction from an 81 byte header to&lt;br/&gt;&amp;gt; best-case 39 byte header. With 629,474 blocks in the current blockchain, a&lt;br/&gt;&amp;gt; continuous header sync from genesis (requiring a single full 81 byte header&lt;br/&gt;&amp;gt; followed by only compressed `block_header2`) has been tested to have its&lt;br/&gt;&amp;gt; required bandwidth reduced from 50.98MB down to 25.86MB, a saving of 49%.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== Bitfield&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To make parsing of header messages easier and further increase header&lt;br/&gt;&amp;gt; compression, a single byte bitfield was suggested by gmaxwell footnote:[&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-December/015397.html&#34;&gt;https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-December/015397.html&lt;/a&gt;].&lt;br/&gt;&amp;gt; We propose the following amended bitfield meanings (bits re-ordered to&lt;br/&gt;&amp;gt; match `headers2` field order):&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;lt;,&amp;lt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Bit |Meaning &#43; field size to read&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |0 &#43;&lt;br/&gt;&amp;gt; 1 &#43;&lt;br/&gt;&amp;gt; 2    |version: same as the last *distinct* value 1st ... 7th (0 byte&lt;br/&gt;&amp;gt; field) or a new 32bit distinct value (4 byte field).&lt;br/&gt;&amp;gt; |3   |prev_block_hash: is omitted (0 byte field) or included (32 byte&lt;br/&gt;&amp;gt; field)&lt;br/&gt;&amp;gt; |4   |timestamp: as small offset (2 byte field) or full (4 byte field).&lt;br/&gt;&amp;gt; |5   |nbits: same as last header (0 byte field) or new (4 byte field).&lt;br/&gt;&amp;gt; |6   |possibly to signal &amp;#34;more headers follow&amp;#34; to make the encoding&lt;br/&gt;&amp;gt; self-delimiting.&lt;br/&gt;&amp;gt; |7   |currently undefined&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; This bitfield adds 1 byte for every block in the chain, for a current&lt;br/&gt;&amp;gt; total increase of 629,474B.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== Version&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; In most cases the Version field will be identical to one referenced in one&lt;br/&gt;&amp;gt; of the previous 7 unique versions, as indicated by bits 0,1,2 of the&lt;br/&gt;&amp;gt; Bitfield.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To block 629,474 there were 616,137 blocks whose version was in the&lt;br/&gt;&amp;gt; previous 7 distinct versions, and only 13,338 blocks whose version was not,&lt;br/&gt;&amp;gt; this includes any version bit manipulation done via overt ASIC boost.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;gt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Genesis to block |Current (B) |Compressed (B) |Saving (%)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |629,474          |2,517,896   |53,352         |98&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== Previous block hash&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The previous block hash will always be the&lt;br/&gt;&amp;gt; `SHA256(SHA256(&amp;lt;previous_header&amp;gt;))` so is redundant, presuming you have&lt;br/&gt;&amp;gt; the previous header in the chain.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;gt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Genesis to block |Current (B) |Compressed (B) |Saving (%)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |629,474          |20,143,168  |0              |100&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== Time&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The timestamp (in seconds) is consensus bound, based both on the time in&lt;br/&gt;&amp;gt; the previous&lt;br/&gt;&amp;gt; header: `MAX_FUTURE_BLOCK_TIME = 2 * 60 * 60 = 7200`, and being greater&lt;br/&gt;&amp;gt; than the `MedianTimePast` of the previous 11 blocks. Therefore this can be&lt;br/&gt;&amp;gt; safely represented as an offset from the previous headers&amp;#39; timestamp using&lt;br/&gt;&amp;gt; a 2 byte `signed short int`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;gt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Genesis to block |Current (B) |Compressed (B) |Saving (%)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |629,474          |2,517,896   |1,258,952      |50&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== nBits&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; nBits currently changes once every 2016 blocks. It could be entirely&lt;br/&gt;&amp;gt; calculated by the client from the timestamps of the previous 2015 blocks&lt;br/&gt;&amp;gt; footnote:[2015 blocks are used in the adjustment calculation due to an&lt;br/&gt;&amp;gt; off-by-one error:&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://bitcointalk.org/index.php?topic=43692.msg521772#msg521772&amp;#34&#34;&gt;https://bitcointalk.org/index.php?topic=43692.msg521772#msg521772&amp;#34&lt;/a&gt;;].&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To simplify &amp;#39;light&amp;#39; client implementations which would otherwise require&lt;br/&gt;&amp;gt; consensus-valid calculation of the adjustments, we propose to transmit this&lt;br/&gt;&amp;gt; according to the &amp;lt;&amp;lt;Bitfield&amp;gt;&amp;gt; specification above.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; To block 629,474 there have been 298 nBits adjustments (vs an expected 311&lt;br/&gt;&amp;gt; -- there was none before block 32,256).&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;gt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Genesis to block |Current (B) |Compressed (B) |Saving (%)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |629,474          |2,517,896   |1,196          |99.6&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== txn_count&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; txn_count is included to make parsing of these messages compatible with&lt;br/&gt;&amp;gt; parsing of `block` messages footnote:[&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://bitcoin.stackexchange.com/questions/2104/why-is-the-block-header-txn-count-field-always-zero&#34;&gt;https://bitcoin.stackexchange.com/questions/2104/why-is-the-block-header-txn-count-field-always-zero&lt;/a&gt;].&lt;br/&gt;&amp;gt; Therefore this field and its associated byte can be removed for&lt;br/&gt;&amp;gt; transmission of compact headers.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;gt;,&amp;gt;,&amp;gt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Genesis to block |Current (B) |Compressed (B) |Saving (%)&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |629,474          |629,474     |0              |100&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; === Service Bit&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A new service bit would be required so that the nodes can advertise their&lt;br/&gt;&amp;gt; ability to supply compact headers.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; === P2P Messages&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Three new messages would be used by nodes that enable compact block header&lt;br/&gt;&amp;gt; support, two query messages: `getheaders2` and `sendheaders2` and one&lt;br/&gt;&amp;gt; response: `headers2`.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== `getheaders2` -- Requesting compact headers&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; The new p2p message required to request compact block headers would&lt;br/&gt;&amp;gt; require the same fields as the current `getheaders` message:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; [cols=&amp;#34;&amp;gt;,&amp;lt;,&amp;lt;,&amp;lt;&amp;#34;]&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Field Size |Description          |Data type |Comments&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |4          |version              |uint32_t  |the protocol version&lt;br/&gt;&amp;gt; |1&#43;         |hash count           |var_int   |number of block locator hash&lt;br/&gt;&amp;gt; entries&lt;br/&gt;&amp;gt; |32&#43;        |block locator hashes |char[32]  |block locator object; newest&lt;br/&gt;&amp;gt; back to genesis block (dense to start, but then sparse)&lt;br/&gt;&amp;gt; |32         |hash_stop            |char[32]  |hash of the last desired&lt;br/&gt;&amp;gt; block header; set to zero to get as many blocks as possible (2000)&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== `sendheaders2` -- Request compact header announcements&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Since&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki[BIP-130]&#34;&gt;https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki[BIP-130]&lt;/a&gt;,&lt;br/&gt;&amp;gt; nodes have been able to request to receive new headers directly in&lt;br/&gt;&amp;gt; `headers` messages, rather than via an `inv` of the new block hash and&lt;br/&gt;&amp;gt; subsequent `getheader` request and `headers` response (followed by a final&lt;br/&gt;&amp;gt; `getdata` to get the tip block itself, if desired). This is requested by&lt;br/&gt;&amp;gt; transmitting an empty `sendheaders` message after the version handshake is&lt;br/&gt;&amp;gt; complete.]&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Upon receipt of this message, the node is permitted, but not required, to&lt;br/&gt;&amp;gt; preemptively announce new headers with the `headers2` message (instead of&lt;br/&gt;&amp;gt; `inv`). Preemptive header announcement is supported by the protocol version&lt;br/&gt;&amp;gt; ≥ 70012 | Bitcoin Core version ≥ 0.12.0.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; For the motivational use-case it makes sense to also update this mechanism&lt;br/&gt;&amp;gt; to support sending header updates using compact headers using a new message.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; ==== `headers2` -- Receiving compact headers&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A `headers2` message is returned in response to `getheaders2` or at new&lt;br/&gt;&amp;gt; header announcement following a `sendheaders2` request. It contains both&lt;br/&gt;&amp;gt; `length` and `headers` fields. The `headers` field contains a variable&lt;br/&gt;&amp;gt; length vector of `block_header2`:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt; |Field Size |Description |Data type       |Comments&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; |1&#43;         |length      |var_int         |Length of `headers`&lt;br/&gt;&amp;gt; |39-81x?    |headers     |block_header2[] |Compressed block headers in&lt;br/&gt;&amp;gt; &amp;lt;&amp;lt;block_header2 data type&amp;gt;&amp;gt; format&lt;br/&gt;&amp;gt; |===&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; === Implementation&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; * The first header in the first `block_header2[]` vector to a&lt;br/&gt;&amp;gt; newly-connected client MUST contain the full nBits`, `timestamp`, `version`&lt;br/&gt;&amp;gt; and `prev_block_hash` fields, along with a correctly populated `bitfield`&lt;br/&gt;&amp;gt; byte.&lt;br/&gt;&amp;gt; * Subsequent headers in a contiguous vector SHOULD follow the compressed&lt;br/&gt;&amp;gt; &amp;lt;&amp;lt;block_header2 data type&amp;gt;&amp;gt; format.&lt;br/&gt;&amp;gt; * Subsequent compressed headers supplied to an already-connected client&lt;br/&gt;&amp;gt; (requesting compressed headers), SHOULD follow the compressed&lt;br/&gt;&amp;gt; &amp;lt;&amp;lt;block_header2 data type&amp;gt;&amp;gt; format.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; _______________________________________________&lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &lt;a href=&#34;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#34;&gt;https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-- &lt;br/&gt;Richard Myers&lt;br/&gt;Decentralized Applications Engineer, goTenna&lt;br/&gt;gotenna.com&lt;br/&gt;@gotenna&lt;br/&gt;-------------- next part --------------&lt;br/&gt;An HTML attachment was scrubbed...&lt;br/&gt;URL: &amp;lt;&lt;a href=&#34;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20200511/dc570025/attachment-0001.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20200511/dc570025/attachment-0001.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:24:33Z</updated>
  </entry>

</feed>