<oembed><type>rich</type><version>1.0</version><author_name>npub10r66s2stvnancx9axwnfc5a34asjkwkgmkq7ztm5hf30x7fa4szsv9afdw</author_name><author_url>https://nostr.ae/npub10r66s2stvnancx9axwnfc5a34asjkwkgmkq7ztm5hf30x7fa4szsv9afdw</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2020-01-11&#xA;📝 Original message:I am not sure that this particular task should be done with data&#xA;embedded in PSBT itself, and not with some sort of container that&#xA;includes PSBT and the authentication information.&#xA;&#xA;The benefit seems to be in reusing PSBT structure for compatibilty, and&#xA;this might be a valid way, although I do not agree with some of your&#xA;points. I elaborate below:&#xA;&#xA;&gt; 1) In the PSBT globals section, a signature over the &#34;source&#34; PSBT&#xA;&gt; file. It would cover all the bytes of the original PSBT file, as&#xA;&gt; it was received by the Signer.&#xA;&#xA;The problem of authenticating the contents of PSBT is independent of&#xA;the signing action. PSBT might be altered on the path from Creator to&#xA;Signer. Therefore you cannot always say that Signer will be an&#xA;authority over &#39;correctness&#39; of PSBT.&#xA;&#xA;&gt; - At the end of the signing process, the Finalizer should check all&#xA;&gt; the Signers have worked from the same PSBT file (assuming that&#39;s&#xA;&gt; the flow expected)&#xA;&#xA;If there is MitM, checking something at Finalizer is likely too&#xA;late - the party that can intercept PSBTs can finalize before the&#xA;legitimate Finalizer and broadcast the transaction.&#xA;&#xA;Participants can work from the same PSBT file if they all receive the&#xA;same PSBT, and not working in chain where next particpant receives&#xA;updated PSBT from the previous participant. Otherwise they will need to&#xA;either pass two files (original and updated), or work out which fields&#xA;(key-value blobs) to remove to get the &#39;source&#39; PSBT (which might not be&#xA;trivial with presense of proprietary and unknown fields). Even if you&#xA;know which key-value pairs to remove, there is no requirement for&#xA;ordering of the fields, and some signer can serialize them in different&#xA;order after dserialize/sign/add-signatures/re-serialize operation.&#xA;&#xA;Introducing additional ordering or other structure requirements over&#xA;simple key-value structure will add complexity to PSBT processing, and&#xA;adding complexity on such a basic level should have really serious&#xA;reasons, because that increases effort required for even basic&#xA;implementations and increases chance of bugs.&#xA;&#xA;If there is some authority on the &#39;correctness&#39; of &#39;original&#39; PSBT&#xA;(all particpants receive same PSBT at the start), particpants should&#xA;check the signature by that authority. That authority might use&#xA;the key used only for authentication, and not in the tx signing.&#xA;&#xA;If particpants send PSBT in chain after adding their signatures, then&#xA;each participant can add their signature to say &#39;the contents&#xA;of PSBT after my updates should match this hash&#39;.&#xA;&#xA;The signatures of previous participants in the chain most likely do not&#xA;matter because of difficulty of restoring the contents of PSBT as it&#xA;was before the previous particpant, if you do not pass _all_ the PSBTs&#xA;(which is excessive). &#xA; &#xA;&gt; 2) In the output section, specifically, the last key/value pair of&#xA;&gt; the last output of the transaction, I want to add a similar signature,&#xA;&gt; again signed by one of the keys used in the signing process. This&#xA;&gt; signature will cover all the bytes of the resulting (signed) PSBT&#xA;&gt; up to that point. Because it is the last output of the output&#xA;&gt; section, that signature will be the last few bytes of the PSBT file.&#xA;&gt; By &#34;appending&#34; the signature in this way, it&#39;s easier to validate&#xA;&gt; and create the signature, without blanking the signature area during&#xA;&gt; digest step.&#xA;&#xA;This will introduce unnecessary higher-level structure to PSBT for the&#xA;reasons that I do not find strong enough for the amount of complexity&#xA;added.&#xA;&#xA;Also, as I said above, you likely do not need more than one&#xA;signature - if this is &#39;fan-out&#39; scheme, then participants need do&#xA;check the sig of authority that created PSBT; if this is piggy-back&#xA;chain, then only previous particpant&#39;s signature is easily verifiable.&#xA;&#xA;&gt; ## Next Steps&#xA;&gt; &#xA;&gt; I&#39;d like to get two officially-assigned BIP-174 key numbers assigned&#xA;&gt; for these two signatures, and then I will see that it gets added&#xA;&gt; into Coldcard&#39;s firmware immediately. In time, other tools are&#xA;&gt; welcome to take advantage of these checks. I will also write a BIP&#xA;&gt; for this, and/or make an addition to BIP-174.&#xA;&#xA;I think you do not need to wait for officially-assigned key numbers,&#xA;and can just implement the scheme you envision with proprietary keys,&#xA;document and promote it. Then if it shows its usefulness, it will&#xA;either become de-facto standard with your proprietary keys (and&#xA;everyone will want to support &#39;Coldard PSBT auth&#39; or whatever the name),&#xA;or the scheme will have serious grounds to be converted to standard and&#xA;have non-proprietary keys assigned.&#xA;&#xA;// Dmitry.&#xA;-------------- next part --------------&#xA;A non-text attachment was scrubbed...&#xA;Name: not available&#xA;Type: application/pgp-signature&#xA;Size: 833 bytes&#xA;Desc: Ð¦Ð¸Ñ„Ñ€Ð¾Ð²Ð°Ñ Ð¿Ð¾Ð´Ð¿Ð¸ÑÑŒ OpenPGP&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20200112/1e8c2cc8/attachment-0001.sig&gt;</html></oembed>