<oembed><type>rich</type><version>1.0</version><author_name>npub1r3san9v5njl6798hvauyu9ntm6r9c7u8s0t65wls58gpfdcvqp5sa48d0u</author_name><author_url>https://nostr.ae/npub1r3san9v5njl6798hvauyu9ntm6r9c7u8s0t65wls58gpfdcvqp5sa48d0u</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-09-30&#xA;📝 Original message:The CLEANSTACK rule should be eliminated, and instead the number of items on the stack should be incorporated into the signature hash. That way any script with a CHECKSIG is protected from witness extension malleability, and those rare ones that do not use signature operations can have a “DEPTH 1 EQUALVERIFY” at the end. This allows for much simpler tail-call evaluation as you don’t need to pass arguments on the alt-stack.&#xA;&#xA;&gt; On Sep 30, 2017, at 6:13 PM, Luke Dashjr via bitcoin-dev &lt;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&gt; &#xA;&gt; I&#39;ve put together a first draft for what I hope to be a good next step for &#xA;&gt; Segwit and Bitcoin scripting:&#xA;&gt;    https://github.com/luke-jr/bips/blob/witnessv1/bip-witnessv1.mediawiki&#xA;&gt; &#xA;&gt; This introduces 5 key changes:&#xA;&gt; &#xA;&gt; 1. Minor versions for witnesses, inside the witness itself. Essentially the &#xA;&gt; witness [major] version 1 simply indicates the witness commitment is SHA256d, &#xA;&gt; and nothing more.&#xA;&gt; &#xA;&gt; The remaining two are witness version 1.0 (major 1, minor 0):&#xA;&gt; &#xA;&gt; 2. As previously discussed, undefined opcodes immediately cause the script to &#xA;&gt; exit with success, making future opcode softforks a lot more flexible.&#xA;&gt; &#xA;&gt; 3. If the final stack element is not exactly true or false, it is interpreted &#xA;&gt; as a tail-call Script and executed. (Credit to Mark Friedenbach)&#xA;&gt; &#xA;&gt; 4. A new shorter fixed-length signature format, eliminating the need to guess &#xA;&gt; the signature size in advance. All signatures are 65 bytes, unless a condition &#xA;&gt; script is included (see #5).&#xA;&gt; &#xA;&gt; 5. The ability for signatures to commit to additional conditions, expressed in &#xA;&gt; the form of a serialized Script in the signature itself. This would be useful &#xA;&gt; in combination with OP_CHECKBLOCKATHEIGHT (BIP 115), hopefully ending the &#xA;&gt; whole replay protection argument by introducing it early to Bitcoin before any &#xA;&gt; further splits.&#xA;&gt; &#xA;&gt; This last part is a big ugly right now: the signature must commit to the &#xA;&gt; script interpreter flags and internal &#34;sigversion&#34;, which basically serve the &#xA;&gt; same purpose. The reason for this, is that otherwise someone could move the &#xA;&gt; signature to a different context in an attempt to exploit differences in the &#xA;&gt; various Script interpretation modes. I don&#39;t consider the BIP deployable &#xA;&gt; without this getting resolved, but I&#39;m not sure what the best approach would &#xA;&gt; be. Maybe it should be replaced with a witness [major] version and witness &#xA;&gt; stack?&#xA;&gt; &#xA;&gt; There is also draft code implementing [the consensus side of] this:&#xA;&gt;    https://github.com/bitcoin/bitcoin/compare/master...luke-jr:witnessv1&#xA;&gt; &#xA;&gt; Thoughts? Anything I&#39;ve overlooked / left missing that would be &#xA;&gt; uncontroversial and desirable? (Is any of this unexpectedly controversial for &#xA;&gt; some reason?)&#xA;&gt; &#xA;&gt; Luke&#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</html></oembed>