Add test for negative transaction version w/ CSV to tx_valid.json #29291

pull Christewart wants to merge 1 commits into bitcoin:master from Christewart:2024-01-11-locktime-neg-txversion-test changing 1 files +4 −0
  1. Christewart commented at 2:56 PM on January 22, 2024: contributor

    This PR adds a static test vector corresponding to the bug found in various implementations of the bitcoin protocol discovered by dergoegge

    For more information see:

    https://delvingbitcoin.org/t/disclosure-btcd-consensus-bugs-due-to-usage-of-signed-transaction-version/455

  2. Add test for negative transaction version w/ CSV to tx_valid.json 97181decf5
  3. DrahtBot commented at 2:56 PM on January 22, 2024: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK dergoegge, darosior
    Concept ACK jamesob

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. Christewart marked this as ready for review on Jan 22, 2024
  5. dergoegge approved
  6. dergoegge commented at 4:14 PM on January 22, 2024: member

    ACK 97181decf5726aab6c5cd01b3e1964072f2531ff

  7. darosior commented at 6:27 PM on January 22, 2024: member

    ACK 97181decf5726aab6c5cd01b3e1964072f2531ff

  8. jamesob commented at 7:39 PM on January 22, 2024: contributor

    ACK. Somewhat surprisingly, decoderawtransaction is showing a positive version number:

    % ./src/bitcoin-cli decoderawtransaction "ffffffff01000100000000000000000000000000000000000000000000000000000000000000000000030251b2010000000100000000000000000000000000"
    {
      "txid": "d3230b80abeab3cf6c1c0f1c55c3694545146b1936348476bf3646276af83d38",
      "hash": "d3230b80abeab3cf6c1c0f1c55c3694545146b1936348476bf3646276af83d38",
      "version": 4294967295,
      "size": 63,
      "vsize": 63,
      "weight": 252,
      "locktime": 0,
      "vin": [
        {
          "txid": "0000000000000000000000000000000000000000000000000000000000000100",
          "vout": 0,
          "scriptSig": {
            "asm": "-12881",
            "hex": "0251b2"
          },
          "sequence": 1
        }
      ],
      "vout": [
        {
          "value": 0.00000000,
          "n": 0,
          "scriptPubKey": {
            "asm": "",
            "desc": "raw()#58lrscpx",
            "hex": "",
            "type": "nonstandard"
          }
        }
      ]
    }
    

    There's this note in TxToUniv().

    (Edit: pasted wrong terminal output)

  9. Roasbeef commented at 8:40 PM on January 22, 2024: none

    ACK. Somewhat surprisingly, decoderawtransaction is showing a positive version number:

    From 2019 onwards, bitcoind started to display transactions versions (on the RPC layer) as unsigned everywhere: #16525

    Interestingly, prior to that in 2018, an attempt was made to do the same, but rejected under the basis that it's actually signed everywhere with one exception: #12430 (comment)

    This bitcoind PR that merged was prompted by a rust-bitcoin issue pointing out they were using a u32 instead of a i32 for their transaction struct: https://github.com/rust-bitcoin/rust-bitcoin/issues/287

  10. fanquake merged this on Jan 23, 2024
  11. fanquake closed this on Jan 23, 2024

  12. azuchi referenced this in commit 084b86e99e on Jan 24, 2024
  13. bitcoin locked this on Jan 22, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 06:13 UTC

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