11466db69bf659f5c04c413ac8571c25cb7fb9
1 Return-Path: <tier.nolan@gmail.com> 2 Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org 3 [172.17.192.35]) 4 by mail.linuxfoundation.org (Postfix) with ESMTPS id 9DCDB8FC 5 for <bitcoin-dev@lists.linuxfoundation.org>; 6 Fri, 6 Nov 2015 09:37:59 +0000 (UTC) 7 X-Greylist: whitelisted by SQLgrey-1.7.6 8 Received: from mail-qk0-f182.google.com (mail-qk0-f182.google.com 9 [209.85.220.182]) 10 by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 45312129 11 for <bitcoin-dev@lists.linuxfoundation.org>; 12 Fri, 6 Nov 2015 09:37:59 +0000 (UTC) 13 Received: by qkas77 with SMTP id s77so39537086qka.0 14 for <bitcoin-dev@lists.linuxfoundation.org>; 15 Fri, 06 Nov 2015 01:37:58 -0800 (PST) 16 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 17 h=mime-version:in-reply-to:references:date:message-id:subject:from:cc 18 :content-type; bh=ioQXMbye0GihbgX4i4rcIRd2yf0PK/706gsH8fJKwhU=; 19 b=MqojFWzN9IXIpP/jWqOuenp9AR588qdMkFF5BNA2N5A/cf6rp1PLpl8LUKvuDrEb8q 20 G4ksIOsw8ZWKVlGhwLqwWRuGtuGiqIXg2kFsqg4M+5xLxKfLjLE7uFwK4XJDMN/ouEjk 21 x7/7tfTHq2Yy92t8nOYuh9Pl+9kf7d9fc2Qz/DJxEwZr7l5+qHZFA5AS9NM4QXKpky2E 22 G/tg7ccQeQKYxOaCzWlKSUXOIZDil2TTQbsrsT7gQLjhyke7y3MAExDdEmxtv2g7QxFs 23 ZLm8aazMZ1l0nMDza1s+2znQdlgpR6P7OIsMTl2lRQ/+Cb/M53FLxl8bh8vvHfCDwZ7K 24 fqgA== 25 MIME-Version: 1.0 26 X-Received: by 10.55.81.11 with SMTP id f11mr12152268qkb.10.1446802678529; 27 Fri, 06 Nov 2015 01:37:58 -0800 (PST) 28 Received: by 10.140.93.82 with HTTP; Fri, 6 Nov 2015 01:37:58 -0800 (PST) 29 In-Reply-To: <8D9D1049-E502-4A37-ACE4-5A2B1369A90A@gmail.com> 30 References: <0e72b173ea8e8aaf6b1b678182fa1ea7@xbt.hk> 31 <CAE-z3OUQyW9Hss-jMDx_HjT9y55SctmUiXiGYhTZe6=2Mj2OaA@mail.gmail.com> 32 <8D9D1049-E502-4A37-ACE4-5A2B1369A90A@gmail.com> 33 Date: Fri, 6 Nov 2015 09:37:58 +0000 34 Message-ID: <CAE-z3OX6bMY+RjphyDS-zAO=aXLs-B41G4m6ssUjFC03ByQkWA@mail.gmail.com> 35 From: Tier Nolan <tier.nolan@gmail.com> 36 Cc: Bitcoin Dev <bitcoin-dev@lists.linuxfoundation.org> 37 Content-Type: multipart/alternative; boundary=001a114a8014b6c5860523dbff53 38 X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, 39 DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HTML_MESSAGE, 40 MALFORMED_FREEMAIL, 41 MISSING_HEADERS,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.1 42 X-Spam-Level: * 43 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on 44 smtp1.linux-foundation.org 45 Subject: Re: [bitcoin-dev] Dealing with OP_IF and OP_NOTIF malleability 46 X-BeenThere: bitcoin-dev@lists.linuxfoundation.org 47 X-Mailman-Version: 2.1.12 48 Precedence: list 49 List-Id: Bitcoin Development Discussion <bitcoin-dev.lists.linuxfoundation.org> 50 List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 51 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe> 52 List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/> 53 List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org> 54 List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help> 55 List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 56 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe> 57 X-List-Received-Date: Fri, 06 Nov 2015 09:37:59 -0000 58 59 --001a114a8014b6c5860523dbff53 60 Content-Type: text/plain; charset=UTF-8 61 62 I meant not to use the OP_PUSH opcodes to do the push. 63 64 Does OP_0 give a zero length byte array? 65 66 Would this script return true? 67 68 OP_0 69 OP_PUSHDATA1 (length = 1, data = 0) 70 OP_EQUAL 71 72 The easiest definition is that OP_0 and OP_1 must be used to push the data 73 and not any other push opcodes. 74 75 76 On Fri, Nov 6, 2015 at 9:32 AM, Oleg Andreev <oleganza@gmail.com> wrote: 77 78 > 79 > > One and zero should be defined as arrays of length one. Otherwise, it is 80 > still possible to mutate the transaction by changing the length of the 81 > array. 82 > > 83 > > They should also be minimally encoded but that is covered by previous 84 > rules. 85 > 86 > These two lines contradict each other. Minimally-encoded "zero" is an 87 > array of length zero, not one. I'd suggest defining this explicitly here as 88 > "IF/NOTIF argument must be either zero-length array or a single byte 0x01". 89 > 90 > 91 > 92 93 --001a114a8014b6c5860523dbff53 94 Content-Type: text/html; charset=UTF-8 95 Content-Transfer-Encoding: quoted-printable 96 97 <div dir=3D"ltr"><div>I meant not to use the OP_PUSH opcodes to do the push= 98 .<br><br></div><div>Does OP_0 give a zero length byte array?<br><br></div><= 99 div>Would this script return true?<br><br></div><div>OP_0<br></div><div>OP_= 100 PUSHDATA1 (length =3D 1, data =3D 0)<br></div><div>OP_EQUAL<br><br></div><d= 101 iv>The easiest definition is that OP_0 and OP_1 must be used to push the da= 102 ta and not any other push opcodes.<br><br></div></div><div class=3D"gmail_e= 103 xtra"><br><div class=3D"gmail_quote">On Fri, Nov 6, 2015 at 9:32 AM, Oleg A= 104 ndreev <span dir=3D"ltr"><<a href=3D"mailto:oleganza@gmail.com" target= 105 =3D"_blank">oleganza@gmail.com</a>></span> wrote:<br><blockquote class= 106 =3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd= 107 ing-left:1ex"><span class=3D""><br> 108 > One and zero should be defined as arrays of length one. Otherwise, it = 109 is still possible to mutate the transaction by changing the length of the a= 110 rray.<br> 111 ><br> 112 > They should also be minimally encoded but that is covered by previous = 113 rules.<br> 114 <br> 115 </span>These two lines contradict each other. Minimally-encoded "zero&= 116 quot; is an array of length zero, not one. I'd suggest defining this ex= 117 plicitly here as "IF/NOTIF argument must be either zero-length array o= 118 r a single byte 0x01".<br> 119 <br> 120 <br> 121 </blockquote></div><br></div> 122 123 --001a114a8014b6c5860523dbff53-- 124