<oembed><type>rich</type><version>1.0</version><title>matejcik [ARCHIVE] wrote</title><author_name>matejcik [ARCHIVE] (npub18g…sgac3)</author_name><author_url>https://yabu.me/npub18g04tf4qudcsna6qfcrm55s39axx3ymrunr65gxen4rctm0zv24sasgac3</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2018-06-27&#xA;📝 Original message:hello,&#xA;&#xA;On 26.6.2018 22:30, Pieter Wuille wrote:&#xA;&gt;&gt; (Moreover, as I wrote previously, the Combiner seems like a weirdly&#xA;&gt;&gt; placed role. I still don&#39;t see its significance and why is it important&#xA;&gt;&gt; to correctly combine PSBTs by agents that don&#39;t understand them. If you&#xA;&gt;&gt; have a usecase in mind, please explain.&#xA;&gt; &#xA;&gt; Forward compatibility with new script types. A transaction may spend&#xA;&gt; inputs from different outputs, with different script types. Perhaps&#xA;&gt; some of these are highly specialized things only implemented by some&#xA;&gt; software (say HTLCs of a particular structure), in non-overlapping&#xA;&gt; ways where no piece of software can handle all scripts involved in a&#xA;&gt; single transaction. If Combiners cannot deal with unknown fields, they&#xA;&gt; won&#39;t be able to deal with unknown scripts.&#xA;&#xA;Record-based Combiners *can* deal with unknown fields. Either by&#xA;including both versions, or by including one selected at random. This is&#xA;the same in k-v model.&#xA;&#xA;&gt; combining must be done independently by Combiner implementations for&#xA;&gt; each script type involved. As this is easily avoided by adding a&#xA;&gt; slight bit of structure (parts of the fields that need to be unique -&#xA;&gt; &#34;keys&#34;), this seems the preferable option.&#xA;&#xA;IIUC, you&#39;re proposing a &#34;semi-smart Combiner&#34; that understands and&#xA;processes some fields but not others? That doesn&#39;t seem to change&#xA;things. Either the &#34;dumb&#34; combiner throws data away before the &#34;smart&#34;&#xA;one sees it, or it needs to include all of it anyway.&#xA;&#xA;&gt; No, a Combiner can pick any of the values in case different PSBTs have&#xA;&gt; different values for the same key. That&#39;s the point: by having a&#xA;&gt; key-value structure the choice of fields can be made such that&#xA;&gt; Combiners don&#39;t need to care about the contents. Finalizers do need to&#xA;&gt; understand the contents, but they only operate once at the end.&#xA;&gt; Combiners may be involved in any PSBT passing from one entity to&#xA;&gt; another.&#xA;&#xA;Yes. Combiners don&#39;t need to care about the contents.&#xA;So why is it important that a Combiner properly de-duplicates the case&#xA;where keys are the same but values are different? This is a job that,&#xA;AFAICT so far, can be safely left to someone along the chain who&#xA;understands that particular record.&#xA;&#xA;Say we have field F(key,value), and several Signers produce F(1,1),&#xA;F(1,2), F(1,3).&#xA;&#xA;A key-based Combiner will pick exactly one to pass along. A record-based&#xA;Combiner will pass all three.&#xA;&#xA;It seems that you consider the latter PSBT &#34;invalid&#34;. But it is well&#xA;formed and doesn&#39;t contain duplicate records. A Finalizer, or a&#xA;different Combiner that understands field F, can as well have the rule&#xA;&#34;throw away all but one&#34; for this case.&#xA;&#xA;To repeat and restate my central question:&#xA;Why is it important, that an agent which doesn&#39;t understand a particular&#xA;field structure, can nevertheless make decisions about its inclusion or&#xA;omission from the result (based on a repeated prefix)?&#xA;&#xA;Actually, I can imagine the opposite: having fields with same &#34;key&#34;&#xA;(identifying data), and wanting to combine their &#34;values&#34; intelligently&#xA;without losing any of the data. Say, two Signers producing separate&#xA;parts of a combined-signature under the same common public key?&#xA;&#xA;&gt; In case of BIP32 derivation, computing the pubkeys is possibly&#xA;&gt; expensive. A simple signer can choose to just sign with whatever keys&#xA;&gt; are present, but they&#39;re not the only way to implement a signer, and&#xA;&gt; even less the only software interacting with this format. Others may&#xA;&gt; want to use a matching approach to find keys that are relevant;&#xA;&gt; without pubkeys in the format, they&#39;re forced to perform derivations&#xA;&gt; for all keys present.&#xA;&#xA;I&#39;m going to search for relevant keys by comparing master fingerprint; I&#xA;would expect HWWs generally don&#39;t have index based on leaf pubkeys.&#xA;OTOH, Signers with lots of keys probably aren&#39;t resource-constrained and&#xA;can do the derivations in case of collisions.&#xA;&#xA;Also, you need to do the derivation and checking anyway, because what if&#xA;there is a mismatch between the key and the value?&#xA;&#xA;I liked @achow101&#39;s idea about supporting non-derived keys, but I&#xA;assumed that you would match them based on the master fingerprint too?&#xA;&#xA;I wouldn&#39;t be against including the full master public key (probably&#xA;without chaincode) instead of the fingerprint, as you proposed earlier.&#xA;But including both the leaf pubkey and the fingerprint seems weird.&#xA;&#xA;&gt; If you take the records model, and then additionally drop the&#xA;&gt; whole-record uniqueness constraint, yes, though that seems pushing it&#xA;&gt; a bit by moving even more guarantees from the file format to&#xA;&gt; application level code.&#xA;&#xA;The &#34;file format&#34; makes no guarantees, because the parsing code and&#xA;application code is the same anyway. You could say I&#39;m proposing to&#xA;separate these concerns ;)&#xA;&#xA;regards&#xA;m.&#xA;&#xA;-------------- next part --------------&#xA;A non-text attachment was scrubbed...&#xA;Name: signature.asc&#xA;Type: application/pgp-signature&#xA;Size: 819 bytes&#xA;Desc: OpenPGP digital signature&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20180627/386870f6/attachment.sig&gt;</html></oembed>