summaryrefslogtreecommitdiff
path: root/34/11466db69bf659f5c04c413ac8571c25cb7fb9
blob: fbe609f3a4ad09e43edc5b501c17569c980d92e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Return-Path: <tier.nolan@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 9DCDB8FC
	for <bitcoin-dev@lists.linuxfoundation.org>;
	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 <bitcoin-dev@lists.linuxfoundation.org>;
	Fri,  6 Nov 2015 09:37:59 +0000 (UTC)
Received: by qkas77 with SMTP id s77so39537086qka.0
	for <bitcoin-dev@lists.linuxfoundation.org>;
	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>
	<CAE-z3OUQyW9Hss-jMDx_HjT9y55SctmUiXiGYhTZe6=2Mj2OaA@mail.gmail.com>
	<8D9D1049-E502-4A37-ACE4-5A2B1369A90A@gmail.com>
Date: Fri, 6 Nov 2015 09:37:58 +0000
Message-ID: <CAE-z3OX6bMY+RjphyDS-zAO=aXLs-B41G4m6ssUjFC03ByQkWA@mail.gmail.com>
From: Tier Nolan <tier.nolan@gmail.com>
Cc: Bitcoin Dev <bitcoin-dev@lists.linuxfoundation.org>
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 <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=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 <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
> 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

<div dir=3D"ltr"><div>I meant not to use the OP_PUSH opcodes to do the push=
.<br><br></div><div>Does OP_0 give a zero length byte array?<br><br></div><=
div>Would this script return true?<br><br></div><div>OP_0<br></div><div>OP_=
PUSHDATA1 (length =3D 1, data =3D 0)<br></div><div>OP_EQUAL<br><br></div><d=
iv>The easiest definition is that OP_0 and OP_1 must be used to push the da=
ta and not any other push opcodes.<br><br></div></div><div class=3D"gmail_e=
xtra"><br><div class=3D"gmail_quote">On Fri, Nov 6, 2015 at 9:32 AM, Oleg A=
ndreev <span dir=3D"ltr">&lt;<a href=3D"mailto:oleganza@gmail.com" target=
=3D"_blank">oleganza@gmail.com</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><span class=3D""><br>
&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 a=
rray.<br>
&gt;<br>
&gt; They should also be minimally encoded but that is covered by previous =
rules.<br>
<br>
</span>These two lines contradict each other. Minimally-encoded &quot;zero&=
quot; is an array of length zero, not one. I&#39;d suggest defining this ex=
plicitly here as &quot;IF/NOTIF argument must be either zero-length array o=
r a single byte 0x01&quot;.<br>
<br>
<br>
</blockquote></div><br></div>

--001a114a8014b6c5860523dbff53--