<oembed><type>rich</type><version>1.0</version><author_name>npub17rld56k4365lfphyd8u8kwuejey5xcazdxptserx03wc4jc9g24stx9l2h</author_name><author_url>https://nostr.ae/npub17rld56k4365lfphyd8u8kwuejey5xcazdxptserx03wc4jc9g24stx9l2h</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2020-05-02&#xA;📝 Original message:On Fri, May 01, 2020 at 08:23:07AM -0400, Russell O&#39;Connor wrote:&#xA;&gt; Regarding specifics, I personally think it would be better to keep the&#xA;&gt; hashes of the ScriptPubKeys separate from the hashes of the input values.&#xA;&#xA;I think Andrew&#39;s original suggestion achieves this:&#xA;&#xA;&gt;&gt; The obvious way to implement this is to add another hash to the&#xA;&gt;&gt; signature message:&#xA;&gt;&gt;   sha_scriptPubKeys (32): the SHA256 of the serialization of all&#xA;&gt;&gt;   scriptPubKeys of the previous outputs spent by this&#xA;&gt;&gt;   transaction.&#xA;&#xA;presumably with sha_scriptPubKeys&#39; inclusion being conditional on&#xA;hash_type not matching ANYONECANPAY.&#xA;&#xA;We could possibly also make the &#34;scriptPubKey&#34; field dependent on&#xA;hash_type matching ANYONECANPAY, making this not cost any more&#xA;in serialised bytes per signature.&#xA;&#xA;This would basically mean we&#39;re committing to each component of the&#xA;UTXOs being spent:&#xA;&#xA;  without ANYONECANPAY:&#xA;    sha_prevouts commits to the txid hashes and vout indexes (COutPoint)&#xA;    sha_amounts commits to the nValues (Coin.CTxOut.nValue)&#xA;    sha_scriptpubkeys commits to the scriptPubKey (Coin.CTxOut.scriptPubKey)&#xA;&#xA;  with ANYONECANPAY it&#39;s the same but just for this input&#39;s prevout:&#xA;    outpoint&#xA;    amount&#xA;    scriptPubKey&#xA;&#xA;except that we&#39;d arguably still be missing:&#xA;&#xA;    is this a coinbase output? (Coin.fCoinBase)&#xA;    what was the height of the coin? (Coin.nHeight)&#xA;&#xA;Maybe committing to the coinbase flag would have some use, but committing&#xA;to the height would make it hard to chain unconfirmed spends, so at&#xA;least that part doesn&#39;t seem worth adding.&#xA;&#xA;&gt; I would also (and independently) propose&#xA;&gt; separating the hashing of the output values from the output ScriptPubKeys in&#xA;&gt; `sha_outputs` so again, applications interested only in summing the values of&#xA;&gt; the outputs (for instance to compute fees) do not have to wade through those&#xA;&gt; arbitrarily long ScriptPubKeys in the outputs.&#xA;&#xA;If you didn&#39;t verify the output scriptPubKeys, you would *only* be able&#xA;to care about fees since you couldn&#39;t verify where any of the funds went?&#xA;And you&#39;d only be able to say fees are &#34;at least x&#34;, since they could be&#xA;more if one of the scriptPubKeys turned out to be OP_TRUE eg. That might&#xA;almost make sense for a transaction accelerator that&#39;s trying to increase&#xA;the fees; but only if you were doing it for someone else&#39;s transaction&#xA;(since otherwise you&#39;d care about the output addresses) and only if you&#xA;were happy to not receive any change? Seems like a pretty weird use case?&#xA;&#xA;There&#39;s some prior discussion on this topic at:&#xA;&#xA;http://www.erisian.com.au/taproot-bip-review/log-2020-03-04.html&#xA;http://www.erisian.com.au/taproot-bip-review/log-2020-03-05.html&#xA;&#xA;Cheers,&#xA;aj</html></oembed>