rust-bitcoin-unsafe-fast/bitcoin/src
merge-script 87889955f9
Merge rust-bitcoin/rust-bitcoin#4238: Add XOnlyPublicKey support for PSBT key retrieval and improve Taproot signing
069d2fd07e Add XOnlyPublicKey support for PSBT key retrieval and improve Taproot signing (Erick Cestari)

Pull request description:

  The `bip32_sign_schnorr` function was previously only attempting to retrieve private keys using `KeyRequest::Bip32`, which limited the ability to sign Taproot inputs with key maps that don't support BIP32 derivation paths.

  ## Changes
  - Added new `KeyRequest::XOnlyPubkey` variant to support direct retrieval using XOnly public keys
  - Implemented `GetKey` for `HashMap<XOnlyPublicKey, PrivateKey>` for more efficient Taproot key management
  - Modified `HashMap<PublicKey, PrivateKey>` implementation to handle XOnlyPublicKey requests by checking both even and odd parity variants
  - Added comprehensive tests for both key map implementations

  These improvements enable wallet implementations to store keys indexed by either `PublicKey` or `XOnlyPublicKey` and successfully sign PSBTs.

  Closes #4150

ACKs for top commit:
  Kixunil:
    ACK 069d2fd07e
  apoelstra:
    ACK 069d2fd07e7d6dad1401fce6ab28ab1dc9f3c60f; successfully ran local tests

Tree-SHA512: 0ae07309b772f1a53e7da45073f7e2337cc332ab2335925d623d0e1ad1503aab77673bbbd64e5533ae7fc8d57f3577db0ae7ac3b05279de92d3b34ab8eeae90f
2025-03-24 20:15:21 +00:00
..
address Remove a bunch of `try_into().expect()` 2025-03-20 20:19:50 +01:00
blockdata Use compute_merkle_root 2025-03-21 09:09:49 +11:00
consensus fix typos 2025-03-10 09:04:59 +08:00
crypto Add XOnlyPublicKey support for PSBT key retrieval and improve Taproot signing 2025-03-21 11:28:54 -03:00
merkle_tree 2025-01-12 automated rustfmt nightly 2025-01-12 01:23:13 +00:00
network Update CompactTarget::from_next_work_required to take timespan as i64 2024-11-27 11:27:22 -06:00
p2p Remove From<hash> for not-general-hash types 2025-03-21 09:12:25 +11:00
psbt Add XOnlyPublicKey support for PSBT key retrieval and improve Taproot signing 2025-03-21 11:28:54 -03:00
taproot Remove a bunch of `try_into().expect()` 2025-03-20 20:19:50 +01:00
bip32.rs Add official BIP32 test vectors for invalid keys 2025-03-20 20:19:51 +01:00
bip152.rs Remove a bunch of `try_into().expect()` 2025-03-20 20:19:50 +01:00
bip158.rs Remove a bunch of `try_into().expect()` 2025-03-20 20:19:50 +01:00
consensus_validation.rs Stop using FQP on Amount type 2025-01-24 08:54:24 +11:00
hash_types.rs bitcoin: Remove hash type re-exports 2025-03-04 08:15:04 +11:00
internal_macros.rs Set avoid-breaking-exported-api to false 2024-12-11 10:11:50 +11:00
lib.rs Remove a bunch of `try_into().expect()` 2025-03-20 20:19:50 +01:00
policy.rs Policy: Relax MIN_STANDARD_TX_NONWITNESS_SIZE to 65 2025-02-27 00:20:08 +07:00
pow.rs chore: spellchecker 2025-03-16 07:23:18 +00:00
serde_utils.rs Elide more lifetimes 2024-10-28 15:22:13 +11:00
sign_message.rs update secp256k1 to 0.30.0 2025-03-02 23:31:48 +08:00