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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
|
Delivery-date: Tue, 18 Mar 2025 14:25:28 -0700
Received: from mail-yb1-f185.google.com ([209.85.219.185])
by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
(Exim 4.94.2)
(envelope-from <bitcoindev+bncBDM4H7UM5ABBBPWJ467AMGQEV2FYVXA@googlegroups.com>)
id 1tueRE-0000Gm-2H
for bitcoindev@gnusha.org; Tue, 18 Mar 2025 14:25:28 -0700
Received: by mail-yb1-f185.google.com with SMTP id 3f1490d57ef6-e549b6c54a0sf9741306276.3
for <bitcoindev@gnusha.org>; Tue, 18 Mar 2025 14:25:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlegroups.com; s=20230601; t=1742333122; x=1742937922; darn=gnusha.org;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:x-original-sender:mime-version
:subject:references:in-reply-to:message-id:to:from:date:sender:from
:to:cc:subject:date:message-id:reply-to;
bh=WYBtHiCzxwrUNoEUKu3O7grN+TzHYVNSoIzBFI82cZo=;
b=pBaewn+Z/S51MsEkjkjtM98Pitd5Krwx+jKXdDQZbir3IB6KCG/vJOs82W1VNXIRH+
nNtuSuvAOQzkE9meWQdMxmcyDwVadOYxX+fvsRgodm8pbPm9umObFi3bpAdbphc+wX6L
3EYbpfgj8NuQFfTUBEjynPl26uQsyZ/xgxt1L2X/qE0WY6T8y740bLo97VIUv0bt6Ep6
jilgU3zwqIneltkp6Vq24Aw6pisdz4sILWcWvo7rvOytYANIgR/8Qp3DQC3eqUCHh+fR
Sk7dVfraMTpPoof0mRKR8vuluEMHAD89pU4+zN7D8cQ2NhMsDiH+ps8Xg2gDxCaWeKsm
KRwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1742333122; x=1742937922;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:x-original-sender:mime-version
:subject:references:in-reply-to:message-id:to:from:date:x-beenthere
:x-gm-message-state:sender:from:to:cc:subject:date:message-id
:reply-to;
bh=WYBtHiCzxwrUNoEUKu3O7grN+TzHYVNSoIzBFI82cZo=;
b=ci6iYhd9cFBnlQblce/nZ0gZv41wKx40bZTL6qsPCprMx8VAklm+irDCDUHUz4RP1z
xjV9JMm0iiz8ejCMPVjsbIUurcxXt3Q0c7wtlsRV4neYlJv1Zez5vqkAdPg8+fNI6noi
Tw+oEYeURBOUbIQgr/oxnB/hHJ1hzuuB4qleYkQjWCunGnUHa58bkQ/TEO2AadB3rtc/
6pB9XV+UWz0Ap89qh91XrzmNXLOXsze/cIRTKnJ66fhMxNCYHJz8Y0QFI6lWspuoKNKB
asq8ZZ74kt6499nwl5GNdke1oep3iwUN9j35FYE3bu/J6oLVKgza92xuqZoUL7AI3f6W
yVvw==
Sender: bitcoindev@googlegroups.com
X-Forwarded-Encrypted: i=1; AJvYcCWaGmfjaXQvIHQBuEOT4D2gnH8elkPQIj0Si6KyYdxBzNSbOxNpN4/UOhHi34vXFhrrszarhhduRvXz@gnusha.org
X-Gm-Message-State: AOJu0YyU4ACXWqd/dHxff9YmqRAkpCy2YyfGfct3pOm9lZj8KfmKi7rU
nLOzgaChDSruszDkTek0cS98hdo4z44JZ5dm19rcDsS7dkbFL/L/
X-Google-Smtp-Source: AGHT+IGmkDIfcRX6GYNwBBrtPlmElv3Uv2ormI4E5zjbOTV1JRQE14Bkre/dkzr416PqMZ7dVqQAGw==
X-Received: by 2002:a05:6902:2206:b0:e5d:d4e3:ad8 with SMTP id 3f1490d57ef6-e667b3f68abmr388139276.28.1742333122386;
Tue, 18 Mar 2025 14:25:22 -0700 (PDT)
X-BeenThere: bitcoindev@googlegroups.com; h=ARLLPAKIwdj6wlzJ+RhOgo5UF6dSTMR+V6CB392tUFE73/DhKQ==
Received: by 2002:a25:3d84:0:b0:e63:65ef:4018 with SMTP id 3f1490d57ef6-e63dc2c1b9els43578276.1.-pod-prod-09-us;
Tue, 18 Mar 2025 14:25:18 -0700 (PDT)
X-Received: by 2002:a05:690c:4912:b0:6fd:4670:80e5 with SMTP id 00721157ae682-7009c16968dmr6828967b3.35.1742333118450;
Tue, 18 Mar 2025 14:25:18 -0700 (PDT)
Received: by 2002:a05:690c:305:b0:6fe:b496:fc0e with SMTP id 00721157ae682-6ff454db01cms7b3;
Tue, 18 Mar 2025 08:32:44 -0700 (PDT)
X-Received: by 2002:a05:690c:6108:b0:6fb:b8a1:d3bb with SMTP id 00721157ae682-6ff45f202c9mr228426637b3.17.1742311960561;
Tue, 18 Mar 2025 08:32:40 -0700 (PDT)
Date: Tue, 18 Mar 2025 08:32:40 -0700 (PDT)
From: weichu deng <weichudeng@stu2024.jnu.edu.cn>
To: Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Message-Id: <678d40e3-3e22-4d55-82c0-b25ccafb87ecn@googlegroups.com>
In-Reply-To: <Z9hTu2TjMlLr5-Eg@petertodd.org>
References: <f844a85e-8be8-4429-8687-bc19dd4b96ffn@googlegroups.com>
<Z9hTu2TjMlLr5-Eg@petertodd.org>
Subject: =?UTF-8?Q?Re=3A_=5Bbitcoindev=5D_New_Proposal=EF=BC=9AString_Substring_Sea?=
=?UTF-8?Q?rch_in_Bitcoin_Script_=2D_OP=5FISSUBSTR?=
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_563456_1611484715.1742311960313"
X-Original-Sender: weichudeng@stu2024.jnu.edu.cn
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.7 (/)
------=_Part_563456_1611484715.1742311960313
Content-Type: multipart/alternative;
boundary="----=_Part_563457_1151508066.1742311960314"
------=_Part_563457_1151508066.1742311960314
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi, Peter Todd
Thanks for your feedback. I agree that "Bitcoin scripts are about=20
validation. Not computation."
String search and concatenation are equivalent in some cases, such as in=20
the example you provided.
However, it is still necessary to introduce the OP_ISSUBSTR operation=20
separately.
One example is converting a non-deterministic signature to a deterministic=
=20
one.
Another case is when the substring in question is located in the middle of=
=20
the checked string.
CAT cannot replace ISSUBSTR for the following reasons:
1. The security of CAT is still controversial. It can easily generate=20
overly long strings, potentially causing a stack overflow. Additionally,=
=20
whether OP_CAT will be restored is still under discussion.
2. The other substring (bar) must be known in advance.
=20
With respect,
Weichu Deng
weichudeng@stu2024.jnu.edu.cn
=E5=9C=A82025=E5=B9=B43=E6=9C=8818=E6=97=A5=E6=98=9F=E6=9C=9F=E4=BA=8C UTC+=
8 01:01:16<Peter Todd> =E5=86=99=E9=81=93=EF=BC=9A
On Mon, Mar 17, 2025 at 09:14:05AM -0700, weichu deng wrote:=20
>=20
>=20
> Dear fellow Bitcoin developers,=20
>=20
>=20
>=20
> I am pleased to present a new BIP proposal. This proposal introduces a=20
new=20
> opcode for Bitcoin scripts: OP_ISSUBSTR.=20
>=20
>=20
> *Abstract*=20
>=20
> This BIP introduces two string opcodes, OP_ISSUBSTR and OP_ISSUBSTRVERIFY=
=20
> (similar to the relationship between OP_EQUAL and OP_EQUALVERIFY), to=20
> determine whether one string is a substring of another. As these opcodes=
=20
do=20
> not alter any blockchain state, they are secure.=20
Bitcoin scripts are about validation. Not computation.=20
This means that substring search and concatenation are equivalent. For=20
every script that validates a substring search, you can instead=20
concatenate the substring with the rest of the string, and validate=20
equality instead.=20
Basically speaking:=20
foobar foo IsSubStr=20
is equivalent to:=20
foobar foo bar Cat Equal=20
A real-world example would be more complex. But I hope that illustrates=20
my point sufficiently.=20
--=20
https://petertodd.org 'peter'[:-1]@petertodd.org=20
--=20
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 e=
mail to bitcoindev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/=
678d40e3-3e22-4d55-82c0-b25ccafb87ecn%40googlegroups.com.
------=_Part_563457_1151508066.1742311960314
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div style=3D"padding: 0px; border: 0px; font-variant-numeric: inherit; fon=
t-variant-east-asian: inherit; font-variant-alternates: inherit; font-varia=
nt-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; l=
ine-height: 24px; font-family: -apple-system, BlinkMacSystemFont, "Hel=
vetica Neue", Helvetica, "Segoe UI", Arial, Roboto, "Pi=
ngFang SC", MIUI, "Hiragino Sans GB", "Microsoft YaHei&=
quot;, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit;=
font-kerning: inherit; font-feature-settings: inherit; font-variation-sett=
ings: inherit; vertical-align: baseline; margin-inline: 0px; margin: 0px 0p=
x 0.859em; letter-spacing: 0.25px; max-width: 100%; overflow: auto hidden; =
white-space-collapse: preserve; color: rgb(6, 6, 7); word-break: break-word=
;">Hi, <span style=3D"color: rgb(32, 33, 36); font-family: Roboto, Arial, s=
ans-serif; text-wrap-mode: nowrap;">Peter Todd</span></div><div style=3D"pa=
dding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-a=
sian: inherit; font-variant-alternates: inherit; font-variant-position: inh=
erit; font-variant-emoji: inherit; font-stretch: inherit; line-height: 24px=
; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue"=
;, Helvetica, "Segoe UI", Arial, Roboto, "PingFang SC",=
MIUI, "Hiragino Sans GB", "Microsoft YaHei", sans-seri=
f; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: i=
nherit; font-feature-settings: inherit; font-variation-settings: inherit; v=
ertical-align: baseline; margin-inline: 0px; margin: 0px 0px 0.859em; lette=
r-spacing: 0.25px; max-width: 100%; overflow: auto hidden; white-space-coll=
apse: preserve; color: rgb(6, 6, 7); word-break: break-word;">Thanks for yo=
ur feedback. I agree that "Bitcoin scripts are about validation. Not comput=
ation."</div><div style=3D"padding: 0px; border: 0px; font-variant-numeric:=
inherit; font-variant-east-asian: inherit; font-variant-alternates: inheri=
t; font-variant-position: inherit; font-variant-emoji: inherit; font-stretc=
h: inherit; line-height: 24px; font-family: -apple-system, BlinkMacSystemFo=
nt, "Helvetica Neue", Helvetica, "Segoe UI", Arial, Rob=
oto, "PingFang SC", MIUI, "Hiragino Sans GB", "Mic=
rosoft YaHei", sans-serif; font-optical-sizing: inherit; font-size-adj=
ust: inherit; font-kerning: inherit; font-feature-settings: inherit; font-v=
ariation-settings: inherit; vertical-align: baseline; margin-inline: 0px; m=
argin: 0px 0px 0.859em; letter-spacing: 0.25px; max-width: 100%; overflow: =
auto hidden; white-space-collapse: preserve; color: rgb(6, 6, 7); word-brea=
k: break-word;">String search and concatenation are equivalent in some case=
s, such as in the example you provided.</div><div style=3D"padding: 0px; bo=
rder: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit;=
font-variant-alternates: inherit; font-variant-position: inherit; font-var=
iant-emoji: inherit; font-stretch: inherit; line-height: 24px; font-family:=
-apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, =
"Segoe UI", Arial, Roboto, "PingFang SC", MIUI, "H=
iragino Sans GB", "Microsoft YaHei", sans-serif; font-optica=
l-sizing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-f=
eature-settings: inherit; font-variation-settings: inherit; vertical-align:=
baseline; margin-inline: 0px; margin: 0px 0px 0.859em; letter-spacing: 0.2=
5px; max-width: 100%; overflow: auto hidden; white-space-collapse: preserve=
; color: rgb(6, 6, 7); word-break: break-word;">However, it is still necess=
ary to introduce the OP_ISSUBSTR operation separately.</div><div style=3D"p=
adding: 0px; border: 0px; font-variant-numeric: inherit; font-variant-east-=
asian: inherit; font-variant-alternates: inherit; font-variant-position: in=
herit; font-variant-emoji: inherit; font-stretch: inherit; line-height: 24p=
x; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue&quo=
t;, Helvetica, "Segoe UI", Arial, Roboto, "PingFang SC"=
, MIUI, "Hiragino Sans GB", "Microsoft YaHei", sans-ser=
if; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: =
inherit; font-feature-settings: inherit; font-variation-settings: inherit; =
vertical-align: baseline; margin-inline: 0px; margin: 0px 0px 0.859em; lett=
er-spacing: 0.25px; max-width: 100%; overflow: auto hidden; white-space-col=
lapse: preserve; color: rgb(6, 6, 7); word-break: break-word;">One example =
is converting a non-deterministic signature to a deterministic one.</div><d=
iv style=3D"padding: 0px; border: 0px; font-variant-numeric: inherit; font-=
variant-east-asian: inherit; font-variant-alternates: inherit; font-variant=
-position: inherit; font-variant-emoji: inherit; font-stretch: inherit; lin=
e-height: 24px; font-family: -apple-system, BlinkMacSystemFont, "Helve=
tica Neue", Helvetica, "Segoe UI", Arial, Roboto, "Ping=
Fang SC", MIUI, "Hiragino Sans GB", "Microsoft YaHei&qu=
ot;, sans-serif; font-optical-sizing: inherit; font-size-adjust: inherit; f=
ont-kerning: inherit; font-feature-settings: inherit; font-variation-settin=
gs: inherit; vertical-align: baseline; margin-inline: 0px; margin: 0px 0px =
0.859em; letter-spacing: 0.25px; max-width: 100%; overflow: auto hidden; wh=
ite-space-collapse: preserve; color: rgb(6, 6, 7); word-break: break-word;"=
>Another case is when the substring in question is located in the middle of=
the checked string.</div><div style=3D"padding: 0px; border: 0px; font-var=
iant-numeric: inherit; font-variant-east-asian: inherit; font-variant-alter=
nates: inherit; font-variant-position: inherit; font-variant-emoji: inherit=
; font-stretch: inherit; line-height: 24px; font-family: -apple-system, Bli=
nkMacSystemFont, "Helvetica Neue", Helvetica, "Segoe UI"=
;, Arial, Roboto, "PingFang SC", MIUI, "Hiragino Sans GB&quo=
t;, "Microsoft YaHei", sans-serif; font-optical-sizing: inherit; =
font-size-adjust: inherit; font-kerning: inherit; font-feature-settings: in=
herit; font-variation-settings: inherit; vertical-align: baseline; margin-i=
nline: 0px; margin: 0px 0px 0.859em; letter-spacing: 0.25px; max-width: 100=
%; overflow: auto hidden; white-space-collapse: preserve; color: rgb(6, 6, =
7); word-break: break-word;">CAT cannot replace ISSUBSTR for the following =
reasons:</div><ol start=3D"1" style=3D"padding: 0px 0px 0px 2em; border: 0p=
x; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-va=
riant-alternates: inherit; font-variant-position: inherit; font-variant-emo=
ji: inherit; font-stretch: inherit; line-height: inherit; font-family: -app=
le-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "=
;Segoe UI", Arial, Roboto, "PingFang SC", MIUI, "Hiragi=
no Sans GB", "Microsoft YaHei", sans-serif; font-optical-siz=
ing: inherit; font-size-adjust: inherit; font-kerning: inherit; font-featur=
e-settings: inherit; font-variation-settings: inherit; vertical-align: base=
line; list-style-position: initial; list-style-image: initial; margin-inlin=
e: 0px; margin: 0.859em 0px 0px; color: rgb(6, 6, 7); letter-spacing: 0.5px=
;"><li style=3D"margin: 0px; padding: 0px; border: 0px; font-style: inherit=
; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-=
size: inherit; line-height: 24px; font-family: inherit; font-optical-sizing=
: inherit; font-size-adjust: inherit; font-kerning: inherit; font-feature-s=
ettings: inherit; font-variation-settings: inherit; vertical-align: baselin=
e; letter-spacing: 0.25px;"><div style=3D"padding: 0px; border: 0px; font-s=
tyle: inherit; font-variant: inherit; font-weight: inherit; font-stretch: i=
nherit; line-height: 24px; font-family: inherit; font-optical-sizing: inher=
it; font-size-adjust: inherit; font-kerning: inherit; font-feature-settings=
: inherit; font-variation-settings: inherit; vertical-align: baseline; marg=
in-inline: 0px; margin: 0px; max-width: 100%; overflow: visible; white-spac=
e-collapse: preserve; word-break: break-word;">The security of CAT is still=
controversial. It can easily generate overly long strings, potentially cau=
sing a stack overflow. Additionally, whether OP_CAT will be restored is sti=
ll under discussion.</div></li><li style=3D"margin: 0px; padding: 0px; bord=
er: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; =
font-stretch: inherit; font-size: inherit; line-height: 24px; font-family: =
inherit; font-optical-sizing: inherit; font-size-adjust: inherit; font-kern=
ing: inherit; font-feature-settings: inherit; font-variation-settings: inhe=
rit; vertical-align: baseline; letter-spacing: 0.25px;"><div style=3D"paddi=
ng: 0px; border: 0px; font-style: inherit; font-variant: inherit; font-weig=
ht: inherit; font-stretch: inherit; line-height: 24px; font-family: inherit=
; font-optical-sizing: inherit; font-size-adjust: inherit; font-kerning: in=
herit; font-feature-settings: inherit; font-variation-settings: inherit; ve=
rtical-align: baseline; margin-inline: 0px; margin: 0px; max-width: 100%; o=
verflow: visible; white-space-collapse: preserve; word-break: break-word;">=
The other substring (bar) must be known in advance.</div></li></ol><div><fo=
nt color=3D"#060607" face=3D"-apple-system, BlinkMacSystemFont, Helvetica N=
eue, Helvetica, Segoe UI, Arial, Roboto, PingFang SC, MIUI, Hiragino Sans G=
B, Microsoft YaHei, sans-serif"><span style=3D"letter-spacing: 0.25px; whit=
e-space-collapse: preserve;"><br /></span></font></div><div><p><span lang=
=3D"EN-US">With respect,</span></p>
<p><span lang=3D"EN-US">Weichu Deng</span></p>
<p><span lang=3D"EN-US"><a href=3D"mailto:weichudeng@stu2024.jnu.edu.cn" ta=
rget=3D"_blank">weichudeng@stu2024.jnu.edu.cn</a></span></p></div><div><div=
dir=3D"auto">=E5=9C=A82025=E5=B9=B43=E6=9C=8818=E6=97=A5=E6=98=9F=E6=9C=9F=
=E4=BA=8C UTC+8 01:01:16<Peter Todd> =E5=86=99=E9=81=93=EF=BC=9A<br /=
></div><blockquote style=3D"margin: 0px 0px 0px 0.8ex; border-left: 1px sol=
id rgb(204, 204, 204); padding-left: 1ex;">On Mon, Mar 17, 2025 at 09:14:05=
AM -0700, weichu deng wrote:
<br />>=20
<br />>=20
<br />> Dear fellow Bitcoin developers,
<br />>=20
<br />> =20
<br />>=20
<br />> I am pleased to present a new BIP proposal. This proposal introd=
uces a new=20
<br />> opcode for Bitcoin scripts: OP_ISSUBSTR.
<br />>=20
<br />>=20
<br />> *Abstract*
<br />>=20
<br />> This BIP introduces two string opcodes, OP_ISSUBSTR and OP_ISSUB=
STRVERIFY=20
<br />> (similar to the relationship between OP_EQUAL and OP_EQUALVERIFY=
), to=20
<br />> determine whether one string is a substring of another. As these=
opcodes do=20
<br />> not alter any blockchain state, they are secure.
<br />
<br />Bitcoin scripts are about validation. Not computation.
<br />
<br />This means that substring search and concatenation are equivalent. Fo=
r
<br />every script that validates a substring search, you can instead
<br />concatenate the substring with the rest of the string, and validate
<br />equality instead.
<br />
<br />Basically speaking:
<br />
<br /> foobar foo IsSubStr
<br />
<br />is equivalent to:
<br />
<br /> foobar foo bar Cat Equal
<br />
<br />A real-world example would be more complex. But I hope that illustrat=
es
<br />my point sufficiently.
<br />
<br />--=20
<br /><a href=3D"https://petertodd.org" target=3D"_blank" rel=3D"nofollow">=
https://petertodd.org</a> 'peter'[:-1]@<a href=3D"http://petertodd.org" tar=
get=3D"_blank" rel=3D"nofollow">petertodd.org</a>
<br /></blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Bitcoin Development Mailing List" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:bitcoindev+unsubscribe@googlegroups.com">bitcoind=
ev+unsubscribe@googlegroups.com</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
bitcoindev/678d40e3-3e22-4d55-82c0-b25ccafb87ecn%40googlegroups.com?utm_med=
ium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/bitcoind=
ev/678d40e3-3e22-4d55-82c0-b25ccafb87ecn%40googlegroups.com</a>.<br />
------=_Part_563457_1151508066.1742311960314--
------=_Part_563456_1611484715.1742311960313--
|