summaryrefslogtreecommitdiff
path: root/76/6885c3e21206b952d947599eb24ba314b65eb2
blob: 8af6495754a917b6dbdefa117c649617bde2a9c8 (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
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
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
Delivery-date: Wed, 19 Mar 2025 17:06:48 -0700
Received: from mail-yb1-f191.google.com ([209.85.219.191])
	by mail.fairlystable.org with esmtps  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
	(Exim 4.94.2)
	(envelope-from <bitcoindev+bncBDM4H7UM5ABBBDNY5W7AMGQE3H2LJBI@googlegroups.com>)
	id 1tv3Qs-0003JC-Sv
	for bitcoindev@gnusha.org; Wed, 19 Mar 2025 17:06:47 -0700
Received: by mail-yb1-f191.google.com with SMTP id 3f1490d57ef6-e5740c858besf265214276.2
        for <bitcoindev@gnusha.org>; Wed, 19 Mar 2025 17:06:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=googlegroups.com; s=20230601; t=1742429201; x=1743034001; 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=UcB/pphvkmwzNLCPkj2JdsbmVmO/f1h317q2NG0/sXw=;
        b=ItlrkgHTeeZprxZyab4Hg/dIbZ8QxgVPSegzVirr6KdtIQufnMVKWSvbwg3t+HNm73
         k4pX2koNRBYtvjxZJ4wBa50L0OGUD9Vvr27S687W0n7FSvhZPdbtjPMy3EaKOEdFtovv
         +JDGcYTa71PMDb/ms3I+66vHhlVKztmDtdBYLhI/JG7QUo0Lpz/ZZqzYPTNbMpUebG28
         8fJTJYTZJTe2ykzhWIAmUW3X3ONwABvBJo9/FDiOyv11AI1kBHcC847eKJBMhvY6z4ZI
         sgjzMgUWcJcp6RJN9UGqiWTJFJF0JNgRaGTmThrjnITzx8r5eQT2C34GX7G0+UUMY8wz
         gE2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1742429201; x=1743034001;
        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=UcB/pphvkmwzNLCPkj2JdsbmVmO/f1h317q2NG0/sXw=;
        b=VCpp/ME516oMwWOzFtmAf/QcGAGD4xw3sXGOY84W+xdzSMLyLD7COWQPEs/esGxl1+
         9yduGGcD9DO/iFOvQRlvnIgTYKlqHF0IhWnyHEeWXsioD0fGWA+Rf4v6vHQ+vl0Wzr/9
         Fg8JtwGzU/JVf2K+H2OizSAzY6KOi9Hd9rJqr260b/Qffn9y45RQj/znXsH3k+oPsX4h
         eGa7BhpFfVxriVPGZo5ePX8Q1+H673vjcYDRUNNua4ZLPmf6gbHuFslSDaBIhbrtj1GM
         MhrGeBQq3SRBXGcWxb0isoJkAhpugtSbaO4kKLrc08Lu79eCnt0Gwd7LS9plZ0gZp1WB
         6ppg==
Sender: bitcoindev@googlegroups.com
X-Forwarded-Encrypted: i=1; AJvYcCWfEo+lqfkfVGq0nxgCg8168lTeBDllel5XKlDPcpDCkcvYkN/HP1nHVP2tZCHG7UAMsBpf+OrSI24c@gnusha.org
X-Gm-Message-State: AOJu0YzwqXnOfS5Ksg3Qi0t/44OiKEJZjLWv/Zt6zxYSvpi91KGa8a7k
	Kfd5qhEVp+r83af4d0wrywtjbkmPoZ/E1AYwBVsZK1OTCCwf1/lN
X-Google-Smtp-Source: AGHT+IGavseGfFl8yUuYRWSFJ/6bEVSqpRHgo5hk//u1TU5Ui2Esp+768dumnco/C1zQL6fTrTYNyw==
X-Received: by 2002:a05:6902:2b08:b0:e58:aa00:ffd5 with SMTP id 3f1490d57ef6-e667b39f5a4mr6370592276.4.1742429200858;
        Wed, 19 Mar 2025 17:06:40 -0700 (PDT)
X-BeenThere: bitcoindev@googlegroups.com; h=ARLLPAIwzJMFn+V1pAJd2GNDX1CNNP+qq8ogP+hj5DzZIF03Hw==
Received: by 2002:a5b:20f:0:b0:e61:1c4c:6d6b with SMTP id 3f1490d57ef6-e6690a82f1als416612276.2.-pod-prod-02-us;
 Wed, 19 Mar 2025 17:06:36 -0700 (PDT)
X-Received: by 2002:a05:690c:b15:b0:6f9:7a38:af5b with SMTP id 00721157ae682-7009bf72520mr72034107b3.13.1742429196812;
        Wed, 19 Mar 2025 17:06:36 -0700 (PDT)
Received: by 2002:a05:690c:6a86:b0:6ef:590d:3213 with SMTP id 00721157ae682-7009ba67b03ms7b3;
        Wed, 19 Mar 2025 02:07:58 -0700 (PDT)
X-Received: by 2002:a05:690c:3506:b0:6f9:7fe6:9d48 with SMTP id 00721157ae682-7009bf49f65mr24946907b3.7.1742375277130;
        Wed, 19 Mar 2025 02:07:57 -0700 (PDT)
Date: Wed, 19 Mar 2025 02:07:56 -0700 (PDT)
From: weichu deng <weichudeng@stu2024.jnu.edu.cn>
To: Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Message-Id: <8c823e50-197e-479c-8651-9e0407a4168en@googlegroups.com>
In-Reply-To: <CAD2YOAp=ft+pApAwh6CQvwMpujfZ0ysSK+=7zKA64nBeB5w3nA@mail.gmail.com>
References: <f844a85e-8be8-4429-8687-bc19dd4b96ffn@googlegroups.com>
 <Z9hTu2TjMlLr5-Eg@petertodd.org>
 <678d40e3-3e22-4d55-82c0-b25ccafb87ecn@googlegroups.com>
 <CAD2YOAp=ft+pApAwh6CQvwMpujfZ0ysSK+=7zKA64nBeB5w3nA@mail.gmail.com>
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_2434_1529323214.1742375276685"
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_2434_1529323214.1742375276685
Content-Type: multipart/alternative; 
	boundary="----=_Part_2435_1135241746.1742375276685"

------=_Part_2435_1135241746.1742375276685
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable



Hi Rijndael,

=20

Thanks for your example=20

[witness: foobar  foo] bar CAT EQ

=20

Yes, the unfixed string can be checked against a target substring in your=
=20
example. However, if the target substring is located in the middle of the=
=20
unfixed string, how to check it? In other words, how to have the same=20
function as =E2=80=9Cfoobar ob ISSUBSTR=E2=80=9D with CAT if =E2=80=9Cfooba=
r=E2=80=9D is unfixed?

=20

For example, suppose that a lucky draw game has the rule: if anyone has a=
=20
publicKey which includes a special substring "goodluck", he/she will be=20
awarded.=20

This game can be easily implemented with OP_ISSUBSTR as follow.

- LockScript: OP_DUP goodluck OP_ISSUBSTR...

- UnlockScript: signature publicKey

How to implement it with OP_CAT?

=20

*Regards*

Weichu deng

weichudeng@stu2024.jnu.edu.cn

=20

=E5=9C=A82025=E5=B9=B43=E6=9C=8819=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89 UTC+=
8 10:28:25<Rijndael> =E5=86=99=E9=81=93=EF=BC=9A

> Stack elements in Taproot are limited to 520 bytes. The current proposal=
=20
> for re-activating OP_CAT includes this restriction: creating a string=20
> longer than 520 bytes with CAT will cause the script to fail.
>
> With either CAT or ISSUBSTR, you can either commit to the substrings or=
=20
> provide them at spend-time as witness data (and allow them to be unfixed =
in=20
> the script).
>
> Fixed: FOOBAR BAR ISSUBSTR =3D=3D FOOBAR FOO BAR CAT EQ
> Variable: [witness: FOOBAR] BAR ISSUBSTR =3D=3D [witness: FOOBAR FOO] BAR=
 CAT=20
> EQ
>
>
> rijndael=20
>
>
> On Mar 18, 2025, at 11:32=E2=80=AFAM, weichu deng <weich...@stu2024.jnu.e=
du.cn>=20
> wrote:
>
> 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 deterministi=
c=20
> one.
> Another case is when the substring in question is located in the middle o=
f=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. Additionall=
y,=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
>
> weich...@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 UT=
C+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
> > Dear fellow Bitcoin developers,
> >=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
> > *Abstract*
> >=20
> > This BIP introduces two string opcodes, OP_ISSUBSTR and OP_ISSUBSTRVERI=
FY
> =20
> > (similar to the relationship between OP_EQUAL and OP_EQUALVERIFY), to=
=20
> > determine whether one string is a substring of another. As these opcode=
s=20
> do=20
> > not alter any blockchain state, they are secure.
>
> Bitcoin scripts are about validation. Not computation.
>
> This means that substring search and concatenation are equivalent. For
> every script that validates a substring search, you can instead
> concatenate the substring with the rest of the string, and validate
> equality instead.
>
> Basically speaking:
>
> foobar foo IsSubStr
>
> is equivalent to:
>
> foobar foo bar Cat Equal
>
> A real-world example would be more complex. But I hope that illustrates
> my point sufficiently.
>
> --=20
> https://petertodd.org 'peter'[:-1]@petertodd.org
>
>
> --=20
> You received this message because you are subscribed to the Google Groups=
=20
> "Bitcoin Development Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send an=
=20
> email to bitcoindev+...@googlegroups.com.
> To view this discussion visit=20
> https://groups.google.com/d/msgid/bitcoindev/678d40e3-3e22-4d55-82c0-b25c=
cafb87ecn%40googlegroups.com=20
> <https://groups.google.com/d/msgid/bitcoindev/678d40e3-3e22-4d55-82c0-b25=
ccafb87ecn%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>
>
>

--=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/=
8c823e50-197e-479c-8651-9e0407a4168en%40googlegroups.com.

------=_Part_2435_1135241746.1742375276685
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<p><span lang=3D"EN-US">Hi Rijndael,</span></p>

<p><span lang=3D"EN-US">=C2=A0</span></p>

<p><span lang=3D"EN-US">Thanks for your example </span></p>

<p style=3D"text-indent: 12pt;"><span lang=3D"EN-US">[witness: foobar =C2=
=A0foo] bar CAT
EQ</span></p>

<p><span lang=3D"EN-US">=C2=A0</span></p>

<p><span lang=3D"EN-US">Yes, the unfixed string can be checked
against a target substring in your example. However, if the target substrin=
g is
located in the middle of the unfixed string, how to check it? In other word=
s,
how to have the same function as =E2=80=9Cfoobar ob ISSUBSTR=E2=80=9D with =
CAT if =E2=80=9Cfoobar=E2=80=9D is
unfixed?</span></p>

<p><span lang=3D"EN-US">=C2=A0</span></p>

<p><span lang=3D"EN-US">For example, suppose that a lucky draw game
has the rule: if anyone has a publicKey which includes a special substring
"goodluck", he/she will be awarded. </span></p>

<p><span lang=3D"EN-US">This game can be easily implemented with
OP_ISSUBSTR as follow.</span></p>

<p style=3D"text-indent: 48pt;"><span lang=3D"EN-US">- LockScript: OP_DUP g=
oodluck OP_ISSUBSTR...</span></p>

<p style=3D"text-indent: 48pt;"><span lang=3D"EN-US">- UnlockScript: signat=
ure publicKey</span></p>

<p><span lang=3D"EN-US">How to implement it with OP_CAT?<b></b></span></p>

<p><b><span lang=3D"EN-US">=C2=A0</span></b></p>

<p><b><span lang=3D"EN-US">Regards</span></b><span lang=3D"EN-US"></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>

<p><span lang=3D"EN-US">=C2=A0</span></p><br /><div class=3D"gmail_quote"><=
div dir=3D"auto" class=3D"gmail_attr">=E5=9C=A82025=E5=B9=B43=E6=9C=8819=E6=
=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89 UTC+8 10:28:25&lt;Rijndael> =E5=86=99=E9=
=81=93=EF=BC=9A<br/></div><blockquote class=3D"gmail_quote" style=3D"margin=
: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex=
;"><div dir=3D"ltr"><div dir=3D"auto" style=3D"line-break:after-white-space=
">Stack elements in Taproot are limited to 520 bytes. The current proposal =
for re-activating OP_CAT includes this restriction: creating a string longe=
r than 520 bytes with CAT will cause the script to fail.<div><br></div><div=
>With either CAT or ISSUBSTR, you can either commit to the substrings or pr=
ovide them at spend-time as witness data (and allow them to be unfixed in t=
he script).</div><div><br></div><div>Fixed: FOOBAR BAR ISSUBSTR =3D=3D FOOB=
AR FOO BAR CAT EQ</div><div>Variable: [witness: FOOBAR] BAR ISSUBSTR =3D=3D=
 [witness: FOOBAR FOO] BAR CAT EQ</div><div><br></div><div><br></div><div>r=
ijndael=C2=A0</div><div><br><div style=3D"direction:ltr"><br><blockquote ty=
pe=3D"cite"></blockquote></div></div></div></div><div dir=3D"ltr"><div dir=
=3D"auto" style=3D"line-break:after-white-space"><div><div style=3D"directi=
on:ltr"><blockquote type=3D"cite"><div>On Mar 18, 2025, at 11:32=E2=80=AFAM=
, weichu deng &lt;<a href data-email-masked rel=3D"nofollow">weich...@stu20=
24.jnu.edu.cn</a>&gt; wrote:</div><br></blockquote></div></div></div></div>=
<div dir=3D"ltr"><div dir=3D"auto" style=3D"line-break:after-white-space"><=
div><div style=3D"direction:ltr"><blockquote type=3D"cite"><div><div style=
=3D"font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:4=
00;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wra=
p;word-spacing:0px;text-decoration:none;padding:0px;border:0px;font-variant=
-numeric:inherit;font-variant-east-asian:inherit;font-variant-alternates:in=
herit;font-stretch:inherit;line-height:24px;font-family:-apple-system,Blink=
MacSystemFont,&quot;Helvetica Neue&quot;,Helvetica,&quot;Segoe UI&quot;,Ari=
al,Roboto,&quot;PingFang SC&quot;,MIUI,&quot;Hiragino Sans GB&quot;,&quot;M=
icrosoft YaHei&quot;,sans-serif;font-size-adjust:inherit;font-kerning:inher=
it;font-feature-settings:inherit;vertical-align:baseline;margin:0px 0px 0.8=
59em;letter-spacing:0.25px;max-width:100%;overflow:auto hidden;color:rgb(6,=
6,7);word-break:break-word">Hi, <span style=3D"color:rgb(32,33,36);font-fam=
ily:Roboto,Arial,sans-serif">Peter Todd</span></div><div style=3D"font-size=
:12px;font-style:normal;font-variant-caps:normal;font-weight:400;text-align=
:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacin=
g:0px;text-decoration:none;padding:0px;border:0px;font-variant-numeric:inhe=
rit;font-variant-east-asian:inherit;font-variant-alternates:inherit;font-st=
retch:inherit;line-height:24px;font-family:-apple-system,BlinkMacSystemFont=
,&quot;Helvetica Neue&quot;,Helvetica,&quot;Segoe UI&quot;,Arial,Roboto,&qu=
ot;PingFang SC&quot;,MIUI,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHe=
i&quot;,sans-serif;font-size-adjust:inherit;font-kerning:inherit;font-featu=
re-settings:inherit;vertical-align:baseline;margin:0px 0px 0.859em;letter-s=
pacing:0.25px;max-width:100%;overflow:auto hidden;color:rgb(6,6,7);word-bre=
ak:break-word">Thanks for your feedback. I agree that &quot;Bitcoin scripts=
 are about validation. Not computation.&quot;</div><div style=3D"font-size:=
12px;font-style:normal;font-variant-caps:normal;font-weight:400;text-align:=
start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing=
:0px;text-decoration:none;padding:0px;border:0px;font-variant-numeric:inher=
it;font-variant-east-asian:inherit;font-variant-alternates:inherit;font-str=
etch:inherit;line-height:24px;font-family:-apple-system,BlinkMacSystemFont,=
&quot;Helvetica Neue&quot;,Helvetica,&quot;Segoe UI&quot;,Arial,Roboto,&quo=
t;PingFang SC&quot;,MIUI,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei=
&quot;,sans-serif;font-size-adjust:inherit;font-kerning:inherit;font-featur=
e-settings:inherit;vertical-align:baseline;margin:0px 0px 0.859em;letter-sp=
acing:0.25px;max-width:100%;overflow:auto hidden;color:rgb(6,6,7);word-brea=
k:break-word">String search and concatenation are equivalent in some cases,=
 such as in the example you provided.</div><div style=3D"font-size:12px;fon=
t-style:normal;font-variant-caps:normal;font-weight:400;text-align:start;te=
xt-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;tex=
t-decoration:none;padding:0px;border:0px;font-variant-numeric:inherit;font-=
variant-east-asian:inherit;font-variant-alternates:inherit;font-stretch:inh=
erit;line-height:24px;font-family:-apple-system,BlinkMacSystemFont,&quot;He=
lvetica Neue&quot;,Helvetica,&quot;Segoe UI&quot;,Arial,Roboto,&quot;PingFa=
ng SC&quot;,MIUI,&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei&quot;,s=
ans-serif;font-size-adjust:inherit;font-kerning:inherit;font-feature-settin=
gs:inherit;vertical-align:baseline;margin:0px 0px 0.859em;letter-spacing:0.=
25px;max-width:100%;overflow:auto hidden;color:rgb(6,6,7);word-break:break-=
word">However, it is still necessary to introduce the OP_ISSUBSTR operation=
 separately.</div><div style=3D"font-size:12px;font-style:normal;font-varia=
nt-caps:normal;font-weight:400;text-align:start;text-indent:0px;text-transf=
orm:none;white-space:pre-wrap;word-spacing:0px;text-decoration:none;padding=
:0px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inheri=
t;font-variant-alternates:inherit;font-stretch:inherit;line-height:24px;fon=
t-family:-apple-system,BlinkMacSystemFont,&quot;Helvetica Neue&quot;,Helvet=
ica,&quot;Segoe UI&quot;,Arial,Roboto,&quot;PingFang SC&quot;,MIUI,&quot;Hi=
ragino Sans GB&quot;,&quot;Microsoft YaHei&quot;,sans-serif;font-size-adjus=
t:inherit;font-kerning:inherit;font-feature-settings:inherit;vertical-align=
:baseline;margin:0px 0px 0.859em;letter-spacing:0.25px;max-width:100%;overf=
low:auto hidden;color:rgb(6,6,7);word-break:break-word">One example is conv=
erting a non-deterministic signature to a deterministic one.</div><div styl=
e=3D"font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:=
400;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wr=
ap;word-spacing:0px;text-decoration:none;padding:0px;border:0px;font-varian=
t-numeric:inherit;font-variant-east-asian:inherit;font-variant-alternates:i=
nherit;font-stretch:inherit;line-height:24px;font-family:-apple-system,Blin=
kMacSystemFont,&quot;Helvetica Neue&quot;,Helvetica,&quot;Segoe UI&quot;,Ar=
ial,Roboto,&quot;PingFang SC&quot;,MIUI,&quot;Hiragino Sans GB&quot;,&quot;=
Microsoft YaHei&quot;,sans-serif;font-size-adjust:inherit;font-kerning:inhe=
rit;font-feature-settings:inherit;vertical-align:baseline;margin:0px 0px 0.=
859em;letter-spacing:0.25px;max-width:100%;overflow:auto hidden;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"font-si=
ze:12px;font-style:normal;font-variant-caps:normal;font-weight:400;text-ali=
gn:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spac=
ing:0px;text-decoration:none;padding:0px;border:0px;font-variant-numeric:in=
herit;font-variant-east-asian:inherit;font-variant-alternates:inherit;font-=
stretch:inherit;line-height:24px;font-family:-apple-system,BlinkMacSystemFo=
nt,&quot;Helvetica Neue&quot;,Helvetica,&quot;Segoe UI&quot;,Arial,Roboto,&=
quot;PingFang SC&quot;,MIUI,&quot;Hiragino Sans GB&quot;,&quot;Microsoft Ya=
Hei&quot;,sans-serif;font-size-adjust:inherit;font-kerning:inherit;font-fea=
ture-settings:inherit;vertical-align:baseline;margin:0px 0px 0.859em;letter=
-spacing:0.25px;max-width:100%;overflow:auto hidden;color:rgb(6,6,7);word-b=
reak:break-word">CAT cannot replace ISSUBSTR for the following reasons:</di=
v><ol start=3D"1" style=3D"font-size:12px;font-style:normal;font-variant-ca=
ps:normal;font-weight:400;text-align:start;text-indent:0px;text-transform:n=
one;white-space:normal;word-spacing:0px;text-decoration:none;padding:0px 0p=
x 0px 2em;border:0px;font-variant-numeric:inherit;font-variant-east-asian:i=
nherit;font-variant-alternates:inherit;font-stretch:inherit;line-height:inh=
erit;font-family:-apple-system,BlinkMacSystemFont,&quot;Helvetica Neue&quot=
;,Helvetica,&quot;Segoe UI&quot;,Arial,Roboto,&quot;PingFang SC&quot;,MIUI,=
&quot;Hiragino Sans GB&quot;,&quot;Microsoft YaHei&quot;,sans-serif;font-si=
ze-adjust:inherit;font-kerning:inherit;font-feature-settings:inherit;vertic=
al-align:baseline;list-style-position:initial;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-ligatures:inherit;font-variant-caps:in=
herit;font-variant-alternates:inherit;font-variant-numeric:inherit;font-var=
iant-east-asian:inherit;font-weight:inherit;font-stretch:inherit;font-size:=
inherit;line-height:24px;font-family:inherit;font-size-adjust:inherit;font-=
kerning:inherit;font-feature-settings:inherit;vertical-align:baseline;lette=
r-spacing:0.25px"><div style=3D"padding:0px;border:0px;font-style:inherit;f=
ont-variant-ligatures:inherit;font-variant-caps:inherit;font-variant-altern=
ates:inherit;font-variant-numeric:inherit;font-variant-east-asian:inherit;f=
ont-weight:inherit;font-stretch:inherit;line-height:24px;font-family:inheri=
t;font-size-adjust:inherit;font-kerning:inherit;font-feature-settings:inher=
it;vertical-align:baseline;margin:0px;max-width:100%;overflow:visible;word-=
break:break-word">The security of CAT is still controversial. It can easily=
 generate overly long strings, potentially causing a stack overflow. Additi=
onally, whether OP_CAT will be restored is still under discussion.</div></l=
i><li style=3D"margin:0px;padding:0px;border:0px;font-style:inherit;font-va=
riant-ligatures:inherit;font-variant-caps:inherit;font-variant-alternates:i=
nherit;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-we=
ight:inherit;font-stretch:inherit;font-size:inherit;line-height:24px;font-f=
amily:inherit;font-size-adjust:inherit;font-kerning:inherit;font-feature-se=
ttings:inherit;vertical-align:baseline;letter-spacing:0.25px"><div style=3D=
"padding:0px;border:0px;font-style:inherit;font-variant-ligatures:inherit;f=
ont-variant-caps:inherit;font-variant-alternates:inherit;font-variant-numer=
ic:inherit;font-variant-east-asian:inherit;font-weight:inherit;font-stretch=
:inherit;line-height:24px;font-family:inherit;font-size-adjust:inherit;font=
-kerning:inherit;font-feature-settings:inherit;vertical-align:baseline;marg=
in:0px;max-width:100%;overflow:visible;word-break:break-word">The other sub=
string (bar) must be known in advance.</div></li></ol><div style=3D"font-fa=
mily:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;fo=
nt-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-t=
ransform:none;white-space:normal;word-spacing:0px;text-decoration:none"><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"><br><=
/span></font></div><div style=3D"font-family:Helvetica;font-size:12px;font-=
style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal=
;text-align:start;text-indent:0px;text-transform:none;white-space:normal;wo=
rd-spacing:0px;text-decoration:none"><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 data-email-masked rel=3D"nofollow">weich...@stu2024.jnu.edu.cn=
</a></span></p></div><div style=3D"font-family:Helvetica;font-size:12px;fon=
t-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:norm=
al;text-align:start;text-indent:0px;text-transform:none;white-space:normal;=
word-spacing:0px;text-decoration:none"><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&lt;Pe=
ter Todd&gt; =E5=86=99=E9=81=93=EF=BC=9A<br></div><blockquote style=3D"marg=
in:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-l=
eft-color:rgb(204,204,204);padding-left:1ex">On Mon, Mar 17, 2025 at 09:14:=
05AM -0700, weichu deng wrote:<br>&gt;<span>=C2=A0</span><br>&gt;<span>=C2=
=A0</span><br>&gt; Dear fellow Bitcoin developers,<br>&gt;<span>=C2=A0</spa=
n><br>&gt;<span>=C2=A0</span><br>&gt;<span>=C2=A0</span><br>&gt; I am pleas=
ed to present a new BIP proposal. This proposal introduces a new<span>=C2=
=A0</span><br>&gt; opcode for Bitcoin scripts: OP_ISSUBSTR.<br>&gt;<span>=
=C2=A0</span><br>&gt;<span>=C2=A0</span><br>&gt; *Abstract*<br>&gt;<span>=
=C2=A0</span><br>&gt; This BIP introduces two string opcodes, OP_ISSUBSTR a=
nd OP_ISSUBSTRVERIFY<span>=C2=A0</span><br>&gt; (similar to the relationshi=
p between OP_EQUAL and OP_EQUALVERIFY), to<span>=C2=A0</span><br>&gt; deter=
mine whether one string is a substring of another. As these opcodes do<span=
>=C2=A0</span><br>&gt; not alter any blockchain state, they are secure.<br>=
<br>Bitcoin scripts are about validation. Not computation.<br><br>This mean=
s that substring search and concatenation are equivalent. For<br>every scri=
pt that validates a substring search, you can instead<br>concatenate the su=
bstring 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 c=
omplex. But I hope that illustrates<br>my point sufficiently.<br><br>--<spa=
n>=C2=A0</span><br><a href=3D"https://petertodd.org/" rel=3D"nofollow" targ=
et=3D"_blank" data-saferedirecturl=3D"https://www.google.com/url?hl=3Dzh-CN=
&amp;q=3Dhttps://petertodd.org/&amp;source=3Dgmail&amp;ust=3D17424615095790=
00&amp;usg=3DAOvVaw3nmXfOkH6THUCD0y0ysiv6">https://petertodd.org</a><span>=
=C2=A0</span>&#39;peter&#39;[:-1]@<a href=3D"http://petertodd.org/" rel=3D"=
nofollow" target=3D"_blank" data-saferedirecturl=3D"https://www.google.com/=
url?hl=3Dzh-CN&amp;q=3Dhttp://petertodd.org/&amp;source=3Dgmail&amp;ust=3D1=
742461509579000&amp;usg=3DAOvVaw1KKF8hKgJW2bEOfwEuZimQ">petertodd.org</a><b=
r></blockquote></div><div style=3D"font-family:Helvetica;font-size:12px;fon=
t-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:norm=
al;text-align:start;text-indent:0px;text-transform:none;white-space:normal;=
word-spacing:0px;text-decoration:none"><br></div></div></blockquote></div><=
/div></div></div><div dir=3D"ltr"><div dir=3D"auto" style=3D"line-break:aft=
er-white-space"><div><div style=3D"direction:ltr"><blockquote type=3D"cite"=
><div><span style=3D"font-family:Helvetica;font-size:12px;font-style:normal=
;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:=
start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0=
px;text-decoration:none;float:none;display:inline!important">--<span>=C2=A0=
</span></span><br style=3D"font-family:Helvetica;font-size:12px;font-style:=
normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-=
align:start;text-indent:0px;text-transform:none;white-space:normal;word-spa=
cing:0px;text-decoration:none"><span style=3D"font-family:Helvetica;font-si=
ze:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-s=
pacing:normal;text-align:start;text-indent:0px;text-transform:none;white-sp=
ace:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!=
important">You received this message because you are subscribed to the Goog=
le Groups &quot;Bitcoin Development Mailing List&quot; group.</span><br sty=
le=3D"font-family:Helvetica;font-size:12px;font-style:normal;font-variant-c=
aps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-inde=
nt:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decorat=
ion:none"><span style=3D"font-family:Helvetica;font-size:12px;font-style:no=
rmal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-al=
ign:start;text-indent:0px;text-transform:none;white-space:normal;word-spaci=
ng:0px;text-decoration:none;float:none;display:inline!important">To unsubsc=
ribe from this group and stop receiving emails from it, send an email to<sp=
an>=C2=A0</span></span><a href style=3D"font-family:Helvetica;font-size:12p=
x;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing=
:normal;text-align:start;text-indent:0px;text-transform:none;white-space:no=
rmal;word-spacing:0px" data-email-masked rel=3D"nofollow">bitcoindev+...@go=
oglegroups.com</a><span style=3D"font-family:Helvetica;font-size:12px;font-=
style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal=
;text-align:start;text-indent:0px;text-transform:none;white-space:normal;wo=
rd-spacing:0px;text-decoration:none;float:none;display:inline!important">.<=
/span><br style=3D"font-family:Helvetica;font-size:12px;font-style:normal;f=
ont-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:st=
art;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px=
;text-decoration:none"><span style=3D"font-family:Helvetica;font-size:12px;=
font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:n=
ormal;text-align:start;text-indent:0px;text-transform:none;white-space:norm=
al;word-spacing:0px;text-decoration:none;float:none;display:inline!importan=
t">To view this discussion visit<span>=C2=A0</span></span><a href=3D"https:=
//groups.google.com/d/msgid/bitcoindev/678d40e3-3e22-4d55-82c0-b25ccafb87ec=
n%40googlegroups.com?utm_medium=3Demail&amp;utm_source=3Dfooter" style=3D"f=
ont-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:nor=
mal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;=
text-transform:none;white-space:normal;word-spacing:0px" target=3D"_blank" =
rel=3D"nofollow" data-saferedirecturl=3D"https://www.google.com/url?hl=3Dzh=
-CN&amp;q=3Dhttps://groups.google.com/d/msgid/bitcoindev/678d40e3-3e22-4d55=
-82c0-b25ccafb87ecn%2540googlegroups.com?utm_medium%3Demail%26utm_source%3D=
footer&amp;source=3Dgmail&amp;ust=3D1742461509579000&amp;usg=3DAOvVaw3QHHVl=
mjSvOSRsI9Gpmlli">https://groups.google.com/d/msgid/bitcoindev/678d40e3-3e2=
2-4d55-82c0-b25ccafb87ecn%40googlegroups.com</a><span style=3D"font-family:=
Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-we=
ight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transf=
orm:none;white-space:normal;word-spacing:0px;text-decoration:none;float:non=
e;display:inline!important">.</span></div></blockquote></div><br></div></di=
v></div>
</blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Bitcoin Development Mailing List&quot; 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/8c823e50-197e-479c-8651-9e0407a4168en%40googlegroups.com?utm_med=
ium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/bitcoind=
ev/8c823e50-197e-479c-8651-9e0407a4168en%40googlegroups.com</a>.<br />

------=_Part_2435_1135241746.1742375276685--

------=_Part_2434_1529323214.1742375276685--