<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <updated>2023-06-07T01:53:38Z</updated>
  <generator>https://yabu.me</generator>

  <title>Nostr notes by Achow101 [ARCHIVE]</title>
  <author>
    <name>Achow101 [ARCHIVE]</name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://yabu.me/npub1wh7lmdsh2r0ygnp39pk7k5a7mll5x5w44pwn6ekvdvmwjhazr5rqxd26cj.rss" />
  <link href="https://yabu.me/npub1wh7lmdsh2r0ygnp39pk7k5a7mll5x5w44pwn6ekvdvmwjhazr5rqxd26cj" />
  <id>https://yabu.me/npub1wh7lmdsh2r0ygnp39pk7k5a7mll5x5w44pwn6ekvdvmwjhazr5rqxd26cj</id>
  <icon></icon>
  <logo></logo>




  <entry>
    <id>https://yabu.me/nevent1qqs8dyxz7avgl57ee570evclnzddcf279lsrd9ctlfkugt4fjy4lwpczyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvzw03lr</id>
    
      <title type="html">📅 Original date posted:2022-04-05 📝 Original message:The ...</title>
    
    <link rel="alternate" href="https://yabu.me/nevent1qqs8dyxz7avgl57ee570evclnzddcf279lsrd9ctlfkugt4fjy4lwpczyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvzw03lr" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsqc0uzwjd8t5twu44lhmpuu4rg4qkemcnsg0j2swlvyqjgmp6dg5qs9xmdr&#39;&gt;nevent1q…xmdr&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2022-04-05&lt;br/&gt;📝 Original message:The seed is encoded as a WIF private key. Decoding as WIF will result in the 32 byte seed that can be used as specified in BIP 32.&lt;br/&gt;&lt;br/&gt;Andrew&lt;br/&gt;&lt;br/&gt;-------- Original Message --------&lt;br/&gt;On Apr 5, 2022, 6:55 PM, Tobin Harding via bitcoin-dev wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; Hi,&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Does anyone have software that successfully parses the extended private key seed&lt;br/&gt;&amp;gt; found in the BIP174 test vector? I have been implementing the test vector PSBT&lt;br/&gt;&amp;gt; workflow in Rust and have everything working except I can only create the&lt;br/&gt;&amp;gt; extended private key from the xpriv, I am unable to use the seed to create it?&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; BIP174: &lt;a href=&#34;https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#test-vectors&#34;&gt;https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#test-vectors&lt;/a&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; PSBT workflow in BIP174 starting at the line:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; &amp;#34;The private keys in the tests below are derived from the following master private key:&amp;#34;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; xpriv:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; tprv8ZgxMBicQKsPd9TeAdPADNnSyH9SSUUbTVeFszDE23Ki6TBB5nCefAdHkK8Fm3qMQR6sHwA56zqRmKmxnHk37JkiFzvncDqoKmPWubu7hDF&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; seed:&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; cUkG8i1RFfWGWy5ziR11zJ5V4U4W3viSFCfyJmZnvQaUsd1xuF3T&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; I&amp;#39;ve tried decoding it as base64 and as base58.&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; Thanks in advance,&lt;br/&gt;&amp;gt; Tobin.&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;-------------- 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/20220405/563af73e/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20220405/563af73e/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T23:06:58Z</updated>
  </entry>

  <entry>
    <id>https://yabu.me/nevent1qqsyaah3vxfjzx9v4axuazagj0jwwv38en8gh4v224s664c43z6f3jqzyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsv67nj3m</id>
    
      <title type="html">📅 Original date posted:2018-06-26 📝 Original message:Hi, On ...</title>
    
    <link rel="alternate" href="https://yabu.me/nevent1qqsyaah3vxfjzx9v4axuazagj0jwwv38en8gh4v224s664c43z6f3jqzyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsv67nj3m" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs035avndnww664l9a4wsfrwp4kzlfm245sextzk6y6hx6g4yc6f2cp9zwcq&#39;&gt;nevent1q…zwcq&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-06-26&lt;br/&gt;📝 Original message:Hi,&lt;br/&gt;&lt;br/&gt;On June 26, 2018 8:33 AM, matejcik via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; ​​&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; hello,&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; in general, I agree with my colleague Tomas, the proposed changes are&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; good and achieve the most important things that we wanted. We&amp;#39;ll review&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; the proposal in more detail later.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; For now a couple minor things I have run into:&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; -   valid test vector 2 (&amp;#34;one P2PKH input and one P2SH-P2WPKH input&amp;#34;)&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     seems broken, at least its hex version; a delimiter seems to be missing,&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     misplaced or corrupted&lt;br/&gt;&lt;br/&gt;Fixed&lt;br/&gt;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt; -   at least the first signing vector is not updated, but you probably&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     know that&lt;br/&gt;&lt;br/&gt;I updated all of the tests yesterday so they should be correct now. I will be adding more tests&lt;br/&gt;this week.&lt;br/&gt;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt; -   BIP32 derivation fields don&amp;#39;t specify size of the &amp;#34;master public key&amp;#34;,&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     which would make it un-parsable :)&lt;br/&gt;&lt;br/&gt;Oops, that&amp;#39;s actually supposed to be master key fingerprint, not master public key. I have updated&lt;br/&gt;the BIP to reflect this.&lt;br/&gt;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt; -   &amp;#34;Transaction format is specified as follows&amp;#34; and its table need to be&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     updated.&lt;br/&gt;&lt;br/&gt;Done.&lt;br/&gt;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     I&amp;#39;m still going to argue against the key-value model though.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     It&amp;#39;s true that this is not significant in terms of space. But I&amp;#39;m more&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     concerned about human readability, i.e., confusing future implementers.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     At this point, the key-value model is there &amp;#34;for historical reasons&amp;#34;,&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     except these aren&amp;#39;t valid even before finalizing the format. The&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     original rationale for using key-values seems to be gone (no key-based&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     lookups are necessary). As for combining and deduplication, whether key&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     data is present or not is now purely a stand-in for a &amp;#34;repeatable&amp;#34; flag.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     We could just as easily say, e.g., that the high bit of &amp;#34;type&amp;#34; specifies&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     whether this record can be repeated.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     (Moreover, as I wrote previously, the Combiner seems like a weirdly&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     placed role. I still don&amp;#39;t see its significance and why is it important&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     to correctly combine PSBTs by agents that don&amp;#39;t understand them. If you&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     have a usecase in mind, please explain.&lt;br/&gt;&lt;br/&gt;There is a diagram in the BIP that explains this. The combiner&amp;#39;s job is to combine two PSBTs that&lt;br/&gt;are for the same transaction but contain different data such as signatures. It is easier to implement&lt;br/&gt;a combiner that does not need to understand the types at all, and such combiners are forwards compatible,&lt;br/&gt;so new types do not require new combiner implementations.&lt;br/&gt;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     ISTM a Combiner could just as well combine based on whole-record&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     uniqueness, and leave the duplicate detection to the Finalizer. In case&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     the incoming PSBTs have incompatible unique fields, the Combiner would&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     have to fail anyway, so the Finalizer might as well do it. Perhaps it&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     would be good to leave out the Combiner role entirely?)&lt;br/&gt;&lt;br/&gt;A transaction that contains duplicate keys would be completely invalid. Furthermore, in the set of typed&lt;br/&gt;records model, having more than one redeemScript and witnessScript should be invalid, so a combiner&lt;br/&gt;would still need to understand what types are in order to avoid this situation. Otherwise it would produce&lt;br/&gt;an invalid PSBT.&lt;br/&gt;&lt;br/&gt;I also dislike the idea of having type specific things like &amp;#34;only one redeemScript&amp;#34; where a more generic&lt;br/&gt;thing would work.&lt;br/&gt;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     There&amp;#39;s two remaining types where key data is used: BIP32 derivations&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     and partial signatures. In case of BIP32 derivation, the key data is&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     redundant ( pubkey = derive(value) ), so I&amp;#39;d argue we should leave that&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     out and save space. &lt;br/&gt;&lt;br/&gt;I think it is still necessary to include the pubkey as not all signers who can sign for a given pubkey may&lt;br/&gt;know the derivation path. For example, if a privkey is imported into a wallet, that wallet does not necessarily&lt;br/&gt;know the master key fingerprint for the privkey nor would it necessarily have the master key itself in&lt;br/&gt;order to derive the privkey. But it still has the privkey and can still sign for it.&lt;br/&gt;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     Re breaking change, we are proposing breaking changes anyway, existing&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     code will need to be touched, and given that this is a hand-parsed&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     format, changing `parse_keyvalue` to `parse_record` seems like a small&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     matter?&lt;br/&gt;&lt;br/&gt;The point is to not make it difficult for existing implementations to change. Mostly what has been done now is just&lt;br/&gt;moving things around, not an entire format change itself. Changing to a set of typed records model require more&lt;br/&gt;changes and is a complete restructuring of the format, not just moving things around.&lt;br/&gt;&lt;br/&gt;Additionally, I think that the current model is fairly easy to hand parse. I don&amp;#39;t think a record set model would make&lt;br/&gt;it easier to follow. Furthermore, moving to Protobuf would make it harder to hand parse as varints are slightly more&lt;br/&gt;confusing in protobuf than with Compact size uints. And with the key-value model, you don&amp;#39;t need to know the types&lt;br/&gt;to know whether something is valid. You don&amp;#39;t need to interpret any data.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Andrew
    </content>
    <updated>2023-06-07T18:13:16Z</updated>
  </entry>

  <entry>
    <id>https://yabu.me/nevent1qqsqfc6eqcn8p5vclvaev28sf2jlt43rf336s3cgdamd2l873a2m9kqzyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvvxwg8y</id>
    
      <title type="html">📅 Original date posted:2018-06-27 📝 Original message:Hi,​ ...</title>
    
    <link rel="alternate" href="https://yabu.me/nevent1qqsqfc6eqcn8p5vclvaev28sf2jlt43rf336s3cgdamd2l873a2m9kqzyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvvxwg8y" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqstj4g6jv5fv75zrc57uxgua5rsmjjxxsa6ss9ghhlcjwny5ft9n8cwry5e0&#39;&gt;nevent1q…y5e0&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-06-27&lt;br/&gt;📝 Original message:Hi,​&lt;br/&gt;&lt;br/&gt;On June 26, 2018 11:09 PM, William Casarin &amp;lt;jb55 at jb55.com&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; ​​&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Hey Andrew,&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; If I&amp;#39;m reading the spec right: the way it is designed right now, you&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; could create hundreds of thousands of zero bytes in the input or output&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; key-value arrays. As far as I can tell this would be considered valid,&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; as it is simply a large array of empty dictionaries. Is this right? I&amp;#39;m&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; worried about buffer overflows in cases where someone sends a large blob&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; of zeros to an unsuspecting implementation.&lt;br/&gt;&lt;br/&gt;No, that is incorrect. That whole paragraph is actually outdated, it was intended&lt;br/&gt;for the possibility of adding output maps, which we have already done. I have &lt;br/&gt;removed it from the BIP.&lt;br/&gt;&lt;br/&gt;However, it is possible for a PSBT to contain very large unknown key-value pairs &lt;br/&gt;which could potentially cause a problem. But I do not think that large PSBTs should &lt;br/&gt;really be a problem as they are really something that the user has to enter rather &lt;br/&gt;than something received remotely without user interaction.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On June 27, 2018 6:39 AM, Andrea via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; ​​&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Hi William, Andrew, list,&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; As noted by William there are some types missing in the global-types definition, because the number of each map for I/O must be known to the parser in order to use the correct definitions for the types. At the moment a parser reading a key-value record does not know whether it should read it as per-input type or per-output, a way to address this is to declare in advance the number of maps and ensure they are ordered (inputs first). If you haven&amp;#39;t already worked out some types for that i propose using:&lt;br/&gt;&amp;gt; &lt;br/&gt;&lt;br/&gt;Parsers actually do know because that information is present in the unsigned transaction &lt;br/&gt;at the beginning of each PSBT. Since each input and output must be accounted for,&lt;br/&gt;a parser can just parse the unsigned transaction and from there it can know how&lt;br/&gt;many inputs and outputs to expect. If it sees more or less, it should throw an error&lt;br/&gt;as the transaction is invalid.&lt;br/&gt;&lt;br/&gt;Of course this implies that implementations will need to parse the unsigned transaction,&lt;br/&gt;but not all actually need to. Combiners do not need to, they just need to merge the&lt;br/&gt;maps together and follow the key uniqueness rule. They don&amp;#39;t really need to know&lt;br/&gt;or care about the number of inputs and outputs, just that the PSBTs being merged&lt;br/&gt;share the same unsigned transaction and have the same number of maps.&lt;br/&gt;&lt;br/&gt;Other roles need to understand the unsigned transaction anyways, so they still need&lt;br/&gt;to parse it thus this isn&amp;#39;t really a problem for those roles.&lt;br/&gt;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     On another note I think we can set a hard limit on the size of the PSBT, currently is &amp;#39;legal&amp;#39; to produce a very large PSBT with an excessive number of Inputs and Outputs. By excessive I mean that even in the best case scenario (using the smallest possible scriptPubKey as in P2WPKH) it is possible to create a PSBT that would certainly create an invalid transaction (because of its size) when finalized. I haven&amp;#39;t found anything related to this in the previous discussions, please ignore this if it was already proposed/discussed.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&lt;br/&gt;I don&amp;#39;t think such a limitation is practical or useful. A transaction can currently have, at most,&lt;br/&gt;~24000 inputs and ~111000 outputs (&#43;/- a few hundred) which is well beyond any useful limit.&lt;br/&gt;Additionally, such limits may not be as extensible for future work. It is hard to determine what&lt;br/&gt;is a reasonable limit on transaction size, and I don&amp;#39;t think it is useful to have a limit. At worst&lt;br/&gt;we would simply create an invalid transaction if it were too large.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Andrew
    </content>
    <updated>2023-06-07T18:13:16Z</updated>
  </entry>

  <entry>
    <id>https://yabu.me/nevent1qqsqtzr3grdl3s9sjdfr8u7k2r2cnk94pe0gnqdvve69u5uzafnkgdszyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvv4xpqz</id>
    
      <title type="html">📅 Original date posted:2018-06-29 📝 Original message:Hi, I ...</title>
    
    <link rel="alternate" href="https://yabu.me/nevent1qqsqtzr3grdl3s9sjdfr8u7k2r2cnk94pe0gnqdvve69u5uzafnkgdszyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvv4xpqz" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsg8y6zjzuxaela5lvkx5vddtdvpmhzx0ympc5t3eh4ru9a23pf9uc6rdxkx&#39;&gt;nevent1q…dxkx&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-06-29&lt;br/&gt;📝 Original message:Hi,&lt;br/&gt;&lt;br/&gt;I do not think that protobuf is the way to go for this. Not only is it another dependency&lt;br/&gt;which many wallets do not want to add (e.g. Armory has not added BIP 70 support because&lt;br/&gt;of its dependency on protobuf), but it is a more drastic change than the currently proposed&lt;br/&gt;changes. The point of this email thread isn&amp;#39;t to rewrite and design a new BIP (which is effectively&lt;br/&gt;what is currently going on). The point is to modify and improve the current one. In particular,&lt;br/&gt;we do not want such drastic changes that people who have already implemented the current&lt;br/&gt;BIP would have to effectively rewrite everything from scratch again.&lt;br/&gt;&lt;br/&gt;I believe that this discussion has become bikeshedding and is really no longer constructive. Neither&lt;br/&gt;of us are going to convince the other to use or not use protobuf. ASeeing how no one else&lt;br/&gt;has really participated in this discussion about protobuf and key uniqueness, I do not think&lt;br/&gt;that these suggested changes are really necessary nor useful to others. It boils down to personal preference&lt;br/&gt;rather than technical merit. As such, I have opened a PR to the BIPs repo (&lt;a href=&#34;https://github.com/bitcoin/bips/pull/694&#34;&gt;https://github.com/bitcoin/bips/pull/694&lt;/a&gt;)&lt;br/&gt;which contains the changes that I proposed in an earlier email.&lt;br/&gt;&lt;br/&gt;Additionally, because there have been no objections to the currently proposed changes, I propose&lt;br/&gt;to move the BIP from Draft to Proposed status.&lt;br/&gt;&lt;br/&gt;Andrew&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;​​&lt;br/&gt;&lt;br/&gt;‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐&lt;br/&gt;&lt;br/&gt;On June 29, 2018 2:53 AM, matejcik via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; ​​&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Short version:&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; -   I propose that conflicting &amp;#34;values&amp;#34; for the same &amp;#34;key&amp;#34; are considered&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     invalid.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt; -   Let&amp;#39;s not optimize for invalid data.&lt;br/&gt;&amp;gt; -   Given that, there&amp;#39;s an open question on how to handle invalid data&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     when encountered&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     In general, I don&amp;#39;t think it&amp;#39;s possible to enforce correctness at the&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     format level. You still need application level checks - and that calls&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     into question what we gain by trying to do this on the format level.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     Long version:&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     Let&amp;#39;s look at this from a different angle.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     There are roughly two possible &amp;#34;modes&amp;#34; for the format with regard to&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     possibly-conflicting data. Call them &amp;#34;permissive&amp;#34; and &amp;#34;restrictive&amp;#34;.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     The spec says:&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     &amp;#34;&amp;#34;&amp;#34;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     Keys within each scope should never be duplicated; all keys in the&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     format are unique. PSBTs containing duplicate keys are invalid. However&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     implementors will still need to handle events where keys are duplicated&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     when combining transactions with duplicated fields. In this event, the&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     software may choose whichever value it wishes.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     &amp;#34;&amp;#34;&amp;#34;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     The last sentence of this paragraph sets the mode to permissive:&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     duplicate values are pretty much OK. If you see them, just pick one.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     You seem to argue that Combiners, in particular simple ones that don&amp;#39;t&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     understand field semantics, should merge keys permissively, but&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     deduplicate values restrictively.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     IOW: if you receive two different values for the same key, just pick&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     whichever, but $deity forbid you include both!&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     This choice doesn&amp;#39;t make sense to me.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     What would make sense is fully restrictive mode: receiving two&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     different values for the same key is a fatal condition with no recovery.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     If you have a non-deterministic scheme, put a differentiator in the key.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     Or all the data, for that matter.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     (Incidentally, this puts key-aware and keyless Combiners on the same&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     footing. As long as all participants uphold the protocol, different&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     value = different key = different full record.)&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     Given that, it&amp;#39;s nice to have the Combiner perform the task of detecting&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     this and failing. But not at all necessary. As the quoted paragraph&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     correctly notes, consumers still need to handle PSBTs with duplicate keys.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     (In this context, your implied permissive/restrictive Combiner is&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     optimized for dealing with invalid data. That seems like a wrong&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     optimization.)&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     A reasonable point to decide is whether the handling at the consumer&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     should be permissive or restrictive. Personally I&amp;#39;m OK with either. I&amp;#39;d&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     go with the following change:&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     &amp;#34;&amp;#34;&amp;#34;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     In this event, the software MAY reject the transaction as invalid. If it&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     decides to accept it, it MUST choose the last value encountered.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     &amp;#34;&amp;#34;&amp;#34;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     (deterministic way of choosing, instead of &amp;#34;whichever you like&amp;#34;)&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     We could also drop the first part, explicitly allowing consumers to&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     pick, and simplifying the Combiner algorithm to `sort -u`.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     Note that this sort of &amp;#34;picking&amp;#34; will probably be implicit. I&amp;#39;d expect&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     the consumer to look like this:&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt;     for key, value in parse(nextRecord()):&lt;br/&gt;&amp;gt;       data[key] = value&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Or we could drop the second part and switch MAY to MUST, for a fully&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; restrictive mode - which, funnily enough, still lets the Combiner work&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; as `sort -u`.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; To see why, remember that distinct values for the same key are not&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; allowed in fully restrictive mode. If a Combiner encounters two&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; conflicting values F(1) and F(2), it should fail -- but if it doesn&amp;#39;t,&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; it includes both and the same failure WILL happen on the fully&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; restrictive consumer.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; This was (or is) my point of confusion re Combiners: the permissive key&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; -   restrictive value mode of operation doesn&amp;#39;t seem to help subsequent&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     consumers in any way.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     Now, for the fully restrictive consumer, the key-value model is indeed&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     advantageous (and this is the only scenario that I can imagine in which&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     it is advantageous), because you can catch key duplication on the parser&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     level.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     But as it turns out, it&amp;#39;s not enough. Consider the following records:&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     key(&amp;lt;PSBT_IN_REDEEM_SCRIPT&amp;gt; &#43; abcde), value(&amp;lt;some redeem script&amp;gt;)&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; and:&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; key(&amp;lt;PSBT_IN_REDEEM_SCRIPT&amp;gt; &#43; fghij), value(&amp;lt;some other redeem script&amp;gt;)&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; A purely syntactic Combiner simply can&amp;#39;t handle this case. The&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; restrictive consumer needs to know whether the key is supposed to be&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; repeating or not.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; We could fix this, e.g., by saying that repeating types must have high&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; bit set and non-repeating must not. We also don&amp;#39;t have to, because the&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; worst failure here is that a consumer passes an invalid record to a&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; subsequent one and the failure happens one step later.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; At this point it seems weird to be concerned about the &amp;#34;unique key&amp;#34;&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; correctness, which is a very small subset of possibly invalid inputs. As&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; a strict safety measure, I&amp;#39;d instead propose that a consumer MUST NOT&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; operate on inputs or outputs, unless it understand ALL included fields -&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; IOW, if you&amp;#39;re signing a particular input, all fields in said input are&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; mandatory. This prevents a situation where a simple Signer processes an&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; input incorrectly based on incomplete set of fields, while still&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; allowing Signers with different capabilities within the same PSBT.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; (The question here is whether to have either a flag or a reserved range&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; for &amp;#34;optional fields&amp;#34; that can be safely ignored by consumers that don&amp;#39;t&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; understand them, but provide data for consumers who do.)&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; To repeat and restate my central question: Why is it important,&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; that an agent which doesn&amp;#39;t understand a particular field&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; structure, can nevertheless make decisions about its inclusion or&lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; &amp;gt; omission from the result (based on a repeated prefix)?&lt;br/&gt;&amp;gt; &amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; Again, because otherwise you may need a separate Combiner for each&lt;br/&gt;&amp;gt; &amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; type of script involved. That would be unfortunate, and is very&lt;br/&gt;&amp;gt; &amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; easily avoided.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; This is still confusing to me, and I would really like to get to the&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; same page on this particular thing, because a lot of the debate hinges&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; on it. I think I covered most of it above, but there are still pieces to&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; clarify.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; As I understand it, the Combiner role (actually all the roles) is mostly&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; an algorithm, with the implication that it can be performed&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; independently by a separate agent, say a network node.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; So there&amp;#39;s two types of Combiners:&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; a) Combiner as a part of an intelligent consumer -- the usual scenario&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; is a Creator/Combiner/Finalizer/Extractor being one participant, and&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Updater/Signers as other participants.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; In this case, the discussion of &amp;#34;simple Combiners&amp;#34; is actually talking&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; about intelligent Combiners which don&amp;#39;t understand new fields and must&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; correctly pass them on. I argue that this can safely be done without&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; loss of any important properties.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; b) Combiner as a separate service, with no understanding of semantics.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Although parts of the debate seem to assume this scenario, I don&amp;#39;t think&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; it&amp;#39;s worth considering. Again, do you have an usecase in mind for it?&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; You also insist on enforcing a limited form of correctness on the&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Combiner level, but that is not worth it IMHO, as discussed above.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Or am I missing something else?&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; Perhaps you want to avoid signing with keys that are already signed&lt;br/&gt;&amp;gt; &amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; with? If you need to derive all the keys before even knowing what&lt;br/&gt;&amp;gt; &amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; was already signed with, you&amp;#39;ve already performed 80% of the work.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; This wouldn&amp;#39;t concern me at all, honestly. If the user sends an already&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; signed PSBT to the same signer, IMHO it is OK to sign again; the&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; slowdown is a fault of the user/workflow. You could argue that signing&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; again is the valid response. Perhaps the Signer should even &amp;#34;consume&amp;#34;&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; its keys and not pass them on after producing a signature? That seems&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; like a sensible rule.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; To your point: proto v2 afaik has no way to declare &amp;#34;whole record&lt;br/&gt;&amp;gt; &amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; uniqueness&amp;#34;, so either you drop that (which I think is unacceptable&lt;br/&gt;&amp;gt; &amp;gt; &lt;br/&gt;&amp;gt; &amp;gt; -   see the copy/sign/combine argument above), or you deal with it in&lt;br/&gt;&amp;gt; &amp;gt;     &lt;br/&gt;&amp;gt; &amp;gt;     your application code.&lt;br/&gt;&amp;gt; &amp;gt;     &lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Yes. My argument is that &amp;#34;whole record uniqueness&amp;#34; isn&amp;#39;t in fact an&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; important property, because you need application-level checks anyway.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Additionally, protobuf provides awareness of which fields are repeated&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; and which aren&amp;#39;t, and implicitly implements the &amp;#34;pick last&amp;#34; resolution&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; strategy for duplicates.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; The simplest possible protobuf-based Combiner will:&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; -   assume all fields are repeating&lt;br/&gt;&amp;gt; -   concatenate and parse&lt;br/&gt;&amp;gt; -   deduplicate and reserialize.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     More knowledgeable Combiner will intelligently handle non-repeating&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     fields, but still has to assume that unknown fields are repeating and&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     use the above algorithm.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     For &amp;#34;pick last&amp;#34; strategy, a consumer can simply parse the message and&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     perform appropriate application-level checks.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     For &amp;#34;hard-fail&amp;#34; strategy, it must parse all fields as repeating and&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     check that there&amp;#39;s only one of those that are supposed to be unique.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     This is admittedly more work, and yes, protobuf is not perfectly suited&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     for this task.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     But:&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     One, this work must be done by hand anyway, if we go with a custom&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     hand-parsed format. There is a protobuf implementation for every&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     conceivable platform, we&amp;#39;ll never have the same amount of BIP174 parsing&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     code.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     (And if you&amp;#39;re hand-writing a parser in order to avoid the dependency,&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     you can modify it to do the checks at parser level. Note that this is&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     not breaking the format! The modifed parser will consume well-formed&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     protobuf and reject that which is valid protobuf but invalid bip174 - a&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     correct behavior for a bip174 parser.)&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     Two, it is my opinion that this is worth it in order to have a standard,&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     well described, well studied and widely implemented format.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     Aside: I ha that there is no advantage to a record-set based&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     custom format by itself, so IMHO the choice is between protobuf vs&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     a custom key-value format. Additionally, it&amp;#39;s even possible to implement&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     a hand-parsable key-value format in terms of protobuf -- again, arguing&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     that &amp;#34;standardness&amp;#34; of protobuf is valuable in itself.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     regards&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     m.&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; bitcoin-dev mailing list&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; bitcoin-dev at lists.linuxfoundation.org&lt;br/&gt;&amp;gt; &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;
    </content>
    <updated>2023-06-07T18:13:14Z</updated>
  </entry>

  <entry>
    <id>https://yabu.me/nevent1qqsvjkym83fpvhlk23922asesfn8ts0cz6qhp4vc4w2m4ks54vqwzlqzyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvwqelsa</id>
    
      <title type="html">📅 Original date posted:2018-06-25 📝 Original message:Hi, On ...</title>
    
    <link rel="alternate" href="https://yabu.me/nevent1qqsvjkym83fpvhlk23922asesfn8ts0cz6qhp4vc4w2m4ks54vqwzlqzyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvwqelsa" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqsthwdvpfs2un40xtd44qvucn6pjaua0e2wywahfrfnrusuz0j4vwqdr7rxw&#39;&gt;nevent1q…7rxw&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-06-25&lt;br/&gt;📝 Original message:Hi,&lt;br/&gt;&lt;br/&gt;On June 25, 2018 12:47 PM, Tomas Susanka via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; From my perspective those are exactly the points I have felt strongly&lt;br/&gt;&amp;gt; about. I still think &amp;#34;typed records&amp;#34; would be a better choice, but it&amp;#39;s&lt;br/&gt;&amp;gt; something I&amp;#39;m willing to compromise on. As I&amp;#39;m looking at the draft, we&lt;br/&gt;&amp;gt; currently have 13 records and only 3 of them have keys... Matejcik was a&lt;br/&gt;&amp;gt; bit keener on this, so we&amp;#39;ll try to discuss this more during the week&lt;br/&gt;&amp;gt; and we also look at the draft more carefully to see if we can come up&lt;br/&gt;&amp;gt; with some nit-picks.&lt;br/&gt;&lt;br/&gt;So there are a few reasons for not using typed records. Firstly, it is less of a breaking change to retain the key-value map model.&lt;br/&gt;&lt;br/&gt;Secondly, it is easier to enforce uniqueness for certain things. For example, in each input, we only want to have one redeemScript and one witnessScript. With a typed records set, we would have to say that only on record of each type is allowed, which means that combiners need to understand types and be able to partially parse the records. However with a key-value model, we can more generically say that every key-value pair must have a unique key which means that combiners do not need to know anything about types and just needs to enforce key uniqueness. Since the type is the only thing in the key for redeemScripts and witnessScripts, this uniqueness automatically applies to this, as well as for other key-value pairs.&lt;br/&gt;&lt;br/&gt;Lastly, the typed records model does not save a lot of space in a transaction. Each record has at most one extra byte in the key-value model, with records that must also have keys having no space savings. The data inside each key-value pair far exceeds one byte, so on additional byte per key-value pair isn&amp;#39;t all that big of a deal, IMO.&lt;br/&gt;&lt;br/&gt;Andrew&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/20180625/a2dc6274/attachment.html&amp;gt&#34;&gt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180625/a2dc6274/attachment.html&amp;gt&lt;/a&gt;;
    </content>
    <updated>2023-06-07T18:13:11Z</updated>
  </entry>

  <entry>
    <id>https://yabu.me/nevent1qqs0m84dy66dufr9es526nh75njcqj60ntg6kn78h2ltqr20n3ps93czyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvk3cum9</id>
    
      <title type="html">📅 Original date posted:2018-06-22 📝 Original message:Hi ...</title>
    
    <link rel="alternate" href="https://yabu.me/nevent1qqs0m84dy66dufr9es526nh75njcqj60ntg6kn78h2ltqr20n3ps93czyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvk3cum9" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs9k8lyy8lfl0enz3tphfr3u3j5xeqkh3ykmpvqhma8rd4vfwruphc2hnxf6&#39;&gt;nevent1q…nxf6&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-06-22&lt;br/&gt;📝 Original message:Hi all,&lt;br/&gt;&lt;br/&gt;After reading the comments here about BIP 174, I would like to propose the following changes:&lt;br/&gt;&lt;br/&gt;- Moving redeemScripts, witnessScripts, and BIP 32 derivation paths to per-input and per-output data&lt;br/&gt;&lt;br/&gt;I think that by moving these three fields into input and output specific maps, the format will be&lt;br/&gt;easier to read and simpler for signers to parse. Instead of having to be able to parse entire&lt;br/&gt;scripts and extract pubkeys, the signer can simply look at which pubkeys are provided in the inputs&lt;br/&gt;and sign the input based upon the presence of a pubkey for which the signer has a privkey.&lt;br/&gt;&lt;br/&gt;A neat trick that fits well with this model is that a plain pubkey (one that is not part of a BIP 32&lt;br/&gt;derivation) can still be put in a BIP 32 derivation path field where the value is just the fingerprint&lt;br/&gt;of the pubkey itself. This would indicate that no derivation needs to be done from the master key, and&lt;br/&gt;the master key is just the specified key itself.&lt;br/&gt;&lt;br/&gt;Additionally, by having the redeemScript and witnessScript readily available in the input, signers&lt;br/&gt;do not need to construct a map to find a redeemScript or witnessScript and can instead just look&lt;br/&gt;directly in the input data. There is also no need to include the hashes of these scripts, so the key&lt;br/&gt;is just the type. This also allows us to enforce the requirement for only one redeemScript and one&lt;br/&gt;witnessScript per input easily by continuing to follow the generic rule of unique keys.&lt;br/&gt;&lt;br/&gt;By using input specific and output specific fields, there is no need for the input index and the input&lt;br/&gt;count types as all inputs will be accounted for.&lt;br/&gt;&lt;br/&gt;- Finalized scriptSig and scriptWitness fields&lt;br/&gt;&lt;br/&gt;To determine whether two PSBTs are the same, we can compare the unsigned transaction. To ensure that the&lt;br/&gt;unsigned transactions are the same for two PSBTs with data for the same tx, we cannot put scriptSigs or&lt;br/&gt;scriptWitnesses into it. Thus for each input, two new fields have been added to store the finalized scriptSig&lt;br/&gt;and finalized scriptWitness.&lt;br/&gt;&lt;br/&gt;- Mandatory sighash&lt;br/&gt;&lt;br/&gt;The sighash type field will be changed from a recommendation to a requirement. Signatures will need to &lt;br/&gt;use the specified sighash type for that input. If a Signer cannot sign for a particular sighash type, it&lt;br/&gt;must not add a partial signature.&lt;br/&gt;&lt;br/&gt;- Encoding&lt;br/&gt;&lt;br/&gt;I have decided that PSBTs should either be in binary or encoded as a Base64 string. For the latter, several&lt;br/&gt;Bitcoin clients already support Base64 encoding of data (for signed messages) so this will not add any extra&lt;br/&gt;dependencies like Z85 would.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;A draft of the revised BIP can be found here: &lt;a href=&#34;https://github.com/achow101/bips/blob/bip174-rev/bip-0174.mediawiki&#34;&gt;https://github.com/achow101/bips/blob/bip174-rev/bip-0174.mediawiki&lt;/a&gt;&lt;br/&gt;If these changes are satisfactory, I will open a PR to the BIPs repo to update the BIP tomorrow. I will also&lt;br/&gt;create test vectors and update the implementation PR&amp;#39;ed to Core.&lt;br/&gt;&lt;br/&gt;Andrew
    </content>
    <updated>2023-06-07T18:13:09Z</updated>
  </entry>

  <entry>
    <id>https://yabu.me/nevent1qqsrqfvynqmfc6gcthjqpq2xpq3lnz9tn5z0tdf7jdqpgaaduffxcvszyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvyf4hsq</id>
    
      <title type="html">📅 Original date posted:2018-06-20 📝 Original message:Hi, On ...</title>
    
    <link rel="alternate" href="https://yabu.me/nevent1qqsrqfvynqmfc6gcthjqpq2xpq3lnz9tn5z0tdf7jdqpgaaduffxcvszyp6lmldkzagdu3zvxy5xm66nhm0l7s636k5960txe34nd62l5gwsvyf4hsq" />
    <content type="html">
      In reply to &lt;a href=&#39;/nevent1qqs0te2v6t7mxmc6fkgu40rmycu87r7pppdtyckq7nf4qcatz864rvcxumkmk&#39;&gt;nevent1q…mkmk&lt;/a&gt;&lt;br/&gt;_________________________&lt;br/&gt;&lt;br/&gt;📅 Original date posted:2018-06-20&lt;br/&gt;📝 Original message:Hi,&lt;br/&gt;&lt;br/&gt;On June 15, 2018 4:34 PM, Pieter Wuille via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Hello all,&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; given some recent work and discussions around BIP 174 (Partially&lt;br/&gt;&amp;gt; Signed Bitcoin Transaction Format) I&amp;#39;d like to bring up a few ideas.&lt;br/&gt;&amp;gt; First of all, it&amp;#39;s unclear to me to what extent projects have already&lt;br/&gt;&amp;gt; worked on implementations, and thus to what extent the specification&lt;br/&gt;&amp;gt; is still subject to change. A response of &amp;#34;this is way too late&amp;#34; is&lt;br/&gt;&amp;gt; perfectly fine.&lt;br/&gt;&lt;br/&gt;While I agree that the BIP itself should be revised to reflect these suggestions, I fear that it may be too late. I know of a few other developers who have implemented BIP 174 already but have not yet responded to this email.&lt;br/&gt;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt; -   Generic key offset derivation&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;     Whenever a BIP32 derivation path does not include any hardened steps,&lt;br/&gt;&amp;gt;     the entirety of the derivation can be conveyed as &amp;#34;The private key for&lt;br/&gt;&amp;gt;     P is equal to the private key for Q plus x&amp;#34;, with P and Q points and x&lt;br/&gt;&amp;gt;     a scalar. This representation is more flexible (it also supports&lt;br/&gt;&amp;gt;     pay-to-contract derivations), more efficient, and more compact. The&lt;br/&gt;&amp;gt;     downside is that it requires the Signer to support such derivation,&lt;br/&gt;&amp;gt;     which I don&amp;#39;t believe any current hardware devices do.&lt;br/&gt;&amp;gt;     Would it make sense to add this as an additional derivation method?&lt;br/&gt;&lt;br/&gt;While this is a good idea, I&amp;#39;m not sure that implementers would understand this as it requires knowing the cryptography which makes this possible. As an optional feature, not all wallets would understand it, and those that do could create PSBTs which other wallets do not understand and thus cannot sign even if they have the private keys and actually can sign.&lt;br/&gt;&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt; -   Hex encoding?&lt;br/&gt;&amp;gt;     &lt;br/&gt;&amp;gt;     This is a very minor thing. But presumably there will be some standard&lt;br/&gt;&amp;gt;     way to store PSBTs as text for copy-pasting - either prescribed by the&lt;br/&gt;&amp;gt;     spec, or de facto. These structures may become pretty large, so&lt;br/&gt;&amp;gt;     perhaps it&amp;#39;s worth choosing something more compact than hexadecimal -&lt;br/&gt;&amp;gt;     for example Base64 or even Z85 (&lt;a href=&#34;https://rfc.zeromq.org/spec:32/Z85/&#34;&gt;https://rfc.zeromq.org/spec:32/Z85/&lt;/a&gt;).&lt;br/&gt;&lt;br/&gt;Agreed. Are there any encodings that do not have double click breaking characters?&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On June 19, 2018 2:38 AM, Jonas Schnelli via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt; I think it could be more flexible (generic) in BIP174.&lt;br/&gt;&amp;gt; It could be just a single child key {32-bit int}, or just a keypath ({32-bit int}]{32-bit int}…) which is very likely sufficient for a HWW to derive the relevant key without the creation of a lookup-window or other „maps&amp;#34;.&lt;br/&gt;&lt;br/&gt;This ignores all of the other times that a BIP32 keypath needs to be provided. It is not only used for multisig, there may be other times that there are multiple derivation paths and master keys due to multiple inputs and such. Adding a field specific to multisig and HWW only seems pointless and redundant to me.&lt;br/&gt;&lt;br/&gt;On June 19, 2018 2:38 AM, Jonas Schnelli via bitcoin-dev &amp;lt;bitcoin-dev at lists.linuxfoundation.org&amp;gt; wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt; A question to consider is,&lt;br/&gt;&amp;gt; will there be more per-output data? If yes, it might make sense to have&lt;br/&gt;&amp;gt; an output section.&lt;br/&gt;&lt;br/&gt;I think it is unlikely that there would be anymore per-output data.&lt;br/&gt;&lt;br/&gt;&amp;gt; 3) The sighash type 0x03 says the sighash is only a recommendation. That&lt;br/&gt;&amp;gt;seems rather ambiguous. If the field is specified shouldn&amp;#39;t it be binding?&lt;br/&gt;&lt;br/&gt;I disagree. It is up to the signer to decide what they wish to sign, not for the creator to specify what to sign. The creator can ask the signer to sign something in a particular way, but it is ultimately up to the signer to decide.&lt;br/&gt;&lt;br/&gt;&amp;gt; 4) Is it a good idea to skip records which types we are unaware of? We&lt;br/&gt;&amp;gt; can&amp;#39;t come up with a reasonable example, but intuitively this seems as a&lt;br/&gt;&amp;gt; potential security issue. We think we should consider  introducing a&lt;br/&gt;&amp;gt; flag, which would define if the record is &amp;#34;optional&amp;#34;. In case the signer&lt;br/&gt;&amp;gt; encounters a record it doesn&amp;#39;t recognize and such flag is not set, it&lt;br/&gt;&amp;gt; aborts the procedure. If we assume the set model we could change the&lt;br/&gt;&amp;gt; structure to &amp;lt;type&amp;gt;&amp;lt;optional flag&amp;gt;&amp;lt;length&amp;gt;{data}. We are not keen on&lt;br/&gt;&amp;gt; this, but we wanted to include this idea to see what you think.&lt;br/&gt;&lt;br/&gt;The idea behind skipping unknown types is to allow forward compatibility. A combiner written now should be able to combine transactions created in the future with new types as combining is really only just merging the maps together.&lt;br/&gt;&lt;br/&gt;&amp;gt; In general, the standard is trying to be very space-conservative,&lt;br/&gt;&amp;gt; however is that really necessary? We would argue for clarity and ease of&lt;br/&gt;&amp;gt; use over space constraints. We think more straightforward approach is&lt;br/&gt;&amp;gt; desired, although more space demanding. What are the arguments to make&lt;br/&gt;&amp;gt; this as small as possible? If we understand correctly, this format is&lt;br/&gt;&amp;gt; not intended for blockchain nor for persistent storage, so size doesn’t&lt;br/&gt;&amp;gt; matter nearly as much.&lt;br/&gt;&lt;br/&gt;Size is not really a constraint, but we do not want to be unnecessarily large. The PSBT still has to be transmitted to other people. It will likely be used by copy and pasting the string into a text box. Copying and pasting very long strings of text can be annoying and cumbersome. So the goal is to keep the format still relatively clear while avoiding the duplication of data.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Andrew
    </content>
    <updated>2023-06-07T18:13:07Z</updated>
  </entry>

</feed>