Skip to content

Conversation

@HalFinneyIsMyHomeBoy
Copy link

Summary

Fixes Issue #60

Added clear error messages when loading a wallet with the wrong seed. Replaces generic BDK errors with actionable messages showing which keychain failed (external/internal) and comparing expected vs stored descriptor checksums.

What Changed

  • New WalletError::DescriptorMismatch error with detailed descriptor comparison
  • Helper functions to detect and extract descriptor mismatch information
  • Added Tests for Memory, Sled, and Postgres storage backends

Example Error

DESCRIPTOR MISMATCH DETECTED

external descriptor mismatch detected.

Expected descriptor:
  Checksum: abc12345

Stored descriptor:
  Checksum: xyz98765

The wallet's stored descriptor doesn't match the descriptor
derived from the current seed. Please verify you're using the correct seed
or reset the wallet data if needed, but verify your wallet backups before resetting.

Key Points

  • Only shows checksums (no sensitive data)
  • Identifies which keychain failed (external/internal)
  • Does not trigger on first-time wallet creation
  • Works across all storage backends

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.

1 participant