<oembed><type>rich</type><version>1.0</version><author_name>npub1dw88wd5gqsqn6ufxhf9h03uk8087l7gfzdtez5csjlt6pupu4pwsj8plrw</author_name><author_url>https://nostr.ae/npub1dw88wd5gqsqn6ufxhf9h03uk8087l7gfzdtez5csjlt6pupu4pwsj8plrw</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-10-01&#xA;📝 Original message:On Sun, Oct 1, 2017 at 3:27 PM, Mark Friedenbach &lt;mark at friedenbach.org&gt;&#xA;wrote:&#xA;&#xA;&gt; &gt; On Oct 1, 2017, at 12:05 PM, Russell O&#39;Connor &lt;roconnor at blockstream.io&gt;&#xA;&gt; wrote:&#xA;&gt; &gt;&#xA;&gt; &gt; Given the proposed fixed signature size, It seems better to me that we&#xA;&gt; create a SIGHASH_WITNESS_WEIGHT flag as opposed to SIGHASH_WITNESS_DEPTH.&#xA;&gt;&#xA;&gt; For what benefit? If your script actually uses all the items on the stack,&#xA;&gt; and if your script is not written in such a way as to allow malleability&#xA;&gt; (which cannot be prevented in general), then they’re equivalent. Using&#xA;&gt; weight instead of depth only needlessly restricts other parties to select a&#xA;&gt; witness size up-front.&#xA;&gt;&#xA;&#xA;Creating a Bitcoin script that does not allow malleability is difficult and&#xA;requires wasting a lot of bytes to do so, typically when handling issues&#xA;around non-0-or-1 witness values being used with OP_IF, and dealing with&#xA;non-standard-zero values, etc.  Adding a witness weight flag cuts through&#xA;the worst of all this, and makes script design enormously simpler and makes&#xA;scripts smaller and cheaper.&#xA;&#xA;&#xA;&gt; And to be clear, signing witness weight doesn’t mean the witness is not&#xA;&gt; malleable. The signer could sign again with a different ECDSA nonce. Or if&#xA;&gt; the signer is signing from a 2-of-3 wallet, a common scenario I hope, there&#xA;&gt; are 3 possible key combinations that could be used. If using MBV, a&#xA;&gt; 3-element tree is inherently unbalanced and the common use case can have a&#xA;&gt; smaller proof size.&#xA;&gt;&#xA;&gt; Witnesses are not 3rd party malleable and we will maintain that property&#xA;&gt; going forward with future opcodes.&#xA;&gt;&#xA;&gt; &gt; Mark, you seem to be arguing that in general we still want weight&#xA;&gt; malleability even with witness depth fixed, but I don&#39;t understand in what&#xA;&gt; scenario we would want that.&#xA;&gt;&#xA;&gt; Any time all parties are not online at the same time in an interactive&#xA;&gt; signing protocol, or for which individual parties have to reconfigure their&#xA;&gt; signing choices due to failures. We should not restrict our script&#xA;&gt; signature system to such a degree that it becomes difficult to create&#xA;&gt; realistic signing setups for people using best practices (multi-key, 2FA,&#xA;&gt; etc.) to sign. If I am a participant in a signing protocol, it would be&#xA;&gt; layer violating to treat me as anything other than a black box, such that&#xA;&gt; internal errors and timeouts in my signing setup don’t propagate upwards to&#xA;&gt; the multi-party protocol.&#xA;&gt;&#xA;&gt; For example, I should be able to try to 2FA sign, and if that fails go&#xA;&gt; fetch my backup key and sign with that. But because it’s my infrequently&#xA;&gt; used backup key, it might be placed deeper in the key tree and therefore&#xA;&gt; signatures using it are larger. All the other signers need care is that&#xA;&gt; slot #3 in the witness is where my Merkle proof goes. They shouldn’t have&#xA;&gt; to restart and resign because my proof was a little larger than anticipated&#xA;&gt; — and maybe they can’t resign because double-spend protections!&#xA;&gt;&#xA;&#xA;I&#39;ll argue that I don&#39;t want my counter-party going off and using a very&#xA;deeply nested key in order to subvert the fee rate we&#39;ve agreed upon after&#xA;I&#39;ve signed my part of the input.  If we are doing multi-party signing of&#xA;inputs we need to communicate anyways to construct the transaction.  I see&#xA;no problem with requiring my counter-party to choose their keys before I&#xA;sign so that I know up front what our fee rate is going to be.  If they&#xA;lose their keys and need a backup, they should have to come back to me to&#xA;resign in order that we can negotiate a new fee rate for the transaction&#xA;and who is going to be covering how much of the fee and on which inputs.&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20171001/a587d6ba/attachment.html&gt;</html></oembed>