feat(wasm-utxo): support nonstandard derivation paths#275
Merged
OttoAllmendinger merged 2 commits intomasterfrom May 6, 2026
Merged
feat(wasm-utxo): support nonstandard derivation paths#275OttoAllmendinger merged 2 commits intomasterfrom
OttoAllmendinger merged 2 commits intomasterfrom
Conversation
Export `get_sighash_fork_id` and `get_zec_consensus_branch_id` from the bitgo_psbt module for external use. Add `as_str` method to `ScriptType` enum for string representation. Co-authored-by: llm-git <llm-git@ttll.de>
Refactor derivation to use full BIP32 paths instead of separate chain and index parameters. Centralize chain/index path construction in `chain_index_path()` helper. Replace `from_chain_and_index()` with generic `derive_path()` that accepts any derivation path. Cache results using the last two Normal path components. Move `Chain`, `Scope`, and `ScriptId` types to new `script_id` module. Add `WalletOutputScript` type to encapsulate script type + derivation path matching. Implement `from_psbt()` method to match PSBT metadata against wallet keys. Add `derivationPath` field to `ParsedInput` and `ParsedOutput` types, containing full BIP32 path (e.g. "0/1"). Make `scriptId` nullable to indicate when derivation path is nonstandard or external. Update JSDoc comments to clarify field semantics. Issue: BTC-2650 Co-authored-by: llm-git <llm-git@ttll.de>
davidkaplanbitgo
approved these changes
May 6, 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.
Refactor derivation to use full BIP32 paths instead of separate chain
and index parameters. Centralize chain/index path construction in
chain_index_path()helper.Replace
from_chain_and_index()with genericderive_path()thataccepts any derivation path. Cache results using the last two Normal
path components.
Move
Chain,Scope, andScriptIdtypes to newscript_idmodule.Add
WalletOutputScripttype to encapsulate script type + derivationpath matching. Implement
from_psbt()method to match PSBT metadataagainst wallet keys.
Add
derivationPathfield toParsedInputandParsedOutputtypes,containing full BIP32 path (e.g. "0/1"). Make
scriptIdnullable toindicate when derivation path is nonstandard or external.
Export
get_sighash_fork_idandget_zec_consensus_branch_idfromthe bitgo_psbt module for external use. Add
as_strmethod toScriptTypeenum for string representation.Update JSDoc comments to clarify field semantics.
Issue: BTC-2650