Skip to content

feat(wasm-utxo): support nonstandard derivation paths#275

Merged
OttoAllmendinger merged 2 commits intomasterfrom
BTC-2650.support-nonstandard-derivation-paths
May 6, 2026
Merged

feat(wasm-utxo): support nonstandard derivation paths#275
OttoAllmendinger merged 2 commits intomasterfrom
BTC-2650.support-nonstandard-derivation-paths

Conversation

@OttoAllmendinger
Copy link
Copy Markdown
Contributor

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.

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.

Update JSDoc comments to clarify field semantics.

Issue: BTC-2650

OttoAllmendinger and others added 2 commits May 6, 2026 13:19
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>
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review May 6, 2026 12:11
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner May 6, 2026 12:11
@OttoAllmendinger OttoAllmendinger merged commit 97433ac into master May 6, 2026
26 of 27 checks passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-2650.support-nonstandard-derivation-paths branch May 6, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants