<oembed><type>rich</type><version>1.0</version><author_name>npub1q86n5vtxkwerzwfqza3hwls8pl8764244464talfqy2vpj0qaz6q38qwta</author_name><author_url>https://nostr.ae/npub1q86n5vtxkwerzwfqza3hwls8pl8764244464talfqy2vpj0qaz6q38qwta</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2020-05-02&#xA;📝 Original message:At the end of the day I don&#39;t really care that much I just prefer something&#xA;that doesn&#39;t throw taproot in for another review cycle.&#xA;&#xA;A side effect of this proposal is it would seem to make it not possible to&#xA;produce a signature for a transaction without having access to the inputs.&#xA;This is limiting for a number of cases where you don&#39;t care about that&#xA;data. There are a litany of use cases where you don&#39;t want to have&#xA;SIGHASH_ALL behavior, and having to sign the scriptpubkeys breaks that. So&#xA;at the very least it should respect other flags.&#xA;&#xA;I also don&#39;t really understand the exact attack. So you submit a&#xA;transaction to the wallet asking them to sign input 10. They sign. They&#39;ve&#xA;committed to the signature being bound to the specific COutpoint and input&#xA;index, so I don&#39;t see how they wouldn&#39;t be required to sign a second&#xA;signature with the other output too? Is there an attack you can describe&#xA;end-to-end relying on this behavior?&#xA;&#xA;If you look at the TXID hash the vouts are one of the last fields&#xA;serialized. this makes it possible (at least, I think) to do a midstate&#xA;proof so that all you are providing is the hash midstate, and the relevant&#xA;transaction output,  the siblings after, and the locktime. So you get to&#xA;skip all the input data, the witness data, and most of the output data.&#xA;&#xA;This sort of data can easily go into the proprietary use (maybe becoming&#xA;well defined if there&#39;s a standardization push) area in PSBT, so that&#xA;hardware devices can get easy access to it. All they have to do to verify&#xA;is to finalize the hash against that buffer and match to the correct input.&#xA;&#xA;&#xA;As an alternative proposal, I think you can just make a separate BIP for&#xA;some new sigash flags that can be reviewed separately from taproot. There&#39;s&#xA;a lot of value in investing in figuring out more granular controls over&#xA;what the signature hash is you sign, which may have some exciting&#xA;contracting implications!&#xA;--&#xA;@JeremyRubin &lt;https://twitter.com/JeremyRubin&gt;&#xA;&lt;https://twitter.com/JeremyRubin&gt;&#xA;&#xA;&#xA;On Fri, May 1, 2020 at 5:26 AM Greg Sanders via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; For what it&#39;s worth this measure had been discussed as a lightweight way&#xA;&gt; of informing offline signers if inputs were segwit or not for malleability&#xA;&gt; analysis reasons. So there&#39;s at least a couple direct use-cases it seems.&#xA;&gt;&#xA;&gt; On Fri, May 1, 2020, 8:23 AM Russell O&#39;Connor via bitcoin-dev &lt;&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt;&#xA;&gt;&gt; While I&#39;m not entirely convinced yet that accertaining non-ownership of&#xA;&gt;&gt; an input is a robust method of solving the problem here, I also see little&#xA;&gt;&gt; reason not to amend BIP-341 as proposed. The ScriptPubKeys in question is&#xA;&gt;&gt; already indirectly covered through the outpoints, so it is just a matter of&#xA;&gt;&gt; optimization.  Furthermore in the consensus code, the ScriptPubKeys are&#xA;&gt;&gt; part of the UTXO data set, and it is already being retrieved as part of the&#xA;&gt;&gt; transaction checking process, so it is readily available.&#xA;&gt;&gt;&#xA;&gt;&gt; I&#39;m not sure how much my opinion on the topic matters, but I did include&#xA;&gt;&gt; this kind of functionality in my design for Simplicity on Elements, and I&#xA;&gt;&gt; have been leaning towards adding this kind of functionality in my Bitcoin&#xA;&gt;&gt; demo application of Simplicity.&#xA;&gt;&gt;&#xA;&gt;&gt; Regarding specifics, I personally think it would be better to keep the&#xA;&gt;&gt; hashes of the ScriptPubKeys separate from the hashes of the input values.&#xA;&gt;&gt; This way anyone only interested in input values does not need to wade&#xA;&gt;&gt; through what are, in principle, arbitrarily long ScriptPubKeys in order to&#xA;&gt;&gt; check the input values (which each fixed size).  To that end, I would also&#xA;&gt;&gt; (and independently) propose separating the hashing of the output values&#xA;&gt;&gt; from the output ScriptPubKeys in `sha_outputs` so again, applications&#xA;&gt;&gt; interested only in summing the values of the outputs (for instance to&#xA;&gt;&gt; compute fees) do not have to wade through those arbitrarily long&#xA;&gt;&gt; ScriptPubKeys in the outputs.&#xA;&gt;&gt;&#xA;&gt;&gt; On Thu, Apr 30, 2020 at 4:22 AM Andrew Kozlik via bitcoin-dev &lt;&#xA;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt;&gt;&#xA;&gt;&gt;&gt; Hi everyone,&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; In the current draft of BIP-0341 [1] the signature message commits to&#xA;&gt;&gt;&gt; the scriptPubKey of the output being spent by the input. I propose that the&#xA;&gt;&gt;&gt; signature message should commit to the scriptPubKeys of *all* transaction&#xA;&gt;&gt;&gt; inputs.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; In certain applications like CoinJoin, a wallet has to deal with&#xA;&gt;&gt;&gt; transactions containing external inputs. To calculate the actual amount&#xA;&gt;&gt;&gt; that the user is spending, the wallet needs to reliably determine for each&#xA;&gt;&gt;&gt; input whether it belongs to the wallet or not. Without such a mechanism an&#xA;&gt;&gt;&gt; adversary can fool the wallet into displaying incorrect information about&#xA;&gt;&gt;&gt; the amount being spent, which can result in theft of user funds [2].&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; In order to ascertain non-ownership of an input which is claimed to be&#xA;&gt;&gt;&gt; external, the wallet needs the scriptPubKey of the previous output spent by&#xA;&gt;&gt;&gt; this input. It must acquire the full transaction being spent and verify its&#xA;&gt;&gt;&gt; hash against that which is given in the outpoint. This is an obstacle in&#xA;&gt;&gt;&gt; the implementation of lightweight air-gapped wallets and hardware wallets&#xA;&gt;&gt;&gt; in general. If the signature message would commit to the scriptPubKeys of&#xA;&gt;&gt;&gt; all transaction inputs, then the wallet would only need to acquire the&#xA;&gt;&gt;&gt; scriptPubKey of the output being spent without having to acquire and verify&#xA;&gt;&gt;&gt; the hash of the entire previous transaction. If an attacker would provide&#xA;&gt;&gt;&gt; an incorrect scriptPubKey, then that would cause the wallet to generate an&#xA;&gt;&gt;&gt; invalid signature message.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Note that committing only to the scriptPubKey of the output being spent&#xA;&gt;&gt;&gt; is insufficient for this application, because the scriptPubKeys which are&#xA;&gt;&gt;&gt; needed to ascertain non-ownership of external inputs are precisely the ones&#xA;&gt;&gt;&gt; that would not be included in any of the signature messages produced by the&#xA;&gt;&gt;&gt; wallet.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; The obvious way to implement this is to add another hash to the&#xA;&gt;&gt;&gt; signature message:&#xA;&gt;&gt;&gt; sha_scriptPubKeys (32): the SHA256 of the serialization of all&#xA;&gt;&gt;&gt; scriptPubKeys of the previous outputs spent by this transaction.&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Cheers,&#xA;&gt;&gt;&gt; Andrew Kozlik&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; [1]&#xA;&gt;&gt;&gt; https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#common-signature-message&#xA;&gt;&gt;&gt; [2]&#xA;&gt;&gt;&gt; https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-August/014843.html&#xA;&gt;&gt;&gt; _______________________________________________&#xA;&gt;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&gt;&gt;&#xA;&gt;&gt; _______________________________________________&#xA;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&gt;&#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20200501/03f1d2e4/attachment-0001.html&gt;</html></oembed>