bitcoin/src/script
merge-script d7f56cc5d9
Merge bitcoin/bitcoin#31590: descriptors: Try pubkeys of both parities when retrieving the private keys for an xonly pubkey in a descriptor
c0045e6cee Add test for multipath miniscript expression (David Gumberg)
b4ac48090f descriptor: Use InferXOnlyPubkey for miniscript XOnly pubkey from script (Ava Chow)
4c50c21f6b tests: Check ExpandPrivate matches for both parsed descriptors (Ava Chow)
092569e858 descriptor: Try the other parity in ConstPubkeyProvider::GetPrivKey() (Ava Chow)

Pull request description:

  When a `ConstPubkeyProvider` is xonly, the stored pubkey does not necessarily have the correct parity bit. `ToPrivateString()` is correctly handling this by looking up the keys for both parity bits, but `GetPrivKey` does not. This results in not finding the private key when it is actually available if its pubkey has the other parity bit value.

  To fix this, this key finding is refactored into `GetPrivKey()` so that its behavior is corrected, and `ToPrivateString()` is changed to use `GetPrivKey()` as well.

  Additionally, the descriptor test checks are updated to include a check for `ExpandPrivate()` to verify that both the parsed public and private descriptors produce `SigningProvider`s with the same contents.

  Fixes #31589

ACKs for top commit:
  Pttn:
    ACK c0045e6cee
  davidgumberg:
    utACK c0045e6cee
  kevkevinpal:
    Concept and Code review ACK [c0045e6](c0045e6cee)
  furszy:
    ACK c0045e6cee
  theStack:
    re-ACK c0045e6cee
  rkrux:
    Concept ACK c0045e6cee

Tree-SHA512: 3dcf2a802b996e0680a3f819075e5a689eb22e484c81ea79b40ec04197ee4ba3f6b9c87c45dfe8a847c9b805b2fd0fad77ffb92a93e65dc3aad74d69d9e3d97f
2025-01-21 10:20:13 +00:00
..
descriptor.cpp descriptor: Use InferXOnlyPubkey for miniscript XOnly pubkey from script 2025-01-06 19:10:54 -05:00
descriptor.h descriptors: Change Parse to return vector of descriptors 2024-08-08 12:47:22 -04:00
interpreter.cpp Fix unsigned integer overflows in interpreter 2024-10-01 10:45:44 +02:00
interpreter.h interpreter: Use the same type for SignatureHash in the definition 2024-11-25 15:36:05 +01:00
keyorigin.h Implement operator< for KeyOriginInfo and CExtPubKey 2021-12-10 08:29:47 -05:00
miniscript.cpp refactor: Drop deprecated space in operator""_mst 2024-11-11 12:14:08 +01:00
miniscript.h refactor: Avoid passing span iterators when data pointers are expected 2024-12-19 14:39:55 +01:00
parsing.cpp util: move spanparsing.h to script/parsing.h 2024-05-16 10:16:08 -05:00
parsing.h util: move spanparsing.h to script/parsing.h 2024-05-16 10:16:08 -05:00
script.cpp policy: Add OP_1 <0x4e73> as a standard output type 2024-07-30 14:06:58 -04:00
script.h Allow CScript's operator<< to accept spans, not just vectors 2024-09-11 17:41:27 +02: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 kernel: De-globalize signature cache 2024-07-05 09:03:04 +02:00
sigcache.h kernel: De-globalize signature cache 2024-07-05 09:03:04 +02:00
sign.cpp refactor: move SignSignature helpers to test utils 2024-09-04 21:06:09 +02:00
sign.h refactor: move SignSignature helpers to test utils 2024-09-04 21:06:09 +02:00
signingprovider.cpp desc spkm: Return SigningProvider only if we have the privkey 2024-11-07 11:41:25 -05:00
signingprovider.h Merge bitcoin/bitcoin#31590: descriptors: Try pubkeys of both parities when retrieving the private keys for an xonly pubkey in a descriptor 2025-01-21 10:20:13 +00:00
solver.cpp policy: Add OP_1 <0x4e73> as a standard output type 2024-07-30 14:06:58 -04:00
solver.h refactor: Replace fwd-decl with proper include 2024-12-19 13:46:43 +01:00