Skip to content

refactor(abstract-utxo): replace utxo-lib utility imports with standalone equivalents#8154

Merged
OttoAllmendinger merged 2 commits intomasterfrom
BTC-2768.remove-utxolib-finally
Feb 16, 2026
Merged

refactor(abstract-utxo): replace utxo-lib utility imports with standalone equivalents#8154
OttoAllmendinger merged 2 commits intomasterfrom
BTC-2768.remove-utxolib-finally

Conversation

@OttoAllmendinger
Copy link
Contributor

Replace utxo-lib utility functions (crypto, address, bip32, opcodes) with
standalone equivalents from @bitgo/wasm-utxo, @bitgo/secp256k1, and local
implementations. This does not affect transaction decoding or signing paths.

This PR includes:

  • Replacing bitcoinjs-message with @bitgo/wasm-utxo for message verification
  • Removing unused helper functions now handled by the wasm module
  • Replacing various utxolib utilities with wasm-utxo equivalents:
    • crypto.hash160/address.toBase58Check with local implementations
    • utxolib.address.* with wasm-utxo address module
    • bitgo.isPsbt() with hasPsbtMagic()
    • utxolib address with wasm-utxo address in replayProtection
    • utxolib.bitgo.toTNumber() with local helper
    • Inlining PsbtParsedScriptType type locally
    • Changing ChainCode type import to wasm-utxo
    • Importing BIP32Interface from secp256k1
    • Adding coinNameToNetwork map and getNetworkForCoinName helper

This change simplifies the code and reduces dependencies while maintaining
the same functionality.

BTC-2768

OttoAllmendinger and others added 2 commits February 16, 2026 14:58
…lone equivalents

Replace utxo-lib utility functions (crypto, address, bip32, opcodes) with
standalone equivalents from @bitgo/wasm-utxo, @bitgo/secp256k1, and local
implementations. This does not affect transaction decoding or signing paths.

- verifyKey: replace utxolib.crypto.hash160/address.toBase58Check with local
- recipient: replace utxolib.address.* with wasm-utxo address module
- bip322: replace bitgo.isPsbt() with hasPsbtMagic()
- replayProtection: replace utxolib address with wasm-utxo address
- parseTransaction: replace utxolib.bitgo.toTNumber() with local helper
- SigningError: inline PsbtParsedScriptType type locally
- unspent: change ChainCode type import to wasm-utxo
- signPsbtWasm, descriptor/transaction: import BIP32Interface from secp256k1
- test utils: add coinNameToNetwork map and getNetworkForCoinName helper

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

TICKET: BTC-2768
Replace dependency on bitcoinjs-message with @bitgo/wasm-utxo for message
verification. Remove unused helper functions that are now handled by the
wasm module. This simplifies the code and reduces dependencies.

Issue: BTC-2768

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2768.remove-utxolib-finally branch from 07bdaf6 to a6b854b Compare February 16, 2026 13:58
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review February 16, 2026 15:05
@OttoAllmendinger OttoAllmendinger requested review from a team as code owners February 16, 2026 15:05
@OttoAllmendinger OttoAllmendinger merged commit 32e748f into master Feb 16, 2026
21 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