<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">OP_0 gives a zero length byte array because OP_0 == 0x00 which is equivalent to pushdata with zero length.<div class=""><br class=""></div><div class="">OP_EQUAL compares byte strings as-is. So it will push "false" because empty string is not the same as a single-byte string with 0x00 byte in it. Value "false" in turn is encoded as empty string, just like result of OP_0.<br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 06 Nov 2015, at 10:37, Tier Nolan via bitcoin-dev &lt;<a href="mailto:bitcoin-dev@lists.linuxfoundation.org" class="">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">I meant not to use the OP_PUSH opcodes to do the push.<br class=""><br class=""></div><div class="">Does OP_0 give a zero length byte array?<br class=""><br class=""></div><div class="">Would this script return true?<br class=""><br class=""></div><div class="">OP_0<br class=""></div><div class="">OP_PUSHDATA1 (length = 1, data = 0)<br class=""></div><div class="">OP_EQUAL<br class=""><br class=""></div><div class="">The easiest definition is that OP_0 and OP_1 must be used to push the data and not any other push opcodes.<br class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Nov 6, 2015 at 9:32 AM, Oleg Andreev <span dir="ltr" class="">&lt;<a href="mailto:oleganza@gmail.com" target="_blank" class="">oleganza@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br class="">
&gt; 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 class="">
&gt;<br class="">
&gt; They should also be minimally encoded but that is covered by previous rules.<br class="">
<br class="">
</span>These two lines contradict each other. Minimally-encoded "zero" is an array of length zero, not one. I'd suggest defining this explicitly here as "IF/NOTIF argument must be either zero-length array or a single byte 0x01".<br class="">
<br class="">
<br class="">
</blockquote></div><br class=""></div>
_______________________________________________<br class="">bitcoin-dev mailing list<br class=""><a href="mailto:bitcoin-dev@lists.linuxfoundation.org" class="">bitcoin-dev@lists.linuxfoundation.org</a><br class="">https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev<br class=""></div></blockquote></div><br class=""></div></div></body></html>