Add locktime threshold definition to BIP65 #1813

pull Christewart wants to merge 3 commits into bitcoin:master from Christewart:2025-04-07-locktimethreshold changing 1 files +2 −0
  1. Christewart commented at 4:17 pm on April 7, 2025: contributor
    I don’t believe it is defined, just referenced as a c++ value LOCKTIME_THRESHOLD.
  2. Add locktime threshold definition to BIP65 16f55c4c83
  3. Christewart force-pushed on Apr 7, 2025
  4. jonatack added the label Proposed BIP modification on Apr 7, 2025
  5. jonatack added the label Pending acceptance on Apr 7, 2025
  6. in bip-0065.mediawiki:42 in 16f55c4c83 outdated
    38@@ -39,6 +39,8 @@ indirectly verify that the desired block height or block time has been reached;
    39 until that block height or block time has been reached the transaction output
    40 remains unspendable.
    41 
    42+The locktime threshold is 500,000,000. Numbers below this threshold are interpreted
    


    jonatack commented at 4:23 pm on April 7, 2025:
    0The locktime threshold (`LOCKTIME_THRESHOLD` below) is 500,000,000. Numbers below this threshold are interpreted
    
  7. in bip-0065.mediawiki:43 in 16f55c4c83 outdated
    38@@ -39,6 +39,8 @@ indirectly verify that the desired block height or block time has been reached;
    39 until that block height or block time has been reached the transaction output
    40 remains unspendable.
    41 
    42+The locktime threshold is 500,000,000. Numbers below this threshold are interpreted
    43+as block height locktimes. Numbers greater than or equal to this threshold are interpreted as wall clock time locktimes.
    


    jonatack commented at 4:25 pm on April 7, 2025:
    0as block height locktimes. Numbers greater than or equal to this threshold are interpreted as wall clock (UNIX timestamp) locktimes.
    

    (perhaps also s/numbers/values/ here and in the preceding line, feel free to ignore)

  8. jonatack commented at 4:28 pm on April 7, 2025: member

    cc BIP author @petertodd for feedback

    Current definition in Bitcoin Core in src/script/script.h:

    0// Threshold for nLockTime: below this value it is interpreted as block number,
    1// otherwise as UNIX timestamp.
    2static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov  5 00:53:20 1985 UTC
    
  9. Update bip-0065.mediawiki
    Co-authored-by: Jon Atack <jon@atack.com>
    acf11b4f5b
  10. Update bip-0065.mediawiki
    Co-authored-by: Jon Atack <jon@atack.com>
    372c1da0ba
  11. in bip-0065.mediawiki:43 in 372c1da0ba
    38@@ -39,6 +39,8 @@ indirectly verify that the desired block height or block time has been reached;
    39 until that block height or block time has been reached the transaction output
    40 remains unspendable.
    41 
    42+The locktime threshold (`LOCKTIME_THRESHOLD`) is 500,000,000. Numbers below this threshold are interpreted
    43+as block height locktimes. Numbers greater than or equal to this threshold are interpreted as wall clock (UNIX timestamp) locktimes.
    


    jonatack commented at 4:34 pm on April 7, 2025:
    (pico-nit, the BIP currently spells “locktime” as “lock-time” in line 29)
  12. vostrnad commented at 5:37 pm on April 7, 2025: contributor
    Pre-BIP consensus rules are defined in the code, and usually not referenced and assumed to be known (e.g. some BIPs use the concept of compact size without explaining it). You can’t really “define” the locktime threshold here, as it has already been defined (in this case in Bitcoin v0.1). What this really adds is a clarification, and as such (if it’s needed at all) it probably belongs in a footnote.
  13. petertodd commented at 11:14 am on April 8, 2025: contributor

    NACK

    The definition is the C++ codebase. The textual summary is just a summary and can’t be relied on for precise semantics; leaving out the LOCKTIME_THRESHOLD definition correctly points readers in that direction.

  14. jonatack commented at 2:19 pm on April 8, 2025: member
    Thank you @Christewart for the proposal. Closing for now per BIP author NACK.
  15. jonatack closed this on Apr 8, 2025


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: 2025-04-19 01:10 UTC

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