64bit arithmetic op codes #1538

pull Christewart wants to merge 13 commits into bitcoin:master from Christewart:2023-09-11-64bit-arith changing 1 files +302 −0
  1. Christewart commented at 8:44 pm on January 10, 2024: contributor

    This BIP describes a soft fork to add 64-bit arithmetic op codes to bitcoin

    Implementation: https://github.com/bitcoin/bitcoin/pull/29221

  2. WIP d0aafd9001
  3. Add section on overflows 54350b53c5
  4. Add credit to Sanket and Andrew b11e06e1e8
  5. fix code formatting 8bbf62764d
  6. Fix hyperlinks 5d52ff3212
  7. Add link to elements impl 464ce8eb4d
  8. Add helper methods 9da332cefd
  9. Add conversion opcodes b5d0fe5bbd
  10. Remove push4_le as its not used in reference impl 571390589b
  11. Add specifics for OP_DIV64 1c8a5af1d1
  12. Remove BIP number 243db3fc67
  13. Remove uncessary sequence requirement d1c90b0f0a
  14. Christewart renamed this:
    64bit arithetmic op codes
    64bit arithmetic op codes
    on Jan 10, 2024
  15. Christewart marked this as ready for review on Jan 10, 2024
  16. khademreza5 approved
  17. EthanHeilman commented at 4:54 pm on January 17, 2024: contributor

    Why not push the overflow amount and the result back on the stack?

    Rather than $2^{64}-1 + 3 = \mbox{FALSE}$, do $2^{64}-1 + 3 = 2, 1$. Where $2 = 2^{64}-1 + 3 \mod 2^{64}$ is the result and 1 is the overflow.

    This would simply doing 256-bit math from 64-bit stack elements and I don’t see any downsides for 64-bit operations.

  18. Remove OP_DIV64 from other opcodes 5bebdd18d4
  19. Christewart commented at 9:01 pm on February 1, 2024: contributor

    Why not push the overflow amount and the result back on the stack?

    Rather than 264−1+3=FALSE, do 264−1+3=2,1. Where 2=264−1+3mod264 is the result and 1 is the overflow.

    This would simply doing 256-bit math from 64-bit stack elements and I don’t see any downsides for 64-bit operations.

    Sorry I don’t understand this. Could you maybe give a more concrete example, perhaps on delvingbitcoin? We have a thread going here: https://delvingbitcoin.org/t/64-bit-arithmetic-soft-fork/397/25

  20. in bip-0364.mediawiki:7 in 5bebdd18d4
    0@@ -0,0 +1,302 @@
    1+<pre>
    2+  BIP: TBD
    3+  Layer: Consensus (soft fork)
    4+  Title: 64 bit arithmetic operations
    5+  Author: Chris Stewart <stewart.chris1234@gmail.com>
    6+  Comments-Summary: No comments yet.
    7+  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0364
    


    murchandamus commented at 7:21 pm on May 1, 2024:
    Please refrain from issuing your own BIP numbers.
  21. in bip-0364.mediawiki:4 in 5bebdd18d4
    0@@ -0,0 +1,302 @@
    1+<pre>
    2+  BIP: TBD
    3+  Layer: Consensus (soft fork)
    4+  Title: 64 bit arithmetic operations
    


    murchandamus commented at 7:21 pm on May 1, 2024:

    Maybe:

    0  Title: 64-bit arithmetic operations
    
  22. murchandamus changes_requested
  23. murchandamus commented at 7:28 pm on May 1, 2024: contributor

    I just did a light first pass. I noticed that this document may be missing a Rationale Section that describes design decisions, alternate approaches, and related work, and a Backwards Compatibility section.

    You may want to add the “Post-History” header to the preamble to link to discussions of this proposal on the mailing list or forums.

  24. murchandamus added the label New BIP on May 8, 2024
  25. murchandamus added the label PR Author action required on May 8, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-01 00:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me