forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge bitcoin#31590: descriptors: Try pubkeys of both parities when r…
…etrieving the private keys for an xonly pubkey in a descriptor c0045e6 Add test for multipath miniscript expression (David Gumberg) b4ac480 descriptor: Use InferXOnlyPubkey for miniscript XOnly pubkey from script (Ava Chow) 4c50c21 tests: Check ExpandPrivate matches for both parsed descriptors (Ava Chow) 092569e 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 bitcoin#31589 ACKs for top commit: Pttn: ACK c0045e6 davidgumberg: utACK bitcoin@c0045e6 kevkevinpal: Concept and Code review ACK [c0045e6](bitcoin@c0045e6) furszy: ACK c0045e6 theStack: re-ACK c0045e6 rkrux: Concept ACK c0045e6 Tree-SHA512: 3dcf2a802b996e0680a3f819075e5a689eb22e484c81ea79b40ec04197ee4ba3f6b9c87c45dfe8a847c9b805b2fd0fad77ffb92a93e65dc3aad74d69d9e3d97f
- Loading branch information
Showing
3 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters