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
|
Delivery-date: Tue, 01 Apr 2025 15:38:38 -0700
Received: from mail-oo1-f55.google.com ([209.85.161.55])
by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
(Exim 4.94.2)
(envelope-from <bitcoindev+bncBDZPZFXW2IMRBY6VWG7QMGQEQ7HKREI@googlegroups.com>)
id 1tzkFh-0000nH-5D
for bitcoindev@gnusha.org; Tue, 01 Apr 2025 15:38:38 -0700
Received: by mail-oo1-f55.google.com with SMTP id 006d021491bc7-603fd09171bsf321327eaf.1
for <bitcoindev@gnusha.org>; Tue, 01 Apr 2025 15:38:37 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1743547111; cv=pass;
d=google.com; s=arc-20240605;
b=ifLSYKyV+ZmQl/VTBFaFhkktYXDcL/VcMTQ8Thm5+MHAxx3tmk1lMZpDY+Tu6/cTgm
TDL3frG7NYzDgM9/tl5kolxwKsA0UArv7QHVR0sVlFC4Rl/u5/VvXc3e5VYNANH8k1s+
PzoaB+OV9dJ/Tm7l7sNMQzAjl8od10n2A9XqYXChfT+8ALrdKap1fFwFUGDvFgWHwiJM
mEJHp1Jk+/owYbRF71YY0wCFQbqBuEDucHk/Bh6nQ+2W9qXcqG6VqF8L3nLH8fHLedIx
Cuij8TVHQQQskLDE1kDw6PiQyy7j16NC+MGmPQcZOD+XDovc0yasUrK8aneb+8yhMtrf
uQpA==
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:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:sender:dkim-signature
:dkim-signature;
bh=PFjfduBnjzsQkzi2DI5PY5AK3iMzVsUFQwg9ojp2GPA=;
fh=WmXfssJedKHy9Vzrl/7g1B6T6W4WapF59YdUBaRh61k=;
b=OH/yCEprhVOCD3SNFTWlYahUWbjJnAwqiTXEyz/QCBLl0xlfyQ4ByQJw83YJooSN7r
oxNOClVaOeFy8bNAnOXd388CS/y945RN7BAnbmw4ppuqGyP4Nmes7kyBW94jl8U+lcyM
+OzWoKIqB/4VmfQ6WJ+IvgA6aRAeC85ziJpC5P/iXUtH8tO3vtUjsUngBiXGaG7vBPoB
nig3EHyvuVwawZLPLG84WA9kf4nePjWMTYAJRorkV9SZTeUbS4FKG/Y5RZnP0jfr+QMd
GBB27ea3LMOJMJpvP/u5RXXOw7DrTcOV2Xx/psZgFsMYL8CRYJO/aUg9zjTULfPeobSu
hNhQ==;
darn=gnusha.org
ARC-Authentication-Results: i=2; gmr-mx.google.com;
dkim=pass header.i=@gmail.com header.s=20230601 header.b="fl5PD/ud";
spf=pass (google.com: domain of martin.habovstiak@gmail.com designates 2607:f8b0:4864:20::736 as permitted sender) smtp.mailfrom=martin.habovstiak@gmail.com;
dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
dara=pass header.i=@googlegroups.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlegroups.com; s=20230601; t=1743547111; x=1744151911; 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:cc:to:subject:message-id:date:from:in-reply-to
:references:mime-version:sender:from:to:cc:subject:date:message-id
:reply-to;
bh=PFjfduBnjzsQkzi2DI5PY5AK3iMzVsUFQwg9ojp2GPA=;
b=f74r+UbNfw/kaXInHHKkM70b7mIEsBNbf0iIXRqM/RzrLgivstGCgbEIsgvIL33M2d
9m3Hb0jiKwTDCQzAHzRloKtdxMvLBgKN8TRERq0NcMmX7abOxxmvTL6komNiXgkFCoGN
6vVDU92MQNbiX81niYaj9I+AIl1U2XF2VXpNyPmxjAurxHH4qqa4GpYOC1hqVeMUCjzd
td9p2I1I1R8rTz77dFdFmqU222SMEcsdaVExFexre8JS8EO4FBjZ1UpxOlvwUtB1kf7K
CekZo0CxrYJawB8AulOv/OD4wOJaNsXuC3mvee8DCZWxqXDGXjYx+eaJ9zFolaSYTEmg
KIGg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1743547111; x=1744151911; 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:cc:to:subject:message-id:date:from:in-reply-to
:references:mime-version:from:to:cc:subject:date:message-id:reply-to;
bh=PFjfduBnjzsQkzi2DI5PY5AK3iMzVsUFQwg9ojp2GPA=;
b=h69kNIBP914h3Q/a4rs3KzbNiHGDCG4ryS5FOWVXRijBEjuAtug0H/ic1z+Jy72h2n
4nMZsiAIlq6DFVqa4ABQU3tIjkxrvjEquapbvRWZYT08rnzrcxeQx0SBwCDhdXqBIxhE
4qkYcz5Ji/GqpECfTk+8oBv22OdeeKTb17Vo1IGWAYkgcUPaEdq3ZTcjQKoGPqGVdnp7
qlTpfy50UEJ3TgaoRfOFjgbs9ZrN//ORTDIgYulOMiHP0HQ9QfJ9V3yJIJI33NS/PVRF
hnx2Me6iZBBTNYSDGDkPZ9Vp1UPQPuyfI165Dypug3/msoe3WKQPG7aQRFNBZTzmm/iP
c3dA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1743547111; x=1744151911;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:x-original-authentication-results
:x-original-sender:cc:to:subject:message-id:date:from:in-reply-to
:references:mime-version:x-beenthere:x-gm-message-state:sender:from
:to:cc:subject:date:message-id:reply-to;
bh=PFjfduBnjzsQkzi2DI5PY5AK3iMzVsUFQwg9ojp2GPA=;
b=oErK5kz6rCA26hRaYdH9/bSnEqPPlTDNAjd8X8b2pnOt3uYkvYjh7r/jT+aAr0pwjP
CYPk6O1DSdRL1ecz5/JqFqQWo7Giyj91Yu0UVNPXJtcGTVBMk6XtoBtZYmwAd6nr49dM
dXxvcUqJQp8W4iqVi4JlsimiyerJuAlLnoYTs8yJE5kA6Zh7BsKxRdAFY07N9oFpHrku
5nZTSpnT9rIOv8X25wkE4fSWCvjHuLHrdU2GXOIOhQWcK6ZchlZtT9APqhWX4iz8PiQA
VqjqvmuFZzqq3dobS1mwrhzg2FfRYCUJQYdFgkib2XnTiA2lXAWWcZIaJ/pC78nA+IFA
lFvw==
Sender: bitcoindev@googlegroups.com
X-Forwarded-Encrypted: i=2; AJvYcCWqrTP+XKcBgWnuAJH5Zw2azyLXk/QZOZOF1XrBhUjAHnMq0UmgkpolSnqT+lt4rkCXfytJNyoJxEJL@gnusha.org
X-Gm-Message-State: AOJu0YyZekHJirUbadFCHYMHHacNgDtybI9hsNunsWZUQvyvTXqeQ2F2
9dU4kOuWFi4haOBVIK+VDMo7nM6YDA9IHxajSdWOJ0CUJuq7VrS6
X-Google-Smtp-Source: AGHT+IHYNI0EWh0lIAoM8JXTvRLg30APZrwgr8eDQT2Umej4wgik6dAGeUkssN39h8tk1451iORgyA==
X-Received: by 2002:a05:6820:2107:b0:603:f777:9801 with SMTP id 006d021491bc7-603f7779c95mr2088125eaf.3.1743547111003;
Tue, 01 Apr 2025 15:38:31 -0700 (PDT)
X-BeenThere: bitcoindev@googlegroups.com; h=ARLLPALZ66IIHkeinGsjmtfFzN9sYIB1V1+5ulGR8BYyeJrZ9A==
Received: by 2002:a4a:a641:0:b0:603:be8f:a31e with SMTP id 006d021491bc7-603be8fa5c8ls667467eaf.1.-pod-prod-08-us;
Tue, 01 Apr 2025 15:38:27 -0700 (PDT)
X-Forwarded-Encrypted: i=2; AJvYcCUKl9pHxZZYLZmu8hCKaayyYPITelChzTXj/IT4vUpA86/P2ARJXO6a+Az4BFnmUXxvmPWQRRS0J0ar@googlegroups.com
X-Received: by 2002:a05:6808:2019:b0:3fe:ab15:5e93 with SMTP id 5614622812f47-3ff0f524c93mr9182358b6e.11.1743547107585;
Tue, 01 Apr 2025 15:38:27 -0700 (PDT)
Received: by 2002:a05:6808:985:b0:3fa:6f09:b173 with SMTP id 5614622812f47-3feefbac77emsb6e;
Tue, 1 Apr 2025 08:36:05 -0700 (PDT)
X-Forwarded-Encrypted: i=2; AJvYcCXjxoCibe7zW6VnL+ja4KgqTpbKCw7G82en5Ygdx8E5kwIoBoLaRiIxza+sidqGt52GML5u8AowSfh9@googlegroups.com
X-Received: by 2002:a17:90b:2e07:b0:2ee:53b3:3f1c with SMTP id 98e67ed59e1d1-30531f7c07cmr19794566a91.5.1743521764783;
Tue, 01 Apr 2025 08:36:04 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1743521764; cv=none;
d=google.com; s=arc-20240605;
b=NITLkxzZva/ZZNMPhpL7chQEXMhHFxc5gZJB2yS2KAFrq+5ALcsyO0CZs+5W3p+nb1
EnT0p8zV/Wwg6C8BEhcQa/9aQ3uZjQ4EM3xY10LnKqkd/ZcHVKyh3m46xL77Ty5fzrFy
qMn6j/aQhK07E2nRfyxnsb9vyOC4akia/x/On4SPssEodjeN04uJ3g0d/6GRfbxUNS4A
nJ6JnIQLz3M6ticGF/zlWqrP9MJrtLF4HHQypD9AQccK33snIZaje0daSW52JowFuHyS
rcQsF9vb0jxWiONr95V5Wt2YD3v4npiQJimEoCGN83maoGb0CMm+3lQEk76H5QEY/sXo
Z60w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:dkim-signature;
bh=r2K2TgMkVJjTLkR4tG9GmvR/WYaTX9V++QzBCL7n0PM=;
fh=UslS9DHPkWd0noc2pTWy5Ft6VFWJ5hH0DY6AiDFuLK8=;
b=gQAflzQw50Gv1svmOUE3AAt6oWuXRwbcsmGYXQb/BEhKFHsZ+nkN8CdutqOvY7rwzg
Qkr3QUR7ec59oPkV65WCXXleNWIbhec1RGvzYDAgTVYy5k44qWg3cKP7oYbsynJoZbHT
eDLCzZydry0koPOc9tHSBt2Vh6/pB2Oe6YMXiiwfHoIw0jOHoVbfATHtv+H9OoLONUPC
1YprVF/dJzEIz7RSFUi05UsGlrrBQfojD6k0rQPWDfouE4AKFN0QlNGWO9r72YjAakBo
k3nuXznLRe4rg9OBz3Y3gOa1YdHN9ZMUf7P0/s8XjI1LJJK5pJZlRY9jvFuaqMKu8IUV
bF9Q==;
dara=google.com
ARC-Authentication-Results: i=1; gmr-mx.google.com;
dkim=pass header.i=@gmail.com header.s=20230601 header.b="fl5PD/ud";
spf=pass (google.com: domain of martin.habovstiak@gmail.com designates 2607:f8b0:4864:20::736 as permitted sender) smtp.mailfrom=martin.habovstiak@gmail.com;
dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
dara=pass header.i=@googlegroups.com
Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com. [2607:f8b0:4864:20::736])
by gmr-mx.google.com with ESMTPS id d9443c01a7336-2291eed881fsi5283895ad.1.2025.04.01.08.36.04
for <bitcoindev@googlegroups.com>
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Tue, 01 Apr 2025 08:36:04 -0700 (PDT)
Received-SPF: pass (google.com: domain of martin.habovstiak@gmail.com designates 2607:f8b0:4864:20::736 as permitted sender) client-ip=2607:f8b0:4864:20::736;
Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-7c559b3eb0bso328406785a.1
for <bitcoindev@googlegroups.com>; Tue, 01 Apr 2025 08:36:04 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AJvYcCX+QOTXsEHXmJerV8H+y4MBW28nlYkf1GjsBKNx3+ld0sRQX5g/vNnGWELurtxNY+6XIwHqOnykQZ7+@googlegroups.com
X-Gm-Gg: ASbGncsWq/6CPiIRIdS0+BrKDal09fQIiShz+NaHw0YUSZ+d+Nz+MQlwxUYaD3HWz2B
pPIeeeuA9qlbUWOBih0smV4K+jGlwRQMJB6FwyxOVovh8IovT/wY0ghrWcKsxAteQB2Xs1QNMjA
Tao1vyR0SWUY1zd+vddJ3t9PMhiQ==
X-Received: by 2002:a05:620a:4544:b0:7c0:9f12:2b7e with SMTP id
af79cd13be357-7c6862ebcdemr1758761285a.11.1743521764058; Tue, 01 Apr 2025
08:36:04 -0700 (PDT)
MIME-Version: 1.0
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>
<8c823e50-197e-479c-8651-9e0407a4168en@googlegroups.com> <b4594133-e6e5-438b-aa56-98d6171296fan@googlegroups.com>
<e8c30db7-b509-4fbd-93ef-0bca0313003cn@googlegroups.com> <frERrHlzWhpskJw74fBQorSrXEaBP1d4XBUgM-Nkww_2ulhc7i2Lqmu2kcAlvh5fd7LzYiBmX5HNBtg7Ownbsa0KZ26ihfJjri6R01kuozA=@wuille.net>
In-Reply-To: <frERrHlzWhpskJw74fBQorSrXEaBP1d4XBUgM-Nkww_2ulhc7i2Lqmu2kcAlvh5fd7LzYiBmX5HNBtg7Ownbsa0KZ26ihfJjri6R01kuozA=@wuille.net>
From: =?UTF-8?Q?Martin_Habov=C5=A1tiak?= <martin.habovstiak@gmail.com>
Date: Tue, 1 Apr 2025 17:35:53 +0200
X-Gm-Features: AQ5f1Jonb64K8xwBCp_kuJq8yZNRre_fWTfTsBymB-tWsSBmqhpWzVEB--Uz7xU
Message-ID: <CALkkCJb1RdC646q1QrOP+yQut7EG4NLJNm3cyxW4S1=Ex1NBmQ@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?=
To: Pieter Wuille <bitcoin-dev@wuille.net>
Cc: Javier Mateos <javierpmateos@gmail.com>,
Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Content-Type: multipart/alternative; boundary="00000000000067ab4a0631b94b28"
X-Original-Sender: martin.habovstiak@gmail.com
X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass
header.i=@gmail.com header.s=20230601 header.b="fl5PD/ud"; spf=pass
(google.com: domain of martin.habovstiak@gmail.com designates
2607:f8b0:4864:20::736 as permitted sender) smtp.mailfrom=martin.habovstiak@gmail.com;
dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
dara=pass header.i=@googlegroups.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.5 (/)
--00000000000067ab4a0631b94b28
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi,
I was dismissing the proposal for the same reason you do but it just
occurred to me that substrings might be better than OP_CAT because it's
possible to make them unabusable without any arbitrary limit on item size.
The idea is to store stack elements on the heap inside struct { ref_count,
length, data[] } and put struct { pointer_to_item, position, length } on
the stack. (Rust developers may be familiar with the `bytes` crate that
does this.)
Substring operations would only duplicate the pointers with adjusted
position and length so there's no way to blow up the stack using them.
Of course there's an exception if OP_SHA256 is used on a shorter slice but
the same is true today - you can already write OP_ZERO OP_SHA256 OP_DUP
OP_DUP...
Funnily, this can be used to optimize OP_DUP as well which would now add
constant amount of memory, so the "exploit" above would need to use two
bytes per every large object.
Anyway, while I would personally prefer not having arbitrary limits on item
sizes, since the limit is already there, it might not matter. I guess
something worth considering if any other future soft fork somehow enables
larger items.
Have a nice day!
Martin
D=C5=88a ut 1. 4. 2025, 16:49 Pieter Wuille <bitcoin-dev@wuille.net> nap=C3=
=ADsal(a):
> On Monday, March 31st, 2025 at 4:41 PM, Javier Mateos <
> javierpmateos@gmail.com> wrote:
>
> The solution of splitting the string and using OP_CAT only works if the
> exact position of the substring is known. How would a case be handled whe=
re
> the substring could be in any position
>
>
> Whoever produces the signature/witness for spending the coin always knows
> the position already, so the script can always be modified to instead tak=
e
> that position as an additional input.
>
> This is a general principle: the point of scripts is verifying provided
> information, not computing it. As another example, this means that there =
is
> no need for a division or square root opcode if one has a multiplication
> opcode.
>
> --
> Pieter
>
> --
> 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/frERrHlzWhpskJw74fBQorSrXEaB=
P1d4XBUgM-Nkww_2ulhc7i2Lqmu2kcAlvh5fd7LzYiBmX5HNBtg7Ownbsa0KZ26ihfJjri6R01k=
uozA%3D%40wuille.net
> <https://groups.google.com/d/msgid/bitcoindev/frERrHlzWhpskJw74fBQorSrXEa=
BP1d4XBUgM-Nkww_2ulhc7i2Lqmu2kcAlvh5fd7LzYiBmX5HNBtg7Ownbsa0KZ26ihfJjri6R01=
kuozA%3D%40wuille.net?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/=
CALkkCJb1RdC646q1QrOP%2ByQut7EG4NLJNm3cyxW4S1%3DEx1NBmQ%40mail.gmail.com.
--00000000000067ab4a0631b94b28
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto">Hi,<div dir=3D"auto"><br></div><div dir=3D"auto">I was di=
smissing the proposal for the same reason you do but it just occurred to me=
that substrings might be better than OP_CAT because it's possible to m=
ake them unabusable without any arbitrary limit on item size.</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">The idea is to store stack elements o=
n the heap inside struct { ref_count, length, data[] } and put struct { poi=
nter_to_item, position, length } on the stack. (Rust developers may be fami=
liar with the `bytes` crate that does this.)</div><div dir=3D"auto">Substri=
ng operations would only duplicate the pointers with adjusted position and =
length so there's no way to blow up the stack using them.</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">Of course there's an exception if=
OP_SHA256 is used on a shorter slice but the same is true today - you can =
already write OP_ZERO OP_SHA256 OP_DUP OP_DUP...</div><div dir=3D"auto"><br=
></div><div dir=3D"auto">Funnily, this can be used to optimize OP_DUP as we=
ll which would now add constant amount of memory, so the "exploit"=
; above would need to use two bytes per every large object.</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">Anyway, while I would personally pref=
er not having arbitrary limits on item sizes, since the limit is already th=
ere, it might not matter. I guess something worth considering if any other =
future soft fork somehow enables larger items.</div><div dir=3D"auto"><br><=
/div><div dir=3D"auto">Have a nice day!</div><div dir=3D"auto"><br></div><d=
iv dir=3D"auto">Martin</div><br><br><div class=3D"gmail_quote gmail_quote_c=
ontainer" dir=3D"auto"><div dir=3D"ltr" class=3D"gmail_attr">D=C5=88a ut 1.=
4. 2025, 16:49 Pieter Wuille <<a href=3D"mailto:bitcoin-dev@wuille.net"=
>bitcoin-dev@wuille.net</a>> nap=C3=ADsal(a):<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div style=3D"font-family:Arial,sans-serif;font-size:14px"><d=
iv><div>
On Monday, March 31st, 2025 at 4:41 PM, Javier Mateos <<a href=
=3D"mailto:javierpmateos@gmail.com" target=3D"_blank" rel=3D"noreferrer">ja=
vierpmateos@gmail.com</a>> wrote:<br>
<blockquote type=3D"cite"><div>
The solution of splitting the string and using OP_CAT only
works if the exact position of the substring is known. How would a case
be handled where the substring could be in any position</div></blockquote>=
<div><br></div><div>Whoever
produces the signature/witness for spending the coin always knows the=20
position already, so the script can always be modified to instead take=20
that position as an additional input.</div><div><br></div><div>This is a
general principle: the point of scripts is verifying provided=20
information, not computing it. As another example, this means that there
is no need for a division or square root opcode if one has a=20
multiplication opcode.</div><div><br></div><div>-- <br></div><div>Pieter</d=
iv><br></div></div></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" target=
=3D"_blank" rel=3D"noreferrer">bitcoindev+unsubscribe@googlegroups.com</a>.=
<br>
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
bitcoindev/frERrHlzWhpskJw74fBQorSrXEaBP1d4XBUgM-Nkww_2ulhc7i2Lqmu2kcAlvh5f=
d7LzYiBmX5HNBtg7Ownbsa0KZ26ihfJjri6R01kuozA%3D%40wuille.net?utm_medium=3Dem=
ail&utm_source=3Dfooter" target=3D"_blank" rel=3D"noreferrer">https://g=
roups.google.com/d/msgid/bitcoindev/frERrHlzWhpskJw74fBQorSrXEaBP1d4XBUgM-N=
kww_2ulhc7i2Lqmu2kcAlvh5fd7LzYiBmX5HNBtg7Ownbsa0KZ26ihfJjri6R01kuozA%3D%40w=
uille.net</a>.<br><br>
</blockquote></div></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/CALkkCJb1RdC646q1QrOP%2ByQut7EG4NLJNm3cyxW4S1%3DEx1NBmQ%40mail.g=
mail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/=
d/msgid/bitcoindev/CALkkCJb1RdC646q1QrOP%2ByQut7EG4NLJNm3cyxW4S1%3DEx1NBmQ%=
40mail.gmail.com</a>.<br />
--00000000000067ab4a0631b94b28--
|