--- Log opened Wed Mar 20 00:00:32 2024 00:03 -!- puchka [~puchka@185.203.122.26] has joined #bitcoin-core-pr-reviews 00:06 -!- Guest59 [~Guest59@ip-095-222-024-026.um34.pools.vodafone-ip.de] has joined #bitcoin-core-pr-reviews 00:25 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 00:30 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 255 seconds] 00:45 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 00:49 -!- Guest46 [~Guest34@213.94.40.217] has joined #bitcoin-core-pr-reviews 00:49 < Guest46> hi 00:49 -!- Guest46 [~Guest34@213.94.40.217] has quit [Client Quit] 00:50 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 246 seconds] 01:05 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 01:10 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 260 seconds] 01:13 -!- csknk [~csknk@88.87.164.26] has joined #bitcoin-core-pr-reviews 01:20 -!- csknk [~csknk@88.87.164.26] has quit [Quit: leaving] 01:23 -!- kevkevin [~kevkevin@2601:241:8703:7b30:f51b:83a:eb99:a9c2] has joined #bitcoin-core-pr-reviews 01:23 -!- csknk [~csknk@88.87.164.26] has joined #bitcoin-core-pr-reviews 01:28 -!- kevkevin [~kevkevin@2601:241:8703:7b30:f51b:83a:eb99:a9c2] has quit [Ping timeout: 268 seconds] 01:43 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 01:47 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 272 seconds] 02:08 -!- kevkevin [~kevkevin@2601:241:8703:7b30:f51b:83a:eb99:a9c2] has joined #bitcoin-core-pr-reviews 02:14 -!- kevkevin [~kevkevin@2601:241:8703:7b30:f51b:83a:eb99:a9c2] has quit [Ping timeout: 260 seconds] 02:29 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 02:33 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 268 seconds] 02:34 -!- csknk [~csknk@88.87.164.26] has quit [Ping timeout: 240 seconds] 02:37 -!- csknk [~csknk@88.87.164.26] has joined #bitcoin-core-pr-reviews 02:47 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 02:56 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 268 seconds] 03:10 -!- Guest59 is now known as Tosho 03:11 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 03:16 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 240 seconds] 03:19 -!- abubakarsadiq [uid602234@id-602234.hampstead.irccloud.com] has joined #bitcoin-core-pr-reviews 03:30 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 03:35 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 268 seconds] 03:49 -!- massym01 [~massym01@151.47.95.183] has joined #bitcoin-core-pr-reviews 03:50 -!- massym01 [~massym01@151.47.95.183] has left #bitcoin-core-pr-reviews [] 03:50 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 03:55 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 260 seconds] 04:04 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 04:09 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 255 seconds] 04:19 -!- the_mariner [~Thunderbi@2804:29b8:518d:a89:8889:b189:9c96:5e1a] has joined #bitcoin-core-pr-reviews 04:23 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 04:28 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 260 seconds] 04:41 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 04:45 -!- the_mariner1 [~Thunderbi@2804:29b8:518d:a89:8889:b189:9c96:5e1a] has joined #bitcoin-core-pr-reviews 04:45 -!- TheRec_ [~toto@84-75-225-47.dclient.hispeed.ch] has joined #bitcoin-core-pr-reviews 04:45 -!- lightlike_ [sid521075@user/lightlike] has joined #bitcoin-core-pr-reviews 04:45 -!- stickies-v_ [sid544753@id-544753.uxbridge.irccloud.com] has joined #bitcoin-core-pr-reviews 04:46 -!- abubakarsadiq_ [uid602234@id-602234.hampstead.irccloud.com] has joined #bitcoin-core-pr-reviews 04:46 -!- ajonas_ [sid385278@id-385278.helmsley.irccloud.com] has joined #bitcoin-core-pr-reviews 04:46 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 272 seconds] 04:49 -!- lbia1 [~lbia@user/lbia] has joined #bitcoin-core-pr-reviews 04:53 -!- Netsplit *.net <-> *.split quits: ajonas, lbia, the_mariner, abubakarsadiq, lightlike, stickies-v, TheRec, aureleoules 04:53 -!- abubakarsadiq_ is now known as abubakarsadiq 04:53 -!- stickies-v_ is now known as stickies-v 04:53 -!- the_mariner1 is now known as the_mariner 04:53 -!- lightlike_ is now known as lightlike 04:53 -!- ajonas_ is now known as ajonas 04:53 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has joined #bitcoin-core-pr-reviews 05:00 -!- Netsplit over, joins: aureleoules 05:51 -!- the_mariner [~Thunderbi@2804:29b8:518d:a89:8889:b189:9c96:5e1a] has quit [Ping timeout: 256 seconds] 05:55 -!- kevkevin [~kevkevin@2601:241:8703:7b30:9d8c:7570:28c9:cdb9] has quit [Ping timeout: 268 seconds] 06:01 -!- kevkevin [~kevkevin@2601:241:8703:7b30:f51b:83a:eb99:a9c2] has joined #bitcoin-core-pr-reviews 06:01 -!- kevkevin [~kevkevin@2601:241:8703:7b30:f51b:83a:eb99:a9c2] has quit [Remote host closed the connection] 06:02 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has joined #bitcoin-core-pr-reviews 06:07 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has quit [Ping timeout: 264 seconds] 06:08 -!- Tosho [~Guest59@ip-095-222-024-026.um34.pools.vodafone-ip.de] has quit [Quit: Client closed] 06:21 -!- kevkevin [~kevkevin@98.226.43.69] has joined #bitcoin-core-pr-reviews 06:26 -!- kevkevin [~kevkevin@98.226.43.69] has quit [Remote host closed the connection] 06:26 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has joined #bitcoin-core-pr-reviews 06:32 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has quit [Remote host closed the connection] 06:33 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has joined #bitcoin-core-pr-reviews 06:38 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has quit [Ping timeout: 264 seconds] 06:44 -!- Guest17 [~Guest17@97-125-151-69.desm.qwest.net] has joined #bitcoin-core-pr-reviews 06:45 -!- Guest17 [~Guest17@97-125-151-69.desm.qwest.net] has quit [Client Quit] 06:47 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has joined #bitcoin-core-pr-reviews 06:55 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has quit [Remote host closed the connection] 06:56 -!- pablomartin [~pablomart@194.156.224.75] has joined #bitcoin-core-pr-reviews 07:16 -!- angusp [9e8eed9774@2a03:6000:1812:100::1048] has quit [Remote host closed the connection] 07:17 -!- angusp [9e8eed9774@2a03:6000:1812:100::1048] has joined #bitcoin-core-pr-reviews 07:26 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has joined #bitcoin-core-pr-reviews 07:47 -!- the_mariner [~Thunderbi@2804:29b8:518d:a89:8889:b189:9c96:5e1a] has joined #bitcoin-core-pr-reviews 07:47 -!- the_mariner [~Thunderbi@2804:29b8:518d:a89:8889:b189:9c96:5e1a] has quit [Client Quit] 07:57 -!- csknk [~csknk@88.87.164.26] has quit [Ping timeout: 260 seconds] 08:15 -!- yakshaver[m] [~yakshaver@2620:6e:a000:ce11::2b] has quit [Quit: Bridge terminating on SIGTERM] 08:15 -!- sr_gi[m] [~srgimatri@2620:6e:a000:ce11::2a] has quit [Quit: Bridge terminating on SIGTERM] 08:15 -!- BlueMattMtrxBot [~bluemattm@2620:6e:a000:ce11::2d] has quit [Quit: Bridge terminating on SIGTERM] 08:15 -!- BlueMatt[m] [~bluematt@2620:6e:a000:ce11::d] has quit [Quit: Bridge terminating on SIGTERM] 08:15 -!- Murch[m] [~murch@2620:6e:a000:ce11::1b] has quit [Quit: Bridge terminating on SIGTERM] 08:16 -!- BlueMattMtrxBot [~bluemattm@2620:6e:a000:ce11::2e] has joined #bitcoin-core-pr-reviews 08:16 -!- BlueMattMtrxBot [~bluemattm@2620:6e:a000:ce11::2e] has quit [Remote host closed the connection] 08:16 -!- BlueMattMtrxBot [~bluemattm@2620:6e:a000:ce11::2f] has joined #bitcoin-core-pr-reviews 08:17 -!- BlueMattMtrxBot1 [~bluemattm@2620:6e:a000:ce11::2f] has joined #bitcoin-core-pr-reviews 08:17 -!- yakshaver[m] [~yakshaver@2620:6e:a000:ce11::2b] has joined #bitcoin-core-pr-reviews 08:22 -!- Murch[m] [~murch@user/murch] has joined #bitcoin-core-pr-reviews 08:22 -!- BlueMatt[m] [~bluematt@2620:6e:a000:ce11::d] has joined #bitcoin-core-pr-reviews 08:22 -!- sr_gi[m] [~srgimatri@2620:6e:a000:ce11::2a] has joined #bitcoin-core-pr-reviews 08:34 -!- BlueMatt[m] [~bluematt@2620:6e:a000:ce11::d] has quit [Quit: Bridge terminating on SIGTERM] 08:34 -!- sr_gi[m] [~srgimatri@2620:6e:a000:ce11::2a] has quit [Quit: Bridge terminating on SIGTERM] 08:34 -!- BlueMattMtrxBot [~bluemattm@2620:6e:a000:ce11::2f] has quit [Remote host closed the connection] 08:34 -!- yakshaver[m] [~yakshaver@2620:6e:a000:ce11::2b] has quit [Quit: Bridge terminating on SIGTERM] 08:34 -!- BlueMattMtrxBot1 [~bluemattm@2620:6e:a000:ce11::2f] has quit [Quit: Bridge terminating on SIGTERM] 08:34 -!- Murch[m] [~murch@user/murch] has quit [Quit: Bridge terminating on SIGTERM] 08:34 -!- BlueMattMtrxBot [~bluemattm@2620:6e:a000:ce11::30] has joined #bitcoin-core-pr-reviews 08:35 -!- yakshaver[m] [~yakshaver@2620:6e:a000:ce11::2b] has joined #bitcoin-core-pr-reviews 08:40 -!- BlueMatt[m] [~bluematt@2620:6e:a000:ce11::d] has joined #bitcoin-core-pr-reviews 08:40 -!- Murch[m] [~murch@2620:6e:a000:ce11::1b] has joined #bitcoin-core-pr-reviews 08:40 -!- sr_gi[m] [~srgimatri@2620:6e:a000:ce11::2a] has joined #bitcoin-core-pr-reviews 09:49 -!- ion- [~ion-@2a02:587:4b6d:1a00:cd99:c17a:7056:8e30] has joined #bitcoin-core-pr-reviews 09:56 -!- Guest93 [~Guest42@212.129.76.47] has joined #bitcoin-core-pr-reviews 10:00 < Chris_Stewart_5> #startmeeting 10:00 < Guest93> hi 10:00 < stickies-v> hi 10:00 < Chris_Stewart_5> Hi everyone, this week we are discussing the proposed soft fork for 64bit arithmetic in the Script interpreter! :-) 10:00 < Chris_Stewart_5> https://bitcoincore.reviews/29221 10:01 < Chris_Stewart_5> the most INNOVATIVE soft fork ever proposed for bitcoin :P 10:02 < stickies-v> moar maths 10:02 < Chris_Stewart_5> 64bits of it! 10:02 < glozow> hi 10:02 < dergoegge> hi 10:03 < emzy> hi 10:03 < Chris_Stewart_5> I put some examples of how Script currently works on the bitcoincore.reviews webpage. I used chatGPT to generate some (hopefully) readable ASCII art to show how Script and the stack work together 10:03 < glozow> they are very helpful examples! 10:04 < Chris_Stewart_5> Does anyone have a question about Script execution works before we start with 64bit specific questions? 10:04 < Guest93> what is 'the interpreter'? 10:05 < stickies-v> do you know why historically we limited operations to 4 bytes? 10:05 < Chris_Stewart_5> Guest93: The interpreter takes in instructions (such as 'OP_ADD') and data (such as a encoded numbers) and manipulates the stack based on the given instruction. 10:06 < Chris_Stewart_5> Guest93: another way to say it is, 'the interpreter' implements the Script programming language. 10:06 < glozow> I interpret interpreter to mean `EvalScript` in interpreter.cpp https://github.com/bitcoin/bitcoin/blob/b50554babdddf452acaa51bac757736766c70e81/src/script/interpreter.cpp#L406 10:06 < stickies-v> that's a lot of interpreting 10:07 < Chris_Stewart_5> stickies-v: I actually don't know why 32 bits specifically. That is a good historical Q that I will have to look up. I've done a bit of archaeology on where we got CScriptNum from (I believe openSSL, still confirmign though). 10:07 < glozow> oo, scandalous 10:08 < Chris_Stewart_5> stickies-v: I've previously assumed it was that way because Satoshi said so, but I need to confirm that :-) 10:08 < ion-> I get that not all processors were 64bit at the time 10:08 < Chris_Stewart_5> ion-: Fair point. 10:08 < ion-> Are there any security issues with 64bit nowdays? I cannot think of any 10:09 < stickies-v> what do you mean with security issues with 64 bit? 10:09 < Chris_Stewart_5> ion-: Thats why I've got you fine folks to review my (and the elements' team) work. This implementation is mostly pulled over from the elements blockchain: https://github.com/ElementsProject/elements/ 10:10 < Chris_Stewart_5> that is the implementation that powers the liquid sidechain and is a fork of bitcoin's codebase. 10:10 < Chris_Stewart_5> They implemented this 64bit math and the error handling capabilities for the 64bit instructions over there ~2-3 years ago. 10:12 < abubakarsadiq> hi 10:12 < ion-> There shouldn't be anything against using 64bit arithmetic. It makes better sense. This is what I am trying to say in a conservative way. 10:13 < Chris_Stewart_5> stickies-v: This might answer your 'why 32 bits' question. 10:13 < Chris_Stewart_5> Can anyone answer this question? 'What does the CScriptNum nMaxNumSize parameter do?' 10:13 -!- Guest58 [~Guest58@194.213.49.62] has joined #bitcoin-core-pr-reviews 10:14 < stickies-v> it represents the max size of the stack item we're evaluating 10:16 < stickies-v> do we ever change nMaxNumSize, btw? or is it always 4? 10:16 < Chris_Stewart_5> and what happens if the stack item is larger than nMaxNumSize? 10:16 < stickies-v> throw scriptnum_error 10:16 < abubakarsadiq> to limit the opcode numerical operation on `nMaxNumSize ` number of bytes 10:16 < Chris_Stewart_5> abubakarsadiq: Yes! 10:16 < Chris_Stewart_5> stickies-v: :+1: 10:16 < Chris_Stewart_5> Ok, so now i'm going to skip ahead on our questions to the next logical one 10:16 < abubakarsadiq> why scriptnum_error not just push `False`? 10:17 < Chris_Stewart_5> Its a bit more difficult, but if you look through interpreter.cpp you should find it 10:17 < Chris_Stewart_5> 'What 2 opcodes accept 5 byte numeric inputs?' 10:17 < Chris_Stewart_5> abubakarsadiq: I like how you think! That is what my 64bit PR does :-). Check out the 10:18 < stickies-v> yeah just found one: https://github.com/bitcoin/bitcoin/blob/b50554babdddf452acaa51bac757736766c70e81/src/script/interpreter.cpp#L545 10:18 < Chris_Stewart_5> abubakarsadiq: 'How arithmetic works with #29221' section on this page: https://bitcoincore.reviews/29221 10:18 < stickies-v> OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY 10:19 < Chris_Stewart_5> stickies-v: Yes! So the key point here is we already have carve outs for specific opcodes we have implemented that are time sensitive. For others following along, I recommend reading the comments in the c++ codebase for 'why we need 5 byte inputs for numbers related to time' 10:19 < abubakarsadiq> Also I have a question while reading the BIP why are we introducing new opcodes that does the same thing with current opcodes but with 64 bit values, why not just upgrade the old ones to support both 32 and 64 bit? 10:20 < abubakarsadiq> thanks for the link @Chris_Stewart_5 10:20 < Chris_Stewart_5> abubakarsadiq: Ok this is a great question, and i'm currently prototyping an implementation that does just this. I've been asking myself the same question lately that it may not be necessary to make new opcodes, rather re-purpose old ones. 10:21 < Chris_Stewart_5> abubakarsadiq: I'm going to table discussion on that topic for now as it is not what is in #29221, but if you would like to see what that looks like follow my work on this branch: https://github.com/Christewart/bitcoin/tree/64bit-arith-implicit 10:22 < Chris_Stewart_5> So back to CScriptNum -- which is the data structure we use to represent numbers in Script currently 10:22 < abubakarsadiq> I will like that! and thanks for the link again 10:22 < Chris_Stewart_5> Can anyone answer this question: 'Why was the fRequireMinimal flag introduced to CScriptNum?' 10:22 < stickies-v> (those seem to be the only 2 use cases btw, everything compiles when patching those 2 lines in OP_CHECKLOCKTIMEVERIFY and OP_CHECKSEQUENCEVERIFY and then removing nMaxNumSize altogether) 10:23 < glozow> PR 5065 links to BIP62, which mentions "zero-padded number pushes" as a source of malleability. So we require minimal representation i.e. no zero-padding 10:23 -!- Guest17 [~Guest17@97-125-151-69.desm.qwest.net] has joined #bitcoin-core-pr-reviews 10:23 -!- Guest17 [~Guest17@97-125-151-69.desm.qwest.net] has quit [Client Quit] 10:24 < Chris_Stewart_5> stickies-v: yes :-) 10:24 < Chris_Stewart_5> glozow: Yes! Before hand we were vulnerable to malleability attacks. Since CScriptNum has a _variable length_ encoding, numbers can be represented multiple ways 10:25 -!- Guest17 [~Guest17@97-125-151-69.desm.qwest.net] has joined #bitcoin-core-pr-reviews 10:25 < Chris_Stewart_5> for instance, zero can be encoded as [], 0x00, 0x0000, 0x0000000 and so forth. There also is a negative zero :-) 10:25 -!- Guest17 [~Guest17@97-125-151-69.desm.qwest.net] has quit [Client Quit] 10:26 < abubakarsadiq> Negative zero? 10:26 < Chris_Stewart_5> A wise guy on on the p2p network would modify your zero encoding and change your txid making you (potentially) lose track of your transaction. This is allegedly what took MtGox down 10:27 < Chris_Stewart_5> abubakarsadiq: yes sir! https://github.com/bitcoin/bitcoin/blob/b50554babdddf452acaa51bac757736766c70e81/src/script/script.h#L256 10:27 < Chris_Stewart_5> So malleability is obviously a big problem, and this was partially addressed by segwit, but here is the next question 10:27 < Chris_Stewart_5> 'Is #29221 malleability safe? Why?' 10:30 < stickies-v> I think it is because we ensure for a size of 8 bytes here? https://github.com/bitcoin/bitcoin/pull/29221/files#diff-a0337ffd7259e8c7c9a7786d6dbd420c80abfa1afdb34ebae3261109d9ae3c19R1253 10:31 < stickies-v> (both operands) 10:31 < Chris_Stewart_5> stickies-v: Exactly. The current implementation in #29221 uses a _fixed length_ number encoding rather than a _variable length_ number encoding used by CScriptNum 10:31 < Chris_Stewart_5> The fixed length is 8 bytes. 10:32 < Chris_Stewart_5> Some pushback that I have got on this proposal is that it will increase the blockchain size. If you want to read more about my rebuttal to that please see this link: https://delvingbitcoin.org/t/64-bit-arithmetic-soft-fork/397/34?u=chris_stewart_5 10:33 < stickies-v> what's the rationale behind the fixed length approach? is it mostly to make implementation simpler (and thus more bug-proof), at the cost of (slightly? i don't know) higher scripts? 10:33 < stickies-v> *bigger scripts, not higher 10:33 < Chris_Stewart_5> stickies-v: Exactly. In raw bytes, Scripts will be larger. I did an analysis of the mainnet blockchain and found that it would be ~1GB (0.17%) larger if this proposal was enacted from the genesis block. 10:34 < stickies-v> and did you try implementing it with var length too? is it a big diff? 10:35 < glozow> would that just entail creating `CScriptNum`s with `nMaxNumSize=8`? 10:35 < Chris_Stewart_5> stickies-v: I have implemented 64bit arithmetic with CScriptNum (and thus giving us a variable length), you can find the branch here if you are curious: https://github.com/Christewart/bitcoin/tree/64bit-arith-cscriptnum 10:36 < stickies-v> cool, thanks! 10:36 < Chris_Stewart_5> stickies-v: In terms of analyzing blockchain usage patterns, it is difficult to say what the size increase would be. It would be smaller than the fixed length proposal, but since we cannot use 8 byte CScriptNums, we can't make assumptions about how much larger the chain would be since genesis 10:37 < Chris_Stewart_5> glozow: yes. 10:37 < glozow> Would it not be simpler to just use `CScriptNum` everywhere...? 10:37 < Chris_Stewart_5> and this is a great segway to my next question 10:38 < Chris_Stewart_5> This question is a bit more involved, so I"m going to paste it into this IRC chat with the Script example 10:38 < Chris_Stewart_5> Q: The Script in the Explicit conversion op codes section will not work. Can you guess why? Hint: it has something to do with OP_LE64TOSCRIPTNUM. 10:38 < Chris_Stewart_5> Script: 0x000e876481700000 0x000e876481700000 OP_ADD64 OP_DROP OP_LE64TOSCRIPTNUM OP_SIZE OP_8 OP_EQUALVERIFY OP_SCRIPTNUMTOLE64 0x001d0ed902e00000 OP_EQUAL 10:39 < Chris_Stewart_5> Look closely at OP_LE64TOSCRIPTNUM, here is the link to the impl for convinience: https://github.com/bitcoin/bitcoin/blob/bc772fe8f4ab37d97bfd68a47b67a92a45ac494a/src/script/interpreter.cpp#L1353 10:40 < Chris_Stewart_5> I'll give another hint in a couple minutes if no one sees it 10:40 < glozow> is that value larger than what can be held? 10:40 < Chris_Stewart_5> glozow: Yes! Because of what parameter? 10:40 < glozow> nDefaultMaxNumSize 10:41 < glozow> ? 10:41 < Chris_Stewart_5> glozow: Yes! So this presents a fundamental problem with the design of this PR currently, and is why i'm working on alternative designs 10:42 < Chris_Stewart_5> The problem is, 'How do I get the _new_ number format that supports 8 bytes to interop with legacy opcodes that only support 4 bytes (5 bytes in the case of the locktime op codes) 10:43 -!- ion-97 [~ion-@2a02:1388:82:378:848b:a3b1:2467:35bc] has joined #bitcoin-core-pr-reviews 10:43 -!- ion- [~ion-@2a02:587:4b6d:1a00:cd99:c17a:7056:8e30] has quit [Quit: Client closed] 10:43 -!- ion-97 [~ion-@2a02:1388:82:378:848b:a3b1:2467:35bc] has quit [Client Quit] 10:43 -!- ion- [~ion-@2a02:1388:82:378:848b:a3b1:2467:35bc] has joined #bitcoin-core-pr-reviews 10:43 < stickies-v> should OP_LE64TOSCRIPTNUM also return a tuple to be consistent with the other new opcodes? 10:43 < Chris_Stewart_5> This is why I have an alternative implementation of OP_SIZE -- as an example -- in the webpage 10:43 < stickies-v> (true/false for success) 10:44 < Chris_Stewart_5> stickies-v: That is a great idea. Although it doesn't solve the fundamental problem, it at least introduces error handling capability 10:44 -!- ion- [~ion-@2a02:1388:82:378:848b:a3b1:2467:35bc] has quit [Client Quit] 10:45 < stickies-v> yeah and i'm also intuitively not a huge fan of all these op_drops we now require, but i've only had a rather cursory look 10:45 < Chris_Stewart_5> stickies-v: If you were writing a production Script, the OP_DROP should be replaced with OP_IF OP_ELSE and then you handle the failure case in the OP_ELSE clause. Since these are demo Scripts I cheated a bit :-) 10:47 < Chris_Stewart_5> Do people understand the fundamental problem introduced by a _larger_ (8 bytes, in our case) number format than the existing number format (4 bytes, occasionally 5 bytes)? This is a really key point and i'm happy to answer any more questions on the topic since it is absolutely crucial to understand imo 10:49 < stickies-v> sorry - unrelated question, is there any debate around whether these new opcodes should indeed return a success code? is this something that's absolutely required for the proposal to work? 10:50 < Chris_Stewart_5> stickies-v: Do you mean pushing true/false onto the stack to indicate success/failure of the opcode? 10:50 < stickies-v> yeah 10:50 < stickies-v> i think it's nice that we allow scripts to gracefully handle overflows btw, but the downside is that we're forcing the cost even for scripts that don't require it, so just wondering how essential that is? 10:51 < Chris_Stewart_5> stickies-v: I don't think its absolutely required, no. It provides better developer ergonomics, imo. But that is a personal preference ig. FWIW, that was a design choice I pulled over from elements. 10:51 -!- ion- [~ion-@2a02:1388:82:378:848b:a3b1:2467:35bc] has joined #bitcoin-core-pr-reviews 10:52 < stickies-v> cool, thanks 10:52 < Chris_Stewart_5> np :-) 10:53 < Chris_Stewart_5> This Q was already somewhat addressed by abubakarsadiq 10:53 < Chris_Stewart_5> Q: What should we do with the old opcodes (OP_ADD, OP_SUB)? 10:54 < Guest93> I didn't realise we were replacing the opcodes 10:56 < Chris_Stewart_5> Guest93: So we are currently allocating new opcodes, you see them here: https://github.com/bitcoin/bitcoin/blob/bc772fe8f4ab37d97bfd68a47b67a92a45ac494a/src/script/script.h#L213 10:56 < stickies-v> if we're modifying the current opcodes to allow both 32 and 64 bit arithmetic, as suggested earlier, perhaps we can skip the success codes and _potentially_ add OP_ADDSAFE, OP_SUBSAFE etc opcodes in the future if there's developer demand? 10:57 < stickies-v> s/developer/user 10:57 < Chris_Stewart_5> stickies-v: I don't believe it is necessary to retain _old_ semantics for _new_ soft forks. I'm working on this implementation, so I haven't 100% confirmed it yet. 10:58 < Chris_Stewart_5> For instance, pre TAPSCRIPT_64BIT we throw exceptions when there is overflows with OP_ADD, but if `sigversion == SigVersion::TAPSCRIPT_64BIT` we can redefine semantics to push true/false onto the stack, accept upto 8 byte numeric inputs etc 10:59 < Chris_Stewart_5> to add even more fuel to the fire, I believe (again, haven't coded to confirm) that we could use this same mechanism to extend OP_ADD in the future to accept even bigger inputs, such as 256bit scalars. This is something that people are already wanting it seems on delvingbitcoin 11:00 < Chris_Stewart_5> Thank you everyone for coming out and asking GREAT questions. I'm happy to keep the convo going on irc, twitter, github etc. Don't hesitate to reach out! 11:00 < stickies-v> i'm very unfamiliar with script, so apologies if this doesn't make sense, but i guess where i'm getting at is it seems like this PR is trying to do 2 things: introduce 64 bit arithmetic, and allow scripts to handle overflows through success codes, and maybe it's better to do those separately and just do 64 bit here? 11:00 -!- Guest25 [~Guest58@185.44.146.84] has joined #bitcoin-core-pr-reviews 11:01 < glozow> thanks so much Chris_Stewart_5, learned a lot! 11:01 < stickies-v> thanks for hosting and writing out such extensive notes Chris_Stewart_5 , learned a lot today! 11:01 < Chris_Stewart_5> stickies-v: That is a very reasonable take. Unfortunately with the pace we deploy soft forks (every ~4 years), you have a tendency to want to cram as much in as possible :-) 11:01 < Chris_Stewart_5> #endmeeting 11:02 -!- Guest25 [~Guest58@185.44.146.84] has quit [Client Quit] 11:02 < abubakarsadiq> Thanks everyone and @Chris_Stewart_5 11:02 < Chris_Stewart_5> I'm heading to the gym rn, but i'll come back and look at this later to see if there were anymore questions asked, or feel free to DM. Thanks again everyone! 11:02 < stickies-v> they can be in different PR/s BIPs and still be in the same soft fork if it makes sense to activate together, of course 11:03 < abubakarsadiq> I also agree separating them, will make it easy to comprehend the changes. 11:03 -!- ion- [~ion-@2a02:1388:82:378:848b:a3b1:2467:35bc] has quit [Quit: Client closed] 11:09 -!- Guest93 [~Guest42@212.129.76.47] has quit [Quit: Client closed] 11:15 -!- Talkless [~Talkless@mail.dargis.net] has joined #bitcoin-core-pr-reviews 11:16 < emzy> Thanks everyone and @Chris_Stewart_5 11:38 -!- tdb3 [~tdb3@ip74-208-205-30.pbiaas.com] has quit [] 11:39 -!- tdb3 [~tdb3@ip74-208-205-30.pbiaas.com] has joined #bitcoin-core-pr-reviews 11:44 -!- tdb3 [~tdb3@ip74-208-205-30.pbiaas.com] has quit [Client Quit] 11:45 -!- tdb3 [~tdb3@ip74-208-205-30.pbiaas.com] has joined #bitcoin-core-pr-reviews 11:53 -!- grettke [~grettke@184-055-133-000.res.spectrum.com] has joined #bitcoin-core-pr-reviews 12:19 -!- tdb3 [~tdb3@ip74-208-205-30.pbiaas.com] has quit [Ping timeout: 268 seconds] 12:28 -!- Talkless [~Talkless@mail.dargis.net] has quit [Ping timeout: 264 seconds] 12:35 -!- tdb3 [~tdb3@ip74-208-205-30.pbiaas.com] has joined #bitcoin-core-pr-reviews 12:37 -!- tdb3 [~tdb3@ip74-208-205-30.pbiaas.com] has quit [Client Quit] 12:53 -!- tdb3 [~tdb3@ip74-208-205-30.pbiaas.com] has joined #bitcoin-core-pr-reviews 13:35 -!- Guest58 [~Guest58@194.213.49.62] has quit [Quit: Client closed] 13:56 -!- cbergqvist [~chris@84-216-185-21.customers.ownit.se] has joined #bitcoin-core-pr-reviews 14:28 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has quit [Remote host closed the connection] 14:29 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has joined #bitcoin-core-pr-reviews 14:52 -!- maflcko [~none@107.172.8.183] has quit [Quit: ZNC 1.8.2+deb2build5 - https://znc.in] 14:52 -!- maflcko [~none@107.172.8.183] has joined #bitcoin-core-pr-reviews 14:57 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has quit [Remote host closed the connection] 15:00 -!- kevkevin [~kevkevin@98.226.43.69] has joined #bitcoin-core-pr-reviews 15:00 -!- kevkevin [~kevkevin@98.226.43.69] has quit [Read error: Connection reset by peer] 15:01 -!- abubakarsadiq [uid602234@id-602234.hampstead.irccloud.com] has quit [Quit: Connection closed for inactivity] 15:18 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has joined #bitcoin-core-pr-reviews 15:23 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has quit [Ping timeout: 260 seconds] 15:45 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has joined #bitcoin-core-pr-reviews 15:51 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has quit [Ping timeout: 272 seconds] 16:21 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has joined #bitcoin-core-pr-reviews 16:28 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has quit [Ping timeout: 255 seconds] 16:42 -!- kevkevin [~kevkevin@2601:241:8703:7b30:f51b:83a:eb99:a9c2] has joined #bitcoin-core-pr-reviews 16:47 -!- kevkevin [~kevkevin@2601:241:8703:7b30:f51b:83a:eb99:a9c2] has quit [Ping timeout: 260 seconds] 17:01 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has joined #bitcoin-core-pr-reviews 17:14 -!- jonatack [~jonatack@user/jonatack] has joined #bitcoin-core-pr-reviews 17:19 -!- jonatack [~jonatack@user/jonatack] has quit [Ping timeout: 272 seconds] 17:33 -!- jonatack [~jonatack@user/jonatack] has joined #bitcoin-core-pr-reviews 18:59 -!- jon_atack [~jonatack@user/jonatack] has joined #bitcoin-core-pr-reviews 19:01 -!- jonatack [~jonatack@user/jonatack] has quit [Ping timeout: 272 seconds] 19:12 -!- pablomartin [~pablomart@194.156.224.75] has quit [Ping timeout: 268 seconds] 21:21 -!- grettke [~grettke@184-055-133-000.res.spectrum.com] has quit [Quit: grettke] 21:22 -!- puchka [~puchka@185.203.122.26] has quit [Ping timeout: 260 seconds] 21:25 -!- puchka [~puchka@185.203.122.200] has joined #bitcoin-core-pr-reviews 21:51 -!- Chris_Stewart_5 [~Chris_Ste@68.235.43.36] has quit [Ping timeout: 272 seconds] 21:52 -!- Chris_Stewart_5 [~Chris_Ste@68.235.43.45] has joined #bitcoin-core-pr-reviews 22:28 < _aj_> Chris_Stewart_5: s/segway/segue/ 23:49 -!- kevkevin [~kevkevin@2601:241:8703:7b30:30ec:e2d7:c57f:e22e] has quit [Remote host closed the connection] --- Log closed Thu Mar 21 00:00:33 2024