summaryrefslogtreecommitdiff
path: root/5d/ba44ff7bf268a182120dcfa32017d5a5ce825d
blob: bbbdf44139e34c8618245f253b03554cfbe5d5f4 (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
Return-Path: <jl2012@xbt.hk>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 41571A7F
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 15 Nov 2017 18:02:58 +0000 (UTC)
X-Greylist: from auto-whitelisted by SQLgrey-1.7.6
Received: from sender-of-o51.zoho.com (sender-of-o51.zoho.com [135.84.80.216])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A1C8E4E9
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 15 Nov 2017 18:02:57 +0000 (UTC)
Received: from [10.8.0.103] (119246244201.ctinets.com [119.246.244.201]) by
	mx.zohomail.com with SMTPS id 1510768972558816.3077961889941;
	Wed, 15 Nov 2017 10:02:52 -0800 (PST)
From: Johnson Lau <jl2012@xbt.hk>
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_EAEAEC1D-74EB-4710-BC74-98E80427051B"
Mime-Version: 1.0 (Mac OS X Mail 11.0 \(3445.1.6\))
Message-Id: <53A587C3-DAC1-4055-875F-96B61717ACE6@xbt.hk>
Date: Thu, 16 Nov 2017 02:02:48 +0800
To: bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org>
X-Mailer: Apple Mail (2.3445.1.6)
X-ZohoMailClient: External
X-Spam-Status: No, score=0.0 required=5.0 tests=HTML_MESSAGE,
	RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Subject: [bitcoin-dev] Making OP_CODESEPARATOR and FindAndDelete in
 non-segwit scripts non-standard
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Bitcoin Protocol 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: Wed, 15 Nov 2017 18:02:58 -0000


--Apple-Mail=_EAEAEC1D-74EB-4710-BC74-98E80427051B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

In https://github.com/bitcoin/bitcoin/pull/11423 =
<https://github.com/bitcoin/bitcoin/pull/11423> I propose to make =
OP_CODESEPARATOR and FindAndDelete in non-segwit scripts non-standard

I think FindAndDelete() is one of the most useless and complicated =
functions in the script language. It is omitted from segwit (BIP143), =
but we still need to support it in non-segwit scripts. Actually, =
FindAndDelete() would only be triggered in some weird edge cases like =
using out-of-range SIGHASH_SINGLE.

Non-segwit scripts also use a FindAndDelete()-like function to remove =
OP_CODESEPARATOR from scriptCode. Note that in BIP143, only executed =
OP_CODESEPARATOR are removed so it doesn=E2=80=99t have the =
FindAndDelete()-like function. OP_CODESEPARATOR in segwit scripts are =
useful for Tumblebit so it is not disabled in this proposal

By disabling both, it guarantees that scriptCode serialized inside =
SignatureHash() must be constant

If we use a softfork to remove FindAndDelete() and OP_CODESEPARATOR from =
non-segwit scripts, we could completely remove FindAndDelete() from the =
consensus code later by whitelisting all blocks before the softfork =
block. The first step is to make them non-standard in the next release.


=20=

--Apple-Mail=_EAEAEC1D-74EB-4710-BC74-98E80427051B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" =
class=3D"">In&nbsp;<a =
href=3D"https://github.com/bitcoin/bitcoin/pull/11423" =
class=3D"">https://github.com/bitcoin/bitcoin/pull/11423</a>&nbsp;I =
propose to make&nbsp;OP_CODESEPARATOR and FindAndDelete in non-segwit =
scripts non-standard<div class=3D""><br class=3D""></div><div class=3D"">I=
 think FindAndDelete() is one of the most useless and complicated =
functions in the script language. It is omitted from segwit (BIP143), =
but we still need to support it in non-segwit scripts. Actually, =
FindAndDelete() would only be triggered in some weird edge cases like =
using out-of-range SIGHASH_SINGLE.</div><div class=3D""><br =
class=3D""></div><div class=3D"">Non-segwit scripts also use a =
FindAndDelete()-like function to remove OP_CODESEPARATOR from =
scriptCode. Note that in BIP143, only executed OP_CODESEPARATOR are =
removed so it doesn=E2=80=99t have the FindAndDelete()-like function. =
OP_CODESEPARATOR in segwit scripts are useful for Tumblebit so it is not =
disabled in this proposal</div><div class=3D""><br class=3D""></div><div =
class=3D"">By disabling both, it guarantees that scriptCode serialized =
inside SignatureHash() must be constant</div><div class=3D""><br =
class=3D""></div><div class=3D"">If we use a softfork to remove =
FindAndDelete() and OP_CODESEPARATOR from non-segwit scripts, we could =
completely remove FindAndDelete() from the consensus code later by =
whitelisting all blocks before the softfork block. The first step is to =
make them non-standard in the next release.</div><div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""></div><div =
class=3D"">&nbsp;</div></body></html>=

--Apple-Mail=_EAEAEC1D-74EB-4710-BC74-98E80427051B--