|
Repo Added
|
Files
23
|
Badge
README BADGES
|
push
github
Merge bitcoindevkit/bdk-sp#78: fix(send): apply taproot tweak only to P2TR inputs in XprivSilentPaymentSender::send_to <a class=hub.com/bitcoindevkit/bdk-sp/commit/830af5a4120c3320e32439273f49bec5458b467d">830af5a41 fix(send): apply taproot tweak only to P2TR inputs in XprivSilentPaymentSender (MusabYK) Pull request description: ### Description `XprivSilentPaymentSender::send_to` currently applies the BIP-341 Taproot key-path tweak to every input, regardless of the input's script type. As a result, using `XprivSilentPaymentSender::send_to` with a non-Taproot input can produce an incorrect Silent Payment partial secret and therefore incorrect output keys. The call does not necessarily fail, the recipient may simply be unable to discover the payment. The problem is that create_silentpayment_partial_secret in `silentpayments/src/send/mode.rs` is script-type aware. It only performs the Taproot parity handling for P2TR inputs and uses the supplied private key directly for the other eligible input types. This PR branches on `spk`'s actual type before deciding whether to apply the tap tweak, matching what create_silentpayment_partial_secret already expects #### All Submissions: * [x] I've signed all my commits * [x] I followed the [conventional commit guidelines](https://www.conventionalcommits.org/en/v1.0.0/) * [x] I ran `just p` (fmt, clippy and test) before committing #### Bugfixes: * [ ] This pull request breaks the existing API * [x] I've added tests to reproduce the issue which are now passing * [ ] I'm linking the issue being fixed by this PR ACKs for top commit: nymius: ACK 830af5a4120c3320e32439273f49bec5458b467d Tree-SHA512: 2aeda66634f628ac89ad9ae5ceb1b99d820
77 of 98 branches covered (78.57%)
Branch coverage included in aggregate %.
9 of 10 new or added lines in 1 file covered. (90.0%)
815 of 3155 relevant lines covered (25.83%)
10.17 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|