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
|
Delivery-date: Tue, 13 May 2025 02:06:27 -0700
Received: from mail-oo1-f56.google.com ([209.85.161.56])
by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
(Exim 4.94.2)
(envelope-from <bitcoindev+bncBDML5DFJWQEBBCEXRTAQMGQE6HKN2OQ@googlegroups.com>)
id 1uElak-0003p3-0A
for bitcoindev@gnusha.org; Tue, 13 May 2025 02:06:27 -0700
Received: by mail-oo1-f56.google.com with SMTP id 006d021491bc7-6044db45c83sf4136196eaf.1
for <bitcoindev@gnusha.org>; Tue, 13 May 2025 02:06:25 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1747127179; cv=pass;
d=google.com; s=arc-20240605;
b=ZeBSW0nVR+/lLl8MOyKIY5wVrBqwvBJdiadOWPwSlOGbv3M+I6QqaEDMHR00c4OdYf
Z3m1m1S4LZXKjXO9VB2XL8BOID95ZuIXJiO5/q/kodoHnIs0firNjyjtQFDpTZ7db3wj
wTnBdv4UQ82EaA3Qc1TsuZWESpRSlFnIWQoys+PFUGwTpG+S5Fo2KBTkh1PL5NHun56q
6D9S7SWpfzMNBXXd1kEdpk3cTuTxU/Vw7ej/p68ep2YoLlx9xn0sH3zbk+GtJxCRKIEX
DY50kSBbWJNyb9ypWZ1PFxN0dhfbUnpxxqCbBzjHnD1c16VxZU50MYpGk2itmovkuYCM
ghCw==
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=89n8gLPOB99VlwjlCyHbzL4P1fagX/2UtIc2wVW0Jbw=;
fh=3bI5ifkk+xFT2u474ySxpeZB/HnFx/SBxl0wmAFADeQ=;
b=TuMzJzYlU0R/nLnPlViarF8/wsQAOUt4dn9UFLHPORYsyk13RChjYLkkrMzKk26oqV
MURchQklKxno1pF9PSQ+RFUTcrxxFHkfTG1hs1LPDlHsKAJ0fg1bjWIkXtCfMmgV/O6w
Ayq+A+XiOlhaIhylPL1GG3YcBA0zbocNVTCGc2vYtghS0QryT+y/j24BDqDkDoFQblYU
WRW5C2UqONMoQn+cgzWPAemM4mOqKalPMeI1w1errt3ypoYwK/aCJg7mKRR5HlA/aVIb
6GnTjuYVS+7fhUkSCdlndL74PLu6znvnk7laGk+c4Hit85k33tAMV266RaLGYudGZbIK
oWQg==;
darn=gnusha.org
ARC-Authentication-Results: i=2; gmr-mx.google.com;
dkim=pass header.i=@gmail.com header.s=20230601 header.b=XUwYpwdQ;
spf=pass (google.com: domain of stewart.chris1234@gmail.com designates 2607:f8b0:4864:20::112f as permitted sender) smtp.mailfrom=stewart.chris1234@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=1747127179; x=1747731979; 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=89n8gLPOB99VlwjlCyHbzL4P1fagX/2UtIc2wVW0Jbw=;
b=lT1rMMTGKpGu5VV3q4Zcr48Zfb3T2RLDxszR0w/T2I3vQszb9eXQGGuoG/vrv8eN2D
u4gEY/Xc3SccCKQsSQWP82jcmUr/5NhdzZyPn13l5oEUGlbjzQUNWMgomhEpDnSqk+f2
VpltIh/wrwz+7hGhTL8++orhN//ZQjpUmbgWkbmUpZhzQGZC2g1Q0ZzYd8/8YI7uQ/U5
RkWNXbFPOdd9mTF6dcie7oxejg8GOSCydK9d14/tailAFDgJXvScSvMzh5ofS2bHoVH1
Ld4wgyk9SgCOxIzPnwvpBnQEON9/LExLMLtM2zN+uwwXZTx7tjSFSfbUEeI7tAtr07Uk
crSQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1747127179; x=1747731979; 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=89n8gLPOB99VlwjlCyHbzL4P1fagX/2UtIc2wVW0Jbw=;
b=PiY2Jn1WPAoBD6rcvGXWXVV16aXV3542J/FfGFUDAUumZGQSydEn/ulVhatgOAWErF
mYSfiDnYMWeO25S7ew05p+ptpvxjCTYvW+GQDU52XjRZLS55Tw1riXK8UQGX0G+fmwsw
McpIfoQhsV7MX3XQQvGhsVSNk84EHBHvlROHLUDZFjhz32afaIq6zAgqA+okTRmaTe1S
P835/HwZi6jE/7QsfJETmw2EN352fpLgo9tTurYcg4YVuN/Ot1Ddil+XvqXYlU2Nu8ms
mVCBG1O0nMRvvC3/DvgLhPX0p+a5fbYtw83Hqp19HzKxCmhTw1uO2bQ7X0FqBH6+6Bso
MtUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1747127179; x=1747731979;
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=89n8gLPOB99VlwjlCyHbzL4P1fagX/2UtIc2wVW0Jbw=;
b=L5Z4zoQ4tHo/CB9umBbYDTLGnUtsgeDSA+kTX9XnpNv0U8NvDFFazuqU4IkwMrRL/P
EXztonLBE0Wr6WKED3Z2oW615H71WHDSZ4bCPrGj5ng8mUvH7CYgJLQGARCdIvWd2hCf
S+xkzO/GmqUoqJfT9A/ApLLDBs3e/swfjbrnanN0IfHt1XQUiVoodh32jtMlGXz7eY5p
8FNLfF8/6Q45Lk/81saHNpccnDCKW8Up0gtGK/8CZDK7UC6FnM7LZHLtlMSSDFEjyMyU
r3mrPGdNyo2TJ3+338z4864WeMwGxM0a+Cl3hw4+bBGjWsmn9/nk7Hq/1d+C/Ga1xf3i
g+tA==
Sender: bitcoindev@googlegroups.com
X-Forwarded-Encrypted: i=2; AJvYcCXqFxSrK3VLboeCHDXIXV+gwRygIQgiQkra1huQabP4rzEX15u1JnRNBidiz0iM4o4UTwDQrNyFdpfz@gnusha.org
X-Gm-Message-State: AOJu0Yz/tmhq706DrXcdKGEFGOfDoz+KFCRngzg2QU811Y8XAOsAyYdZ
B6uLbFZ/DzAfmz9cKuGApHXq/h6CMMcM6s6ets9CLzpIEVca2Waw
X-Google-Smtp-Source: AGHT+IFv27cn6f7GhGzfPFi9SMrnCY7MaEULxWFppzjgFAUcLX7cFkz3OJ99Kx661fomX3f8Pw4haQ==
X-Received: by 2002:a05:6871:741a:b0:2c8:340d:1076 with SMTP id 586e51a60fabf-2dba455318cmr9127407fac.32.1747127179232;
Tue, 13 May 2025 02:06:19 -0700 (PDT)
X-BeenThere: bitcoindev@googlegroups.com; h=AVT/gBH50fCWOydnxsh2HxHJ+dwGRz21+d8W4gwoBlK/+A8rUw==
Received: by 2002:a05:6871:3a8e:b0:2ab:4267:cb7c with SMTP id
586e51a60fabf-2db810296b1ls346991fac.1.-pod-prod-07-us; Tue, 13 May 2025
02:06:15 -0700 (PDT)
X-Received: by 2002:a05:6808:2f06:b0:404:78f9:711c with SMTP id 5614622812f47-40478f97214mr8072374b6e.19.1747127175676;
Tue, 13 May 2025 02:06:15 -0700 (PDT)
Received: by 2002:a05:6808:13d0:b0:3f6:a384:eb6f with SMTP id 5614622812f47-4037feaf8bdmsb6e;
Tue, 13 May 2025 02:04:33 -0700 (PDT)
X-Received: by 2002:a05:6a00:3d16:b0:73f:f816:dd7f with SMTP id d2e1a72fcca58-7423c01db46mr21539148b3a.15.1747127072032;
Tue, 13 May 2025 02:04:32 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1747127072; cv=none;
d=google.com; s=arc-20240605;
b=i0h2GWXH45PC9NUDvirssxm6dNQKr6u89ZzdMp6tfgPXKFhVr6NsEBibKE+oKCtlpS
snyCa1fMnXEEe0vtf0rYKLJ61hDzIMgAIRW6sQcyspJa/PxSANh7UYx1EPoryUTm/Fbd
ERqf2W2qCg5vcegRe1ASO6bD6E4D3/l1sZwdKUqwGFhcFdvRT5Lf7t2yVTPdLcT83APe
vCqDNV45uFpKOsZs+RMDAX2YNppglucs9e2HvHgXe1KN+vkjQ/QBzIwmF+2tQD/NaI23
auQNWV9ftQc9UXwPCaKVV1aXvjZ/wv112uaSqta/u4zu9EMmS1aaQ0GroCep6PM+fwwG
T5/A==
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=FU7fXAdkFTuXkzZ2wMmUoNH14NzZOv/3yufeBs98dpU=;
fh=FHPCOD3vptmuEQg9drujpZ488lCS6X5YsZgbHrlMbXI=;
b=EiLRLI1dxeIqzW9qb/0jW+EZ6ynOd1MNeKkiYQoiKGPfKD8STdfhbFErwYnJ0FHSAU
KGTkXwQvmVlrottF4rsyGzblqW9avjDyyyQUU8OVQWepABoNLrUfkT4TD8fQiBu2zSfU
X1tSCWRznQyro2A8ak2QYQkgfQukGZNBtMY6D+DJlxjo+Lrx/DUVWWK5ZvHSZW0Za8Ny
IiNbpAeMLnne7MdVPDcGBcWGqeEMtXw5WwGwyhw9/53ZKznOS5O1FIcccmtIiLNcT+Pg
R7Cx4d/GW6AIxlXWxlCa9A0LMojCmRm8jK7pJtKqu5kW5pKaExAqiwtE3+ccYuk72JdJ
BAFA==;
dara=google.com
ARC-Authentication-Results: i=1; gmr-mx.google.com;
dkim=pass header.i=@gmail.com header.s=20230601 header.b=XUwYpwdQ;
spf=pass (google.com: domain of stewart.chris1234@gmail.com designates 2607:f8b0:4864:20::112f as permitted sender) smtp.mailfrom=stewart.chris1234@gmail.com;
dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com;
dara=pass header.i=@googlegroups.com
Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com. [2607:f8b0:4864:20::112f])
by gmr-mx.google.com with ESMTPS id 41be03b00d2f7-b234c37c404si349339a12.5.2025.05.13.02.04.31
for <bitcoindev@googlegroups.com>
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Tue, 13 May 2025 02:04:32 -0700 (PDT)
Received-SPF: pass (google.com: domain of stewart.chris1234@gmail.com designates 2607:f8b0:4864:20::112f as permitted sender) client-ip=2607:f8b0:4864:20::112f;
Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-70a1f2eb39aso49464467b3.1
for <bitcoindev@googlegroups.com>; Tue, 13 May 2025 02:04:31 -0700 (PDT)
X-Gm-Gg: ASbGncuZUERS/Opg8GnTEWIsMmWN+83b5IOT1so1l3/7muknszKgZpbaIK69W8dUxul
r4bkQjtwvQliuRe2gQlDW7t1Ngu9LI7gRXG5Re4w6rfeHGVKznxIdqumBymhWVwyLT8FwL6WaIu
/FfdDqXyx6eCzD6BC0qvU5GQaSN6kCBz4=
X-Received: by 2002:a05:690c:9b02:b0:709:1529:c24f with SMTP id
00721157ae682-70a3f9f34ffmr196653147b3.4.1747127071283; Tue, 13 May 2025
02:04:31 -0700 (PDT)
MIME-Version: 1.0
References: <CAGL6+mH+9iq5_SR-Fa5zVZRoTpHasX7xoprYeJZRd5D80J1GqA@mail.gmail.com>
<CALkkCJbeAYA2X8jv8iWthKBB8GqxA49DCFm+UMnhmXYpexTNtw@mail.gmail.com>
In-Reply-To: <CALkkCJbeAYA2X8jv8iWthKBB8GqxA49DCFm+UMnhmXYpexTNtw@mail.gmail.com>
From: Chris Stewart <stewart.chris1234@gmail.com>
Date: Tue, 13 May 2025 04:03:00 -0500
X-Gm-Features: AX0GCFvMoD_Br6jMmkVP7TfGQ66yae6_riYIX3WbDlVl8KipkTzFjTEcU3VDYYo
Message-ID: <CAGL6+mHv+kn6SU9pf0Rz3FmM5OfcsmEtqGBRJ7Upb-b0MofS5A@mail.gmail.com>
Subject: Re: [bitcoindev] [Proposal] 64-bit arithmetic in Script
To: =?UTF-8?Q?Martin_Habov=C5=A1tiak?= <martin.habovstiak@gmail.com>
Cc: Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Content-Type: multipart/alternative; boundary="000000000000762793063500b875"
X-Original-Sender: stewart.chris1234@gmail.com
X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass
header.i=@gmail.com header.s=20230601 header.b=XUwYpwdQ; spf=pass
(google.com: domain of stewart.chris1234@gmail.com designates
2607:f8b0:4864:20::112f as permitted sender) smtp.mailfrom=stewart.chris1234@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 (/)
--000000000000762793063500b875
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi Martin
Thanks for your interest in the topic.
>It mentions upgrading existing opcodes, which is a hardfork, not soft
fork, at least without using a different leaf version. But it also mentions
OP_SUCCESSX which are different opcodes
I view 64-bit arithmetic as a feature of a wider set of consensus changes.
Here is what I think the most likely deployment story is
>This proposal could be deployed in conjunction with any of the new opcode
proposals in the Motivation section using Tapscript's OP_SUCCESSx semantics=
.
[18
<https://github.com/Christewart/bips/blob/2025-03-17-64bit-pt2/bip-XXXX.med=
iawiki#cite_note-18>
]
The opcodes mentioned in the motivation section are OP_{IN,OUT}_AMOUNT,
OP_VAULT, OP_CHECKCONTRACTVERIFY, OP_CTV
As an example, this proposal could (hypothetically) be deployed in
conjunction with OP_CCV. OP_CCV would take advantage of the OP_SUCCESSx
semantics allowing us to redefine existing opcode's (OP_ADD,OP_SUB, etc)
semantics.
There=E2=80=99s been some discussion
<https://delvingbitcoin.org/t/ctv-csfs-can-we-reach-consensus-on-a-first-st=
ep-towards-covenants/1509/48?u=3Dchris_stewart_5>
around deploying OP_CTV via a NOP opcode instead of OP_SUCCESSx. I think
that would be a poor choice, as it wouldn=E2=80=99t allow new Script featur=
es to be
shipped in parallel with the new opcode.
I found this StackExchange post <https://bitcoin.stackexchange.com/q/125237=
>
helpful in thinking through various deployment strategies for new
Tapscript-based consensus upgrades.
>I'd also love to see analysis why stop at 64 bits and not go all the way
to 256 which could be useful for cryptography.
In my view, there=E2=80=99s still a lot of uncertainty about cryptographic =
features
being added to Script. There's increasing discussion around quantum
computing, which raises the question of how much numerical precision we may
eventually need. I'm not opposed to extending precision further=E2=80=94but=
if we
go beyond 64 bits, why stop at 256? With OP_SUCCESSx, arbitrary precision
becomes a real option <https://bitcoin.stackexchange.com/a/126153/20835>.
I chose 64 bits because it covers what=E2=80=99s needed for amount locks. I=
f
someone strongly believes that 64 bits isn't enough, I=E2=80=99d welcome a
competing BIP and would be happy to review and discuss it with the author.
>Anyway, pushing amounts on the stack would be great. Though I'm surprised
you're only proposing the sum, not individual outputs. Why?
Good question=E2=80=94and slightly out of scope for this BIP. Script doesn=
=E2=80=99t
support looping, so it=E2=80=99s not straightforward to iterate over and su=
m all
elements unless the transaction structure (i.e., number of inputs or
outputs) is known in advance.
You can measure the number of stack elements with OP_DEPTH, but there=E2=80=
=99s no
way to write something like OP_ADD [num-stack-elements-from-OP_DEPTH] to
sum them all. I=E2=80=99m definitely open to hearing other approaches, thou=
gh.
-Chris
On Mon, May 12, 2025 at 2:32=E2=80=AFPM Martin Habov=C5=A1tiak <
martin.habovstiak@gmail.com> wrote:
> Hi,
>
> the proposal seems to be quite confused about how it's going to do that.
> It mentions upgrading existing opcodes, which is a hardfork, not soft for=
k,
> at least without using a different leaf version. But it also mentions
> OP_SUCCESSX which are different opcodes. I think it needs some analysis.
> (leaf version seems better intuitively)
>
> I'd also love to see analysis why stop at 64 bits and not go all the way
> to 256 which could be useful for cryptography.
>
> Anyway, pushing amounts on the stack would be great. Though I'm surprised
> you're only proposing the sum, not individual outputs. Why?
>
> Good luck!
>
> Martin
>
> D=C5=88a po 12. 5. 2025, 14:21 Chris Stewart <stewart.chris1234@gmail.com=
>
> nap=C3=ADsal(a):
>
>> This soft fork proposal extends the range of numeric operands in Script
>> from -2^31+1 to 2^31-1, to -2^63+1 to 2^63-1. It further expands the
>> result range for arithmetic operations from -2^63 to 2^63-1, to -2^127
>> to 2^127- 1.
>>
>> All existing opcodes[1
>> <https://github.com/Christewart/bips/blob/2025-03-17-64bit-pt2/bip-XXXX.=
mediawiki#cite_note-1>
>> ] that interpret stack elements as numbers are upgraded to support
>> 64-bit parameters.
>>
>> The existing number encoding format[2
>> <https://github.com/Christewart/bips/blob/2025-03-17-64bit-pt2/bip-XXXX.=
mediawiki#cite_note-2>
>> ] and arithmetic semantics[3
>> <https://github.com/Christewart/bips/blob/2025-03-17-64bit-pt2/bip-XXXX.=
mediawiki#cite_note-3>
>> ] from the original Bitcoin implementation are preserved, while
>> enhancing the supported precision.
>>
>>
>> https://github.com/Christewart/bips/blob/2025-03-17-64bit-pt2/bip-XXXX.m=
ediawiki
>>
>> The purpose for this BIP is to lay the groundwork for introducing amount=
s
>> into Script. This document takes no opinion on how this is done.
>>
>> I've prototyped a few different proposals now introducing amount locks
>> into Script[0][1] and feel like this proposal is stable enough for serio=
us
>> review.
>>
>> -Chris
>>
>> [0] -
>> https://delvingbitcoin.org/t/op-inout-amount/549/4?u=3Dchris_stewart_5
>>
>> [1] -
>> https://delvingbitcoin.org/t/op-inout-amount/549/5?u=3Dchris_stewart_5
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "Bitcoin Development Mailing List" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> email to bitcoindev+unsubscribe@googlegroups.com.
>> To view this discussion visit
>> https://groups.google.com/d/msgid/bitcoindev/CAGL6%2BmH%2B9iq5_SR-Fa5zVZ=
RoTpHasX7xoprYeJZRd5D80J1GqA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/bitcoindev/CAGL6%2BmH%2B9iq5_SR-Fa5zV=
ZRoTpHasX7xoprYeJZRd5D80J1GqA%40mail.gmail.com?utm_medium=3Demail&utm_sourc=
e=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/=
CAGL6%2BmHv%2Bkn6SU9pf0Rz3FmM5OfcsmEtqGBRJ7Upb-b0MofS5A%40mail.gmail.com.
--000000000000762793063500b875
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hi Martin</div><div><br></div><div>Thanks for your in=
terest in the topic.</div><div><br></div><div>>It mentions upgrading exi=
sting opcodes, which is a hardfork, not soft=20
fork, at least without using a different leaf version. But it also=20
mentions OP_SUCCESSX which are different opcodes</div><div><br></div><div>I=
view 64-bit arithmetic as a feature of a wider set of consensus changes. H=
ere is what I think the most likely deployment story is<br><br>>This pro=
posal could be deployed in conjunction with any of the new=20
opcode proposals in the Motivation section using Tapscript's OP_SUCCESS=
x
semantics.<sup id=3D"m_-3858691108396401021gmail-user-content-cite_ref-18-=
0">[<a href=3D"https://github.com/Christewart/bips/blob/2025-03-17-64bit-pt=
2/bip-XXXX.mediawiki#cite_note-18" target=3D"_blank">18</a>]</sup></div><di=
v><sup id=3D"m_-3858691108396401021gmail-user-content-cite_ref-18-0"><br></=
sup></div><div>The opcodes mentioned in the motivation section are OP_{IN,O=
UT}_AMOUNT, OP_VAULT, OP_CHECKCONTRACTVERIFY, OP_CTV</div><div><br></div><d=
iv>As an example, this proposal could (hypothetically) be deployed in conju=
nction with OP_CCV. OP_CCV would take advantage of the OP_SUCCESSx semantic=
s allowing us to redefine existing opcode's (OP_ADD,OP_SUB, etc) semant=
ics.=C2=A0</div><div><br></div><div>There=E2=80=99s been some <a href=3D"ht=
tps://delvingbitcoin.org/t/ctv-csfs-can-we-reach-consensus-on-a-first-step-=
towards-covenants/1509/48?u=3Dchris_stewart_5" target=3D"_blank">discussion=
</a> around deploying <code>OP_CTV</code> via a <code>NOP</code> opcode ins=
tead of <code>OP_SUCCESSx</code>. I think that would be a poor choice, as i=
t wouldn=E2=80=99t allow new Script features to be shipped in parallel with=
the new opcode.</div><div><br></div><div>I found <a rel=3D"noopener" href=
=3D"https://bitcoin.stackexchange.com/q/125237" target=3D"_blank">this Stac=
kExchange post</a> helpful in thinking through various deployment strategie=
s for new Tapscript-based consensus upgrades.</div><div><br></div><div>>=
I'd also love to see analysis why stop at 64 bits and not go all the wa=
y to 256 which could be useful for cryptography.</div><div><br></div><div>I=
n my view, there=E2=80=99s still a lot of uncertainty about cryptographic f=
eatures being added to Script. There's increasing discussion around qua=
ntum computing, which raises the question of how much numerical precision w=
e may eventually need. I'm not opposed to extending precision further=
=E2=80=94but if we go beyond 64 bits, why stop at 256? With <code>OP_SUCCES=
Sx</code>, <a href=3D"https://bitcoin.stackexchange.com/a/126153/20835" tar=
get=3D"_blank">arbitrary precision becomes a real option</a>.</div><div><br=
></div><div>I chose 64 bits because it covers what=E2=80=99s needed for amo=
unt locks. If someone strongly believes that 64 bits isn't enough, I=E2=
=80=99d welcome a competing BIP and would be happy to review and discuss it=
with the author.</div><div><br></div><div>>Anyway, pushing amounts on t=
he stack would be great. Though I'm=20
surprised you're only proposing the sum, not individual outputs. Why?</=
div><div><br></div><div>Good question=E2=80=94and slightly out of scope for=
this BIP. Script doesn=E2=80=99t support looping, so it=E2=80=99s not stra=
ightforward to iterate over and sum all elements unless the transaction str=
ucture (i.e., number of inputs or outputs) is known in advance.<br>
You can measure the number of stack elements with <code>OP_DEPTH</code>, bu=
t there=E2=80=99s no way to write something like <code>OP_ADD [num-stack-el=
ements-from-OP_DEPTH]</code> to sum them all. I=E2=80=99m definitely open t=
o hearing other approaches, though.</div><div><br></div><div>-Chris</div><d=
iv><br></div><div><br></div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Mon, May 12, 2025 at 2:32=E2=80=AFPM Marti=
n Habov=C5=A1tiak <<a href=3D"mailto:martin.habovstiak@gmail.com" target=
=3D"_blank">martin.habovstiak@gmail.com</a>> wrote:<br></div><blockquote=
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so=
lid rgb(204,204,204);padding-left:1ex"><div dir=3D"auto">Hi,<div dir=3D"aut=
o"><br></div><div dir=3D"auto">the proposal seems to be quite confused abou=
t how it's going to do that. It mentions upgrading existing opcodes, wh=
ich is a hardfork, not soft fork, at least without using a different leaf v=
ersion. But it also mentions OP_SUCCESSX which are different opcodes. I thi=
nk it needs some analysis. (leaf version seems better intuitively)</div><di=
v dir=3D"auto"><br></div><div dir=3D"auto">I'd also love to see analysi=
s why stop at 64 bits and not go all the way to 256 which could be useful f=
or cryptography.</div><div dir=3D"auto"><br></div><div dir=3D"auto">Anyway,=
pushing amounts on the stack would be great. Though I'm surprised you&=
#39;re only proposing the sum, not individual outputs. Why?</div><div dir=
=3D"auto"><br></div><div dir=3D"auto">Good luck!</div><div dir=3D"auto"><br=
></div><div dir=3D"auto">Martin</div></div><br><div class=3D"gmail_quote"><=
div dir=3D"ltr" class=3D"gmail_attr">D=C5=88a po 12. 5. 2025, 14:21 Chris S=
tewart <<a href=3D"mailto:stewart.chris1234@gmail.com" target=3D"_blank"=
>stewart.chris1234@gmail.com</a>> nap=C3=ADsal(a):<br></div><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><p dir=3D"auto">This=
soft fork proposal extends the range of numeric operands in Script from -2=
^<sup>31</sup>+1 to 2^<sup>31</sup>-1, to -2^<sup>63</sup>+1 to 2^<sup>63</=
sup>-1.
It further expands the result range for arithmetic operations from -2^<sup>=
63</sup> to 2^<sup>63</sup>-1, to -2^<sup>127</sup> to 2^<sup>127</sup>- 1.
</p>
<p dir=3D"auto">All existing opcodes<sup id=3D"m_-3858691108396401021m_-116=
2971288865938356m_1405182730796312002gmail-user-content-cite_ref-1-0">[<a h=
ref=3D"https://github.com/Christewart/bips/blob/2025-03-17-64bit-pt2/bip-XX=
XX.mediawiki#cite_note-1" rel=3D"noreferrer" target=3D"_blank">1</a>]</sup>=
=20
that interpret stack elements as numbers are upgraded to support 64-bit par=
ameters.
</p>
<p dir=3D"auto">The existing number encoding format<sup id=3D"m_-3858691108=
396401021m_-1162971288865938356m_1405182730796312002gmail-user-content-cite=
_ref-2-0">[<a href=3D"https://github.com/Christewart/bips/blob/2025-03-17-6=
4bit-pt2/bip-XXXX.mediawiki#cite_note-2" rel=3D"noreferrer" target=3D"_blan=
k">2</a>]</sup>=20
and arithmetic semantics<sup id=3D"m_-3858691108396401021m_-116297128886593=
8356m_1405182730796312002gmail-user-content-cite_ref-3-0">[<a href=3D"https=
://github.com/Christewart/bips/blob/2025-03-17-64bit-pt2/bip-XXXX.mediawiki=
#cite_note-3" rel=3D"noreferrer" target=3D"_blank">3</a>]</sup>=20
from the original Bitcoin implementation are preserved, while enhancing the=
supported precision.</p><p dir=3D"auto"><a href=3D"https://github.com/Chri=
stewart/bips/blob/2025-03-17-64bit-pt2/bip-XXXX.mediawiki" rel=3D"noreferre=
r" target=3D"_blank">https://github.com/Christewart/bips/blob/2025-03-17-64=
bit-pt2/bip-XXXX.mediawiki</a></p><p>The purpose for this BIP is to lay the=
groundwork for introducing amounts into Script. This document takes no opi=
nion on how this is done.</p><p>I've prototyped a few different proposa=
ls now introducing amount locks into Script[0][1] and feel like this propos=
al is stable enough for serious review.</p><p>-Chris</p><p>[0] - <a href=3D=
"https://delvingbitcoin.org/t/op-inout-amount/549/4?u=3Dchris_stewart_5" re=
l=3D"noreferrer" target=3D"_blank">https://delvingbitcoin.org/t/op-inout-am=
ount/549/4?u=3Dchris_stewart_5</a></p><p>[1] - <a href=3D"https://delvingbi=
tcoin.org/t/op-inout-amount/549/5?u=3Dchris_stewart_5" rel=3D"noreferrer" t=
arget=3D"_blank">https://delvingbitcoin.org/t/op-inout-amount/549/5?u=3Dchr=
is_stewart_5</a></p><p><br></p><br></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" rel=3D"n=
oreferrer" target=3D"_blank">bitcoindev+unsubscribe@googlegroups.com</a>.<b=
r>
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
bitcoindev/CAGL6%2BmH%2B9iq5_SR-Fa5zVZRoTpHasX7xoprYeJZRd5D80J1GqA%40mail.g=
mail.com?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"noreferrer" tar=
get=3D"_blank">https://groups.google.com/d/msgid/bitcoindev/CAGL6%2BmH%2B9i=
q5_SR-Fa5zVZRoTpHasX7xoprYeJZRd5D80J1GqA%40mail.gmail.com</a>.<br>
</blockquote></div>
</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/CAGL6%2BmHv%2Bkn6SU9pf0Rz3FmM5OfcsmEtqGBRJ7Upb-b0MofS5A%40mail.g=
mail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/=
d/msgid/bitcoindev/CAGL6%2BmHv%2Bkn6SU9pf0Rz3FmM5OfcsmEtqGBRJ7Upb-b0MofS5A%=
40mail.gmail.com</a>.<br />
--000000000000762793063500b875--
|