fix(send): apply taproot tweak only to P2TR inputs in XprivSilentPaymentSender::send_to - #78
Merged
nymius merged 1 commit intoSep 22, 2026
Conversation
nymius
reviewed
Sep 21, 2026
Collaborator
There was a problem hiding this comment.
Can you add a test verifying this doesn't change the scanned outputs on the other end?
Contributor
Author
There was a problem hiding this comment.
Hi. I've added a around-trip regression test (send_output_is_found_by_scan_with_mixed_input_types) to verify that the generated output is correctly identified by the receiver.
MusabYK
force-pushed
the
fix-xpriv-sender-taproot-tweak
branch
from
September 22, 2026 05:22
6f1e231 to
e1fbf8d
Compare
MusabYK
force-pushed
the
fix-xpriv-sender-taproot-tweak
branch
from
September 22, 2026 05:34
e1fbf8d to
830af5a
Compare
nymius
approved these changes
Sep 22, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
XprivSilentPaymentSender::send_tocurrently applies the BIP-341 Taproot key-path tweak to every input, regardless of the input's script type.As a result, using
XprivSilentPaymentSender::send_towith 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.rsis 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 expectsAll Submissions:
just p(fmt, clippy and test) before committingBugfixes: