Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

This PR enhances the WASM-UTXO BIP32 implementation with several key
improvements:

  1. Added support for private key handling in BIP32.from_bip32_properties,
    enabling proper conversion from JavaScript BIP32 interfaces for both
    xpub and xprv formats

  2. Refactored byte array handling with a type-safe Bytes<N> wrapper
    that implements TryFromJsValue, replacing direct buffer access with
    a cleaner approach

  3. Improved BIP32 tests with reusable fixtures, helper functions, and
    a more consistent organization pattern for better maintainability

These changes ensure complete feature parity between WASM and utxolib
implementations while improving code quality and type safety.

Reference: BTC-2650

OttoAllmendinger and others added 3 commits February 4, 2026 13:55
…perties

Enhanced BIP32.from_bip32_properties to properly handle private keys when
converting from JavaScript BIP32 interfaces. Added optional buffer field
utility function to safely extract private key data when present.

Tests confirm proper handling of both xpub and xprv conversions with
complete feature parity between WASM and utxolib implementations.

Issue: BTC-2650

Co-authored-by: llm-git <llm-git@ttll.de>
Introduce a type-safe `Bytes<N>` wrapper for fixed-size byte arrays that
implements TryFromJsValue. Replace direct buffer access with this cleaner
approach in the BIP32 implementation.

Issue: BTC-2650

Co-authored-by: llm-git <llm-git@ttll.de>
Refactors BIP32 tests to improve readability and maintainability by:
- Adding reusable test fixtures for common values
- Creating helper functions for buffer comparison and validation
- Consolidating redundant test assertions
- Simplifying test structure with more consistent patterns
- Improving organization of test cases

Issue: BTC-2650

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review February 4, 2026 13:58
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner February 4, 2026 13:58
@OttoAllmendinger OttoAllmendinger merged commit a95f989 into master Feb 4, 2026
6 checks passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-2650.fix-bip32-from branch February 4, 2026 14:40
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