feat: add taproot support for HD signing methods (signInputHD, signAllInputsHD)#2329
Draft
bittoby wants to merge 3 commits intobitcoinjs:masterfrom
Draft
feat: add taproot support for HD signing methods (signInputHD, signAllInputsHD)#2329bittoby wants to merge 3 commits intobitcoinjs:masterfrom
bittoby wants to merge 3 commits intobitcoinjs:masterfrom
Conversation
7f07c2d to
fc73b06
Compare
Author
|
@jasonandjay would you please review this pr? I'd appreciate any feedback. |
Author
|
@junderw could you please review this PR? welcome to any feedbacks. |
8 tasks
… paths Restore PSBT and tests to match master. Keep a short note in getSignersFromHD that taproot inputs encode key origin in tapBip32Derivation (BIP 371), not bip32Derivation. Made-with: Cursor
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.
Summary
Taproot inputs with
tapBip32Derivationnow work withsignInputHD,signInputHDAsync,signAllInputsHD, andsignAllInputsHDAsync. Previously these methods only handled legacy/segwit viabip32Derivationand would fail on taproot inputs.getSignersFromHDdetects taproot inputs and delegates to a newgetTaprootSignersFromHDfunctionleafHashes): derives child key, tweaks it usingtapMerkleRootfrom the PSBT inputleafHashes): derives child key untweaked, existing_signTaprootInputhandles the restHDSigner/HDSignerAsyncget optionalsignSchnorr?andtweak?- existing code unaffectedsighashTypeson HD methods changed from= [SIGHASH_ALL]to optional, matchingsignAllInputs- lets inner methods pick the right default per input typeCloses #2132