Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 9DCDB8FC for ; Fri, 6 Nov 2015 09:37:59 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f182.google.com (mail-qk0-f182.google.com [209.85.220.182]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 45312129 for ; Fri, 6 Nov 2015 09:37:59 +0000 (UTC) Received: by qkas77 with SMTP id s77so39537086qka.0 for ; Fri, 06 Nov 2015 01:37:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=ioQXMbye0GihbgX4i4rcIRd2yf0PK/706gsH8fJKwhU=; b=MqojFWzN9IXIpP/jWqOuenp9AR588qdMkFF5BNA2N5A/cf6rp1PLpl8LUKvuDrEb8q G4ksIOsw8ZWKVlGhwLqwWRuGtuGiqIXg2kFsqg4M+5xLxKfLjLE7uFwK4XJDMN/ouEjk x7/7tfTHq2Yy92t8nOYuh9Pl+9kf7d9fc2Qz/DJxEwZr7l5+qHZFA5AS9NM4QXKpky2E G/tg7ccQeQKYxOaCzWlKSUXOIZDil2TTQbsrsT7gQLjhyke7y3MAExDdEmxtv2g7QxFs ZLm8aazMZ1l0nMDza1s+2znQdlgpR6P7OIsMTl2lRQ/+Cb/M53FLxl8bh8vvHfCDwZ7K fqgA== MIME-Version: 1.0 X-Received: by 10.55.81.11 with SMTP id f11mr12152268qkb.10.1446802678529; Fri, 06 Nov 2015 01:37:58 -0800 (PST) Received: by 10.140.93.82 with HTTP; Fri, 6 Nov 2015 01:37:58 -0800 (PST) In-Reply-To: <8D9D1049-E502-4A37-ACE4-5A2B1369A90A@gmail.com> References: <0e72b173ea8e8aaf6b1b678182fa1ea7@xbt.hk> <8D9D1049-E502-4A37-ACE4-5A2B1369A90A@gmail.com> Date: Fri, 6 Nov 2015 09:37:58 +0000 Message-ID: From: Tier Nolan Cc: Bitcoin Dev Content-Type: multipart/alternative; boundary=001a114a8014b6c5860523dbff53 X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HTML_MESSAGE, MALFORMED_FREEMAIL, MISSING_HEADERS,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.1 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: Re: [bitcoin-dev] Dealing with OP_IF and OP_NOTIF malleability X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Development Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2015 09:37:59 -0000 --001a114a8014b6c5860523dbff53 Content-Type: text/plain; charset=UTF-8 I meant not to use the OP_PUSH opcodes to do the push. Does OP_0 give a zero length byte array? Would this script return true? OP_0 OP_PUSHDATA1 (length = 1, data = 0) OP_EQUAL The easiest definition is that OP_0 and OP_1 must be used to push the data and not any other push opcodes. On Fri, Nov 6, 2015 at 9:32 AM, Oleg Andreev wrote: > > > 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. > > > > They should also be minimally encoded but that is covered by previous > rules. > > 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". > > > --001a114a8014b6c5860523dbff53 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I meant not to use the OP_PUSH opcodes to do the push= .

Does OP_0 give a zero length byte array?

<= div>Would this script return true?

OP_0
OP_= PUSHDATA1 (length =3D 1, data =3D 0)
OP_EQUAL

The easiest definition is that OP_0 and OP_1 must be used to push the da= ta and not any other push opcodes.


On Fri, Nov 6, 2015 at 9:32 AM, Oleg A= ndreev <oleganza@gmail.com> wrote:

> 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 a= rray.
>
> They should also be minimally encoded but that is covered by previous = rules.

These two lines contradict each other. Minimally-encoded "zero&= quot; is an array of length zero, not one. I'd suggest defining this ex= plicitly here as "IF/NOTIF argument must be either zero-length array o= r a single byte 0x01".



--001a114a8014b6c5860523dbff53--