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] that interpret stack elements as numbers are upgraded to support 64-bit parameters.
The existing number encoding format[2] and arithmetic semantics[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.mediawiki
The purpose for this BIP is to lay the groundwork for introducing amounts 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 serious review.
-Chris
[0] - https://delvingbitcoin.org/t/op-inout-amount/549/4?u=chris_stewart_5
[1] - https://delvingbitcoin.org/t/op-inout-amount/549/5?u=chris_stewart_5
--
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+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/CAGL6%2BmH%2B9iq5_SR-Fa5zVZRoTpHasX7xoprYeJZRd5D80J1GqA%40mail.gmail.com.
OP_CTV
via a NOP
opcode instead of OP_SUCCESSx
. I think that would be a poor choice, as it wouldn’t allow new Script features to be shipped in parallel with the new opcode.OP_SUCCESSx
, arbitrary precision becomes a real option.OP_DEPTH
, but there’s no way to write something like OP_ADD [num-stack-elements-from-OP_DEPTH]
to sum them all. I’m definitely open to hearing other approaches, though.I’d like to invite you, Rusty, or any other contributors to provide an update to the list on the status of GSR. The most recent public writing I’m aware of is Rusty’s blog post, which is now around 18 months old. Are there any newer materials — such as additional posts, WIP BIPs, or code — that we could review or experiment with? Even rough drafts would be helpful for prototyping and discussion.
I’m not opposed to the broader goals of GSR, but I do think it’s a bit ambitious. That’s partly why I’ve focused my efforts on isolating what I believe is the most requested feature: 64-bit precision to enable amount locks.
ECMULSCALARVERIFY
and TWEAKVERIFY
— which operate on 256-bit stack arguments. Notably, these opcodes don’t support composition with existing arithmetic opcodes like OP_ADD
or OP_SUB
; they simply verify cryptographic conditions. I would argue they do not actually require supporting more precision in Script as the stack arguments aren't parsed into CScriptNum.