0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-04 10:07:27 -05:00
bitcoin-bitcoin-core/src/script
Andrew Chow 58da1619be
Merge bitcoin/bitcoin#25877: refactor: Do not use CScript for tapleaf scripts until the tapleaf version is known
dee89438b8 Abstract out ComputeTapbranchHash (Russell O'Connor)
8e3fc99427 Do not use CScript for tapleaf scripts until the tapleaf version is known (Russell O'Connor)

Pull request description:

  While BIP-341 calls the contents of tapleaf a "script", only in the case that the tapleaf version is `0xc0` is this script known to be a tapscript.  Otherwise the tapleaf "script" is simply an uninterpreted string of bytes.

  This PR corrects the issue where the type `CScript` is used prior to the tapleaf version being known to be a tapscript.  This prevents `CScript` methods from erroneously being called on non-tapscript data.

  A second commit abstracts out the TapBranch hash computation in the same manner that the TapLeaf computation is already abstracted.  These two abstractions ensure that the TapLeaf and TapBranch tagged hashes are always constructed properly.

ACKs for top commit:
  ajtowns:
    ACK dee89438b8
  instagibbs:
    ACK dee89438b8
  achow101:
    ACK dee89438b8
  sipa:
    ACK dee89438b8
  aureleoules:
    reACK dee89438b8 - I verified that there is no behavior change.

Tree-SHA512: 4a1d37f3e9a1890e7f5eadcf65562688cc451389581fe6e2da0feb2368708edacdd95392578d8afff05270d88fc61dce732d83d1063d84d12cf47b5f4633ec7e
2023-01-19 17:51:21 -05:00
..
bitcoinconsensus.cpp Merge bitcoin/bitcoin#26691: Update secp256k1 subtree to libsecp256k1 version 0.2.0 2023-01-13 09:40:57 +00:00
bitcoinconsensus.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
descriptor.cpp Do not use CScript for tapleaf scripts until the tapleaf version is known 2022-11-21 12:38:53 -05:00
descriptor.h scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
interpreter.cpp Merge bitcoin/bitcoin#25877: refactor: Do not use CScript for tapleaf scripts until the tapleaf version is known 2023-01-19 17:51:21 -05:00
interpreter.h Merge bitcoin/bitcoin#25877: refactor: Do not use CScript for tapleaf scripts until the tapleaf version is known 2023-01-19 17:51:21 -05:00
keyorigin.h Implement operator< for KeyOriginInfo and CExtPubKey 2021-12-10 08:29:47 -05:00
miniscript.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
miniscript.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
script.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
script.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
script_error.cpp Implement Tapscript script validation rules (BIP 342) 2020-10-12 17:18:24 -07:00
script_error.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
sigcache.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
sigcache.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
sign.cpp Merge bitcoin/bitcoin#25877: refactor: Do not use CScript for tapleaf scripts until the tapleaf version is known 2023-01-19 17:51:21 -05:00
sign.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
signingprovider.cpp scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
signingprovider.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
standard.cpp Merge bitcoin/bitcoin#25877: refactor: Do not use CScript for tapleaf scripts until the tapleaf version is known 2023-01-19 17:51:21 -05:00
standard.h Merge bitcoin/bitcoin#25877: refactor: Do not use CScript for tapleaf scripts until the tapleaf version is known 2023-01-19 17:51:21 -05:00