refactor(abstract-utxo): inline deriveKeyWithSeed to drop utxolib BIP32 bridge#8859
Merged
Merged
Conversation
8ae58cc to
fd3f3d6
Compare
…P32 callers Add a local deriveKeyWithSeed helper using wasm BIP32, replacing two call sites that converted wasm BIP32 -> utxolib BIP32 just to feed sdk-core's BaseCoin.deriveKeyWithSeedBip32. The function is ten lines of sha256 + derivePath, all of which works identically on wasm BIP32. Add equivalence tests against BaseCoin.deriveKeyWithSeedBip32 to confirm the wasm implementation produces identical derivation paths and public keys. Refs: T1-3279
fd3f3d6 to
b9a874c
Compare
davidkaplanbitgo
approved these changes
May 26, 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.
Summary
Adds a 10-line local `deriveKeyWithSeed` helper (`src/deriveKeyWithSeed.ts`) and switches `inscriptionBuilder.ts` and `offlineVault/OfflineVaultHalfSigned.ts` to call it directly using a wasm-utxo `BIP32` instead of the `toUtxolibBIP32` bridge in `wasmUtil.ts`. The helper replicates the same SHA-256 + `m/999999/N/N` derivation that `BaseCoin.deriveKeyWithSeedBip32` does.
This removes both call sites of `toUtxolibBIP32`, clearing the way for the terminal PR to delete `wasmUtil.ts` outright.
PR group context
Part of an 8-PR fan-out removing `@bitgo/utxo-lib` from abstract-utxo runtime. Independent — file-disjoint from the other PRs in this group. Can merge in any order.
Test plan
🤖 Generated with Claude Code