<div dir="ltr">One and zero should be defined as arrays of length one.  Otherwise, it is still possible to mutate the transaction by changing the length of the array. <br><br>They should also be minimally encoded but that is covered by previous rules.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 6, 2015 at 8:13 AM, jl2012 via bitcoin-dev <span dir="ltr">&lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have a new BIP draft for fixing OP_IF and OP_NOTIF malleability. Please comment: <a href="https://github.com/jl2012/bips/blob/master/opifmalleability.mediawiki" rel="noreferrer" target="_blank">https://github.com/jl2012/bips/blob/master/opifmalleability.mediawiki</a><br>
<br>
Copied below:<br>
<br>
BIP: x<br>
  Title: Dealing with OP_IF and OP_NOTIF malleability<br>
  Author: jl2012 &lt;<a href="mailto:jl2012@xbt.hk" target="_blank">jl2012@xbt.hk</a>&gt;<br>
  Status: Draft<br>
  Type: Standards Track<br>
  Created: 2015-11-06<br>
<br>
Abstract<br>
<br>
As an supplement to BIP62, this document specifies proposed changes to the Bitcoin transaction validity rules in order to make malleability of transactions with OP_IF and OP_NOTIF impossible.<br>
<br>
Motivation<br>
<br>
OP_IF and OP_NOTIF are flow control codes in the Bitcoin script system. The programme flow is decided by whether the top stake value is 0 or not. However, this behavior opens a source of malleability as a third party may alter a non-zero flow control value to any other non-zero value without invalidating the transaction.<br>
<br>
As of November 2015, OP_IF and OP_NOTIF are not commonly used in the blockchain. However, as more sophisticated functions such as OP_CHECKLOCKTIMEVERITY are being introduced, OP_IF and OP_NOTIF will become more popular and the related malleability should be fixed. This proposal serves as a supplement to BIP62 and should be implemented with other malleability fixes together.<br>
<br>
Specification<br>
<br>
If the transaction version is 3 or above, the flow control value for OP_IF and OP_NOTIF must be either 0 or 1, or the transaction fails.<br>
<br>
This is to be implemented with BIP62.<br>
<br>
Compatibility<br>
<br>
This is a softfork. To ensure OP_IF and OP_NOTIF transactions created before the introduction of this BIP will still be accpeted by the network, the new rules only apply to transactions of version 3 or above.<br>
<br>
For people who want to preserve the original behaviour of OP_IF and OP_NOTIF, an OP_0NOTEQUAL could be  used before the flow control code to transform any non-zero value to 1.<br>
<br>
Reference<br>
<br>
BIP62: <a href="https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki" rel="noreferrer" target="_blank">https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki</a><br>
<br>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" target="_blank">bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href="https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" rel="noreferrer" target="_blank">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev</a><br>
</blockquote></div><br></div>