Skip to content

refactor(abstract-utxo): inline deriveKeyWithSeed to drop utxolib BIP32 bridge#8859

Merged
OttoAllmendinger merged 1 commit into
masterfrom
otto/derive-key-with-seed
May 26, 2026
Merged

refactor(abstract-utxo): inline deriveKeyWithSeed to drop utxolib BIP32 bridge#8859
OttoAllmendinger merged 1 commit into
masterfrom
otto/derive-key-with-seed

Conversation

@OttoAllmendinger
Copy link
Copy Markdown
Contributor

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

  • `yarn tsc --noEmit` clean in `modules/abstract-utxo`
  • `yarn lint` clean in `modules/abstract-utxo`

🤖 Generated with Claude Code

@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner May 26, 2026 09:13
@OttoAllmendinger OttoAllmendinger force-pushed the otto/derive-key-with-seed branch from 8ae58cc to fd3f3d6 Compare May 26, 2026 09:46
…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
@OttoAllmendinger OttoAllmendinger force-pushed the otto/derive-key-with-seed branch from fd3f3d6 to b9a874c Compare May 26, 2026 09:56
@OttoAllmendinger OttoAllmendinger merged commit 3d8aa19 into master May 26, 2026
22 checks passed
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