Skip to content

Conversation

@notmandatory
Copy link
Member

@notmandatory notmandatory commented Jan 12, 2026

Description

Add wallet/migration module and get_pre_1_wallet_keychains() to help migrate users from a pre-1.0 bdk sqlite database. This new function returns the last revealed index and checksum value for each keychain it finds.

Notes to the reviewers

This PR replaces bitcoindevkit/bdk#2090 since make more sense to put it in the wallet where it will be easier to export the bindings.

Changelog notice

  • Add get_pre_1_wallet_keychains to assist migration from pre-1.0 bdk wallets.

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

@notmandatory notmandatory added this to the Wallet 2.4.0 milestone Jan 12, 2026
@notmandatory notmandatory self-assigned this Jan 12, 2026
@notmandatory notmandatory added the new feature New feature or request label Jan 12, 2026
@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

❌ Patch coverage is 90.27778% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.38%. Comparing base (8f8a8e9) to head (366ca7a).

Files with missing lines Patch % Lines
src/wallet/migration.rs 90.27% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #364      +/-   ##
==========================================
+ Coverage   85.33%   85.38%   +0.04%     
==========================================
  Files          24       25       +1     
  Lines        8335     8407      +72     
==========================================
+ Hits         7113     7178      +65     
- Misses       1222     1229       +7     
Flag Coverage Δ
rust 85.38% <90.27%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@notmandatory notmandatory changed the base branch from master to release/2.x January 12, 2026 23:30
@notmandatory notmandatory changed the title feat[rusqlite]: add get_pre_1_wallet_keychains migration helper Add get_pre_1_wallet_keychains migration helper Jan 12, 2026
@notmandatory notmandatory changed the base branch from release/2.x to master January 12, 2026 23:38
Copy link
Member

@thunderbiscuit thunderbiscuit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK 366ca7a.

@notmandatory notmandatory moved this to Needs Review in BDK Wallet Jan 13, 2026
@thunderbiscuit
Copy link
Member

Part of this PR (rather a sidequest to this PR) could include updating the Migrating from 0.X page on the book of bdk, since this approach is simpler and requires less code, and I think it could simply supercede what we have there (or at least be added as a secondary section/option).

Also would be great to add a small feature page on the Release Guide when we do push the 2.4 section of the Release Guide. I keep track of the features I think should be highlighted here.

@thunderbiscuit
Copy link
Member

Two things I'd like to clarify maybe:

  1. Can we confirm the versions of bdk this will work for, and add it to the docstrings?
  2. Was there a reason to return the descriptor checksum instead of the whole descriptor string?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature New feature or request

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants