Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

This PR implements comprehensive key management functionality and signature
verification improvements for the WASM UTXO library:

  • Add ECPair implementation with key generation, import/export functions
  • Implement full BIP32 extended key functionality for key derivation
  • Create RootWalletKeys class wrapper for a more type-safe wallet key API
  • Restructure fixedScriptWallet into proper directory structure
  • Implement ReplayProtection class for better replay protection handling
  • Add support for verifying replay protection signatures with wallet keys
  • Add helper utility to verify all signatures in a PSBT
  • Update parsing functions to use publicKeys instead of outputScripts

These changes provide a complete key management system with proper TypeScript
interfaces, consistent API patterns, and improved signature verification
capabilities.

Issue: BTC-2786

OttoAllmendinger and others added 8 commits November 26, 2025 11:57
Add elliptic curve key pair functionality with ECPair class that wraps the
WasmECPair Rust implementation. This provides key generation, import/export
functions including WIF format, and supports both private and public keys.

Issue: BTC-2786

Co-authored-by: llm-git <llm-git@ttll.de>
Add complete BIP32 implementation with both Rust and TypeScript interfaces.
The implementation handles key derivation for both private and public keys,
including hardened derivation, path-based derivation, and WIF export.

This provides a full replacement for the BIP32 functionality from
utxo-lib, with test coverage to ensure API parity.

Issue: BTC-2786

Co-authored-by: llm-git <llm-git@ttll.de>
Added a new TypeScript class wrapper for wallet keys that provides a more
type-safe and consistent API over the raw WASM bindings.

- Created RootWalletKeys class with proper static factory methods
- Updated fixedScriptWallet to work with the new RootWalletKeys class
- Extended BitGoPsbt.verifySignature to support both BIP32 and ECPair
- Improved README.md with detailed architecture patterns documentation
- Updated tests to use the new API

This implements a clean class wrapper pattern similar to BIP32 and ECPair,
maintaining a consistent API style across the library.

Issue: BTC-2786

Co-authored-by: llm-git <llm-git@ttll.de>
Reorganize fixedScriptWallet into a proper directory structure with
separate files for distinct functionality. Move RootWalletKeys and
address functions into their own modules while keeping the same API
through the index file.

Issue: BTC-2786

Co-authored-by: llm-git <llm-git@ttll.de>
Add support for verifying replay protection signatures using a wallet key
directly through the main verifySignature method, rather than requiring
the deprecated verifyReplayProtectionSignature method.

This adds cleaner support for replay protection verification with the
same API as normal signature verification.

Issue: BTC-2786

Co-authored-by: llm-git <llm-git@ttll.de>
Add a new utility function `verifyAllInputSignatures` that handles the
common pattern of verifying signatures across all inputs in a PSBT. This
simplifies the test code by centralizing the verification logic.

Issue: BTC-2786

Co-authored-by: llm-git <llm-git@ttll.de>
Add a dedicated ReplayProtection class to handle replay protection inputs
in transactions. The implementation supports creating replay protection
from public keys, output scripts, or addresses, providing a cleaner API
than the previous approach using plain objects.

Issue: BTC-2786

Co-authored-by: llm-git <llm-git@ttll.de>
…ctions

Update parseTransactionWithWalletKeys and verifyReplayProtectionSignature
to use publicKeys instead of outputScripts for replay protection validation.
This provides a cleaner API and better aligns with the key-based security model.

Issue: BTC-2786

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review November 26, 2025 11:15
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner November 26, 2025 11:15
Remove WASM-specific test code and the helper module that is no longer
needed after implementing wallet keys functionality in Rust rather than
JavaScript/TypeScript.

Issue: BTC-2786

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger merged commit 4b1832a into master Nov 26, 2025
1 check passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-2786.walletKeys branch November 26, 2025 20:42
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