Skip to content

Conversation

tcharding
Copy link
Member

Backport two PRs:

The first includes a bug fix in a GetKey impl and the second is a feature we want to release. And the three refactor patches touch code that #4238 builds on so I figured we should backport them all.

All 5 patches required a small amount of massaging to get in. The first 4 was just adding a ? to the calls to derive_priv. The last patch needed a few calls in the unit test changing.

@github-actions github-actions bot added C-bitcoin PRs modifying the bitcoin crate test labels May 5, 2025
@tcharding
Copy link
Member Author

cc @storopoli because he is waiting for this according to #4388

@tcharding tcharding force-pushed the 05-05-backport-4238 branch from 79a03fe to 74e2c5c Compare May 5, 2025 02:43
@apoelstra
Copy link
Member

In 9331108:

Why isn't it an API break to change the signature of the GetKey trait?

Also why isn't the API-break bot running here? (I guess we hadn't enabled it in the 0.32 branch in our CI directory? Can we do that?)

@apoelstra
Copy link
Member

74e2c5c looks good other than that one commit.

Copy link
Contributor

@storopoli storopoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
ACK 74e2c5c

shesek and others added 2 commits May 6, 2025 08:33
… signing

This commit enhances PSBT signing functionality by:

1. Added new KeyRequest::XOnlyPubkey variant to support direct retrieval using XOnly public keys
2. Implemented GetKey for HashMap<XOnlyPublicKey, PrivateKey> for more efficient Taproot key management
3. Modified HashMap<PublicKey, PrivateKey> implementation to handle XOnlyPublicKey requests by checking both even and odd parity variants

These changes allow for more flexible key management in Taproot transactions.
Specifically, wallet implementations can now store keys indexed by either
PublicKey or XOnlyPublicKey and successfully sign PSBTs with Taproot inputs.

Added tests for both implementations to verify correct behavior.

Added test for odd parity key retrieval.

Closes rust-bitcoin#4150
@tcharding tcharding force-pushed the 05-05-backport-4238 branch from 74e2c5c to 95eb255 Compare May 5, 2025 22:34
@tcharding
Copy link
Member Author

Why isn't it an API break to change the signature of the GetKey trait?

Ooph - fail! Thanks man.

Force push includes a few things:

  • Remove the offending patch.
  • Fix build error in first patch to not dereference fingerprint. This didn't show up in CI because it is removed in the second patch - this separation of changes is by design.
  • Modified final patch to use the original API for GetKey

@tcharding
Copy link
Member Author

cc @shesek in case you wanted to see your bug fix getting released. Should have been backported immediately that it was done, my bad.

@tcharding tcharding added the P-high High priority label May 5, 2025
Copy link
Contributor

@storopoli storopoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 95eb255

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 95eb255; successfully ran local tests

@apoelstra apoelstra merged commit 2044697 into rust-bitcoin:0.32.x May 8, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bitcoin PRs modifying the bitcoin crate P-high High priority test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants