Skip to content

Add to rusqlite module the get_pre_1_wallet_keychains migration helper#2090

Closed
notmandatory wants to merge 1 commit intobitcoindevkit:masterfrom
notmandatory:feat/sqlite_pre1_migration_helper
Closed

Add to rusqlite module the get_pre_1_wallet_keychains migration helper#2090
notmandatory wants to merge 1 commit intobitcoindevkit:masterfrom
notmandatory:feat/sqlite_pre1_migration_helper

Conversation

@notmandatory
Copy link
Member

Description

Add to rusqlite module the get_pre_1_wallet_keychains migration 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

Changelog notice

Checklists

All Submissions:

New Features:

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

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

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.

Approach ACK. I don't have an opinion as to where it should live per se, although this is mostly related to a pre-1.0 bdk Wallet database, so maybe in bdk_wallet would be closer to its target users? Works either way!

I tested with a local database and I get correct values. Only small comment would be that the string it pulls for the KeychainKind has escaped double quote characters and those are probably not really wanted (see example below).

Pre1WalletKeychain { keychain: "\"External\"", last_derivation_index: 3, checksum: [108, 55, 54, 100, 117, 121, 118, 55] }

@notmandatory
Copy link
Member Author

ah good catch, I didn't notice that with the double quotes, will fix.

@notmandatory notmandatory force-pushed the feat/sqlite_pre1_migration_helper branch from 9d0bd21 to fde4e87 Compare January 8, 2026 01:55
@oleonardolima oleonardolima self-requested a review January 8, 2026 22:37
Copy link
Collaborator

@oleonardolima oleonardolima left a comment

Choose a reason for hiding this comment

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

Concept ACK fde4e87

Are you looking forward to keep these changes here or move it to bdk_wallet ? I think it'd better live in bdk_wallet.

@notmandatory
Copy link
Member Author

Thanks for the reminder, I'm closing this one, replaced by bitcoindevkit/bdk_wallet#364 and bitcoindevkit/bdk_wallet#365.

@notmandatory notmandatory self-assigned this Jan 12, 2026
notmandatory added a commit to bitcoindevkit/bdk_wallet that referenced this pull request Feb 24, 2026
80276fc feat[rusqlite]: add get_pre_1_wallet_keychains migration helper (Steve Myers)

Pull request description:

  ### 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:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `just p` before pushing

  #### New Features:

  * [x] I've added tests for the new feature
  * [x] I've added docs for the new feature

Top commit has no ACKs.

Tree-SHA512: d661905a0cdc3c0883e8d98b415b542d323f33d2f0220768d3b2633ccca0f105b0415f551a98e92e6b53089b2279db1f6457294eb9350f8b4e6e4cfc21e54b02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants