Repository navigation
Shuffle change output on hardware wallet and Bitcoin Cash sends - #3432
Merged
OmarHatem28 merged 3 commits intoJul 26, 2026
Merged
Conversation
Hardware wallet BTC/LTC sends passed outputs to the PSBT/device in the given order (change last), a position fingerprint. The outputOrdering param was plumbed but ignored. Add orderOutputs() and apply it in both buildHardwareWalletTransaction paths; set the send call site to shuffle. Refs cake-tech#3376 (the software send + RBF paths were covered by cake-tech#3420).
The BCH send path built via ForkedTransactionBuilder with outputOrdering: none, leaving change deterministically last. The builder shuffles natively and change is found by isChange, not position, so flip it to shuffle (matches the BTC software path from cake-tech#3420). Refs cake-tech#3376.
OmarHatem28
reviewed
Jul 25, 2026
Co-authored-by: Omar Hatem <[email protected]>
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.
Change was still placed deterministically last on the remaining send paths (hardware wallet BTC/LTC, and Bitcoin Cash), a position fingerprint. The software + RBF paths were already covered by #3420; this finishes the rest.
orderOutputsand apply it before building the PSBT / signing — theoutputOrderingparam was plumbed but ignored.ForkedTransactionBuildertooutputOrdering: shuffle.Change is found by
isChange, not position.closes #3376
related to payjoin/rust-payjoin#1597 (comment)