Script Restoration BIPs: fix OP_RIGHT definition, clarify and adjust costing with wordspan notation, UPSHIFT, CLTV/CSV, final success-check #2204

pull jmoik wants to merge 2 commits into bitcoin:master from jmoik:gsr changing 2 files +110 −66
  1. jmoik commented at 2:41 PM on June 27, 2026: none

    BIP-0440: clarify wordspan costs

    BIP-0441: update wordspan costs and fix OP_RIGHT

    • Apply BIP-0440 wordspan notation to numeric and bitvector costs.

    • Define OP_RIGHT as rightmost-byte extraction with bounded copying cost.

    • Clarify OP_UPSHIFT, CLTV/CSV, and final success-check costs.

  2. BIP-0440: clarify wordspan costs 503939b53d
  3. BIP-0441: update wordspan costs and OP_RIGHT
    - Apply BIP-0440 wordspan notation to numeric and bitvector costs.
    
    - Define OP_RIGHT as rightmost-byte extraction with bounded copying cost.
    
    - Clarify OP_UPSHIFT, CLTV/CSV, and final success-check costs.
    e840999d2d
  4. jmoik marked this as ready for review on Jun 27, 2026
  5. jonatack added the label BIP Update by Owner on Jun 28, 2026
  6. jonatack added the label Bug fix on Jun 28, 2026
  7. in bip-0440.mediawiki:351 in e840999d2d
     347 | @@ -331,6 +348,7 @@ Work in progress:
     348 |  
     349 |  ==Changelog==
     350 |  
     351 | +* 0.2.1: 2026-06-15: define wordspan notation and clarify byte-length versus word-span costs.
    


    jonatack commented at 7:53 PM on June 28, 2026:

    It may not matter, but in both changelog additions in this pull, the date is two weeks ago.


    jmoik commented at 9:44 AM on July 1, 2026:

    Thanks for reviewing!

    I don't think the changes are substantial enough to provide value for the mailing list, the OP_RIGHT definition was simply a mistake it seems, it now corresponds to the historical and the more natural semantics. I would give some time for @rustyrussell to take a look at the diff, but otherwise fine from my side.


    murchandamus commented at 5:30 PM on July 15, 2026:

    Are you still waiting for @rustyrussell to take a look, or is this ready to go?


    jmoik commented at 6:55 PM on July 15, 2026:

    Well he seems to be unresponsive so good to merge from my side.

  8. jonatack commented at 7:56 PM on June 28, 2026: member

    I don't see any obvious errors in this change.

    Are you waiting for review from anyone, or do you plan to send a mail list post to discuss?

  9. in bip-0441.mediawiki:692 in e840999d2d
     692 |  
     693 | -We increase the length of B here to the next word boundary, using
     694 | -"((length(B) + 7) / 8) * 8", as the multiplication below makes the
     695 | -difference of that from the simple "length(B)" significant.
     696 | +We increase the operand lengths to the next word boundary for the word-span
     697 | +loops, using <code>wordspan(n)</code> from [[bip-0440.mediawiki|BIP440]], as
    


    murchandamus commented at 7:17 PM on July 15, 2026:

    Nano-consistency-nit: BIP440 speaks of <code>wordspan(X)</code>, while this line calls it <code>wordspan(n)</code>.

  10. murchandamus approved
  11. murchandamus commented at 7:19 PM on July 15, 2026: member

    LGTM, the wordspan notation looks very helpful.

    Given the triviality of the nit I commented on, I’ll merge this PR in a couple days if there is no update, but if you want to fix it or something else, please feel free to update.

  12. murchandamus merged this on Jul 16, 2026
  13. murchandamus closed this on Jul 16, 2026


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: 2026-07-22 08:10 UTC

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