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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
|
Delivery-date: Mon, 09 Dec 2024 14:16:34 -0800
Received: from mail-qk1-f187.google.com ([209.85.222.187])
by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
(Exim 4.94.2)
(envelope-from <bitcoindev+bncBDVJRHEUX4BRBOOY3W5AMGQEK7FXEZY@googlegroups.com>)
id 1tKm3N-0001lA-OY
for bitcoindev@gnusha.org; Mon, 09 Dec 2024 14:16:34 -0800
Received: by mail-qk1-f187.google.com with SMTP id af79cd13be357-7b6c8e4baaasf166180685a.3
for <bitcoindev@gnusha.org>; Mon, 09 Dec 2024 14:16:33 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1733782587; cv=pass;
d=google.com; s=arc-20240605;
b=OnMc/dqL6ELNdl6wacEN26yaHWT7UBG+jQVowGDM4WHLcl3nQi1EPJ0MLvmIVY72eY
lZQrOAwNdJbKYNFOxtx5GBwg1sSsggTfi4DGSSgRufUTFvMn0JoMXyrO4CwXKnynLd3F
vJdg64sHwwlSCyVQ4d2MVvOClv40RTv7M7OxgyuyofiBBRNuHhx/2q+SfnFrCrkQ5mcP
pnNx31JMMPS9q/caa5X9EZjfQWyfEVpDO26fSUNzFpiCo9g7lpYwNJAnQmgLMwT7H/XY
zbSzBmflqc3n1WffR1cWb/mcZY+MVF+zjl78oU7fTbra6Knpw79n4IYAZIymQh+I2lpX
A79w==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:in-reply-to:content-disposition
:mime-version:references:message-id:subject:cc:to:from:date:sender
:dkim-signature;
bh=sBBWjfx/mV1hKenE1JbRMGaltr/jF5jHxRgTQp5f+bM=;
fh=RDSQ/C1NdUJpehzfk2OjyxQL5BbuiRcxMlm3PMcknw8=;
b=gaUe+5RFWQRauEoiNKmMdagf3cBtx/xkJrCqt6dRP+uLLRmYfoLfo3f8pr+3H+aHAk
2rCzD3NCeiUkJ6UstKE7P4n+wC59nOa8Y3j+Un0u4g4jjsBl38RH5U4UmLIz4/eJT5yJ
EmmEXL2wuHU2hrrVNZ7Ozz9HG+S/S4GmD+ItsaPZj8BDNb+oe+JH1w1ItYrSnRnkD29f
fs86FEhqY1bkoDdW4YOxZkmA02bjbAbKopMAmOaHpTJ1d5Lvjmw8cs5jJCGvL6wChTec
LYGyATRIo6umKHqAQEfWVg4Uix1cgXVYOm4kqkznnkauPY5MWgPlWaPXHR4mRgD7wi3L
4ytg==;
darn=gnusha.org
ARC-Authentication-Results: i=2; gmr-mx.google.com;
dkim=pass header.i=@reardencode.com header.s=mail header.b=shrgmaX3;
spf=pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) smtp.mailfrom=freedom@reardencode.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=reardencode.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlegroups.com; s=20230601; t=1733782587; x=1734387387; darn=gnusha.org;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:x-original-authentication-results
:x-original-sender:in-reply-to:content-disposition:mime-version
:references:message-id:subject:cc:to:from:date:sender:from:to:cc
:subject:date:message-id:reply-to;
bh=sBBWjfx/mV1hKenE1JbRMGaltr/jF5jHxRgTQp5f+bM=;
b=S0XCQp31gOK/VGnTuI2gM0Uu5US348IagZWbFOzlYaM1bwZ/0W8JMpuUKsiPYfJpsZ
DdtsFhEOmS8E57WBV3GQpZndbd1isfNGp6MftRs/zzL6BQTUoTkT6VXikX+wFGCY0IZw
H8MQkSqLIOCcO/4nYz+cLIVZyGbma6kQFPg28xuBlu5Vr6Yfzxm7m4fVeYqiS46+++Z9
9v+cLYb06f31P6s4M1ahyP/4APka39aHqvlAZrhxO7ZTTxWM6oDArtC5MbA4nugSOYxT
1hEPWIt0H6Kt8I25hbcff18BXGuwJQfb0O6y8PvdD4ZiBliGjKL9FmeneFq71V14zlj5
S7RQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1733782587; x=1734387387;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:x-original-authentication-results
:x-original-sender:in-reply-to:content-disposition:mime-version
:references:message-id:subject:cc:to:from:date:x-beenthere
:x-gm-message-state:sender:from:to:cc:subject:date:message-id
:reply-to;
bh=sBBWjfx/mV1hKenE1JbRMGaltr/jF5jHxRgTQp5f+bM=;
b=CygH+9XV8rzaEJ1nbvOIUzpauMW+/LF6rF2KNcMh80xT3dhscdn6B4Qe8xDcEBiJiM
Yg4UzHLEODh5UfPpEnkTkHPtE0yuq9txP85tORcNFxd5/INJTjxlHV7y5643qxPBjarh
1Ziz+UuSNy9anyxAYA0MjgWr5ApsRFw4uO9zJp72+dcJI7E1Bq2L6lJGOkvChZTjx/sC
piVuJ/7cGc301/3J+l2QolrjOphaY0dMya0kslHNpEKSScKp+yTjaOuNs5mzRkdMf0bB
lf8EoMZUDQKBuUyzsYmJddXiUfzgpJbwQtRS58UGkpdC0R5B+ddkb24nXm53Hc/PU7NG
Kjhw==
Sender: bitcoindev@googlegroups.com
X-Forwarded-Encrypted: i=2; AJvYcCW4rHtOrMZv5D0GoQfxh23K80OQW1wjI4tkR186esG12hzzaH4Aou24BOrMwyNX9mdTqJP16VbevylY@gnusha.org
X-Gm-Message-State: AOJu0Yyc5TJJM9eAUbRsa6OdU2B45RxT/vgcEwo67nJvGC4W0FZ0XQ2+
ZZIeMjT9oa24PrI012P/cZDuh3Bu1CJdEiGVmiTfM5TG6xvFmPqP
X-Google-Smtp-Source: AGHT+IFA7SwUh/sk6nkG8Vm7hIjbsr4iSxO6/oTtZevR9DAkTUPeDl2Cqf3S0CXakbXWjeqUOeopDg==
X-Received: by 2002:a05:620a:489b:b0:7b6:d2bb:25c3 with SMTP id af79cd13be357-7b6dce7048dmr385044685a.36.1733782587345;
Mon, 09 Dec 2024 14:16:27 -0800 (PST)
X-BeenThere: bitcoindev@googlegroups.com
Received: by 2002:a05:622a:1a83:b0:466:98fc:1e3f with SMTP id
d75a77b69052e-46727cf928bls8396441cf.1.-pod-prod-04-us; Mon, 09 Dec 2024
14:16:25 -0800 (PST)
X-Forwarded-Encrypted: i=2; AJvYcCVbd3ClCGVStBchhZxX602Y7bPFIfZnVhQwSAynLw7cjkBIm6u3v7DbDXmlie1C6pI6zdKdeAKpwoUh@googlegroups.com
X-Received: by 2002:a05:620a:4720:b0:7b6:d1f6:3e0 with SMTP id af79cd13be357-7b6dce24aeemr346733785a.22.1733782585085;
Mon, 09 Dec 2024 14:16:25 -0800 (PST)
Received: by 2002:a05:620a:2283:b0:7b6:d314:a4e5 with SMTP id af79cd13be357-7b6df46e1cbms85a;
Mon, 9 Dec 2024 14:06:42 -0800 (PST)
X-Forwarded-Encrypted: i=2; AJvYcCUvcyVcb6pxs9WquztfLKPdbPOMyijBWMtxP67TjJYrDvPsg3lh88rRYOt4KTCYCAjckyMl0U3MESMD@googlegroups.com
X-Received: by 2002:a05:6122:268b:b0:50a:318:b3c2 with SMTP id 71dfb90a1353d-518882ef84fmr3306958e0c.2.1733782002150;
Mon, 09 Dec 2024 14:06:42 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1733782002; cv=none;
d=google.com; s=arc-20240605;
b=IyJtmcTBdzDihQQwHqw6bF91nt34Q2OAZaxYbonutmsY+6erMy/lSs1T9Ily0fZT1L
LyTQi8UFkLI0kCoeSJUk4Xf5L33wUWs6uMfNL5ijTi0QbvFcnGcBnihCvoI6cCi8cJ0L
+0suYO2gcRYFPISze5GuzRI0avUItloVqmC5x+PnGCRQxxo71Wsc8n1YLFBTD1teKwp7
O+5+TFCDFrgIDU7ZG2rYs3M9deXxtVcnlfqTP0AYH/XHfjOGXord9G8B1NH/4qZFKP1l
uZx9+K2DJjy+CEt+nyECPCcm6KbnRLQnMK3Z8w3pFIeRE0CpRNxpOvfzxL2osAzM1cy2
G5RA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
h=in-reply-to:content-disposition:mime-version:references:message-id
:subject:cc:to:from:dkim-signature:date;
bh=yroNtnMSYkrxtEJWzCdn6RMhuQYnTF8wG3xFM/v5OPw=;
fh=WzA7XE6JThZt6XHU34+ovZ4yjpN4+JvtHw9XmbCP2LI=;
b=NkCwB7oOZBHHvq2oVxjQBX0iWZKn7TJA4656OZxTAW7QKKzGrzpJ6nnigmsPpr8Hta
FYwlKGPKuDa00mDoErRke60+c93jZHAGFOHxr62LqS74egEm9sb7ual4224wDi330J8W
OMgkvekbe2J6YNxUPH6OWfkZf2uHKkdEoop1fmr/21fRiGs1aXm8ZdgIDCTWSLdCjxAv
197rZR3yo3yf+gdNRn6xBwjVDV3LzPBWYELPM2rD7WSasq94I7IrqVaNPkms6y/OjEOO
KWD+bocwNJMp8XzLGmkfIwLW5lF+2/dgDeWMDjm4EuBlQ8o97o/XBzQv+ajs591O8Q6x
XA+Q==;
dara=google.com
ARC-Authentication-Results: i=1; gmr-mx.google.com;
dkim=pass header.i=@reardencode.com header.s=mail header.b=shrgmaX3;
spf=pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) smtp.mailfrom=freedom@reardencode.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=reardencode.com
Received: from mail.reardencode.com ([2607:f2f8:ad40:ea11::1])
by gmr-mx.google.com with ESMTPS id 71dfb90a1353d-5161637e295si287514e0c.5.2024.12.09.14.06.41
for <bitcoindev@googlegroups.com>
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Mon, 09 Dec 2024 14:06:41 -0800 (PST)
Received-SPF: pass (google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1 as permitted sender) client-ip=2607:f2f8:ad40:ea11::1;
Date: Mon, 9 Dec 2024 14:06:08 -0800
From: Brandon Black <freedom@reardencode.com>
To: Andrew Poelstra <apoelstra@wpsoftware.net>
Cc: Weikeng Chen <weikeng.chen@l2iterative.com>,
Bitcoin Development Mailing List <bitcoindev@googlegroups.com>,
Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: [bitcoindev] Difficulty in emulating "weaker" OP_SUCCESS and why
it should be a real opcode
Message-ID: <Z1dp0Jtbrkcf7Roi@console>
References: <ebd77d82-96ab-4530-909a-d085378b9868n@googlegroups.com>
<Z1dAQ8pSIqn8XA56@camus>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
In-Reply-To: <Z1dAQ8pSIqn8XA56@camus>
X-Operating-System: Linux 6.6.36 x86_64
X-Original-Sender: freedom@reardencode.com
X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass
header.i=@reardencode.com header.s=mail header.b=shrgmaX3; spf=pass
(google.com: domain of freedom@reardencode.com designates 2607:f2f8:ad40:ea11::1
as permitted sender) smtp.mailfrom=freedom@reardencode.com; dmarc=pass
(p=NONE sp=NONE dis=NONE) header.from=reardencode.com
Precedence: list
Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com
List-ID: <bitcoindev.googlegroups.com>
X-Google-Group-Id: 786775582512
List-Post: <https://groups.google.com/group/bitcoindev/post>, <mailto:bitcoindev@googlegroups.com>
List-Help: <https://groups.google.com/support/>, <mailto:bitcoindev+help@googlegroups.com>
List-Archive: <https://groups.google.com/group/bitcoindev
List-Subscribe: <https://groups.google.com/group/bitcoindev/subscribe>, <mailto:bitcoindev+subscribe@googlegroups.com>
List-Unsubscribe: <mailto:googlegroups-manage+786775582512+unsubscribe@googlegroups.com>,
<https://groups.google.com/group/bitcoindev/subscribe>
X-Spam-Score: -0.8 (/)
Hey list,
On 2024-12-09 (Mon) at 19:08:51 +0000, Andrew Poelstra wrote:
> On Mon, Dec 09, 2024 at 05:27:54AM -0800, Weikeng Chen wrote:
> > When I am implementing fraud proofs in Bitcoin script, I find it useful to
> > have an opcode "OP_SUCCESS" that will mark the execution to be successful
> > without running the rest of the script, if this opcode is being executed.
> > This is useful for writing code for fraud proofs such as BitVM, where the
> > verifier wins if it finds one mismatch, and the verifier does not need to
> > show the other mismatches.
> >
> > This OP_SUCCESS is weaker version of the OP_SUCCESSx in the Taproot
> > upgrade, which marks the execution as successful for the mere presence of
> > OP_SUCCESSx anywhere in the script. Rusty Russell in a 2023 article,
> > "Covenants: Examining ScriptPubkeys in Bitcoin Script", also mentioned
> > about the usefulness of such an opcode.
> >
> > <snip>
>
> In short, for purpose of softforking upgrade mechanism, the existing
> SUCCESS codes give us way more freedom of action.
>
> But it sounds like you want a "weak SUCCESS" opcode in order to use the
> success semantics, not as an upgrade mechanism. Maybe it makes sense to
> propose that one of the existing OP_SUCCESSx opcodes should be
> softforked to become OP_WEAK_SUCCESS?
An alternative that Rusty Russel has discussed wanting as part of his
script restoration work is "OP_SEGMENT" which would split the script
execution for purposes of SUCCESS checking, allowing (for example) a
prefix to be required to execute before an arbitrary user provided
script that might contain an OP_SUCCESS.
It occurred to me today when thinking about Weikeng's post that we can
slightly weaken the existing OP_SUCCESS behavior while retaining
essentially all of its benefits in practice without introducing
OP_SEGMENT by leveraging OP_CODESEPARATOR. Redefine OP_SUCCESS with a
soft fork from "make the script unconditionally valid" to "make the
script segment unconditionally valid", and define a script segment as
"each lexicographic section of the script containing no
OP_CODESEPARATOR".
The script interpreter can perform SUCCESS checking as it currently does
until it encounters an OP_CODESEPARATOR. Each OP_CODESEPARATOR gets a
"SUCCESS" flag defaulted to false and SUCCESS checking now sets that
flag to true on the most recently encountered OP_CODESEPARATOR.
During script execution, whenever an OP_CODESEPARATOR is popped (not
executed) its "SUCCESS" flag value is copied to the interpreter state.
After this state setting conditional, if the interpreter "SUCCESS" flag
is true, and fExec is true, the script immediately succeeds.
For Weikeng's scripts, this would require 2 OP_CODESEPARATORS for each
OP_SUCCESS (or some really weird logic about what's executed in what
SUCCESS state).
Thoughts on this approach?
--Brandon
--
You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/Z1dp0Jtbrkcf7Roi%40console.
|