Store BDK wallet data in rgb-lib database - #104
Open
markuslevonyak wants to merge 1 commit into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #104 +/- ##
==========================================
+ Coverage 96.24% 96.25% +0.01%
==========================================
Files 24 26 +2
Lines 13418 13909 +491
==========================================
+ Hits 12914 13388 +474
- Misses 504 521 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
zoedberg
requested changes
Aug 20, 2026
| bitcoin_network: BitcoinNetwork, | ||
| ) -> Result<BdkWallet, Error> { | ||
| let chain_net: ChainNet = bitcoin_network.into(); | ||
| let mut load_params = BdkWallet::load() |
Member
There was a problem hiding this comment.
Suggested change
| let mut load_params = BdkWallet::load() | |
| let mut wallet_params = BdkWallet::load() |
let's avoid unnecessary changes to keep the diff small and the blame intact
markuslevonyak
force-pushed
the
bdk-data-in-rgb-lib-db
branch
from
August 20, 2026 10:31
83da955 to
a6013ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Store the BDK wallet data (its
ChangeSet) in rgb-lib's own database instead of a separatebdk_dbfile, removing thefile_storefeature.Motivation
Follow-up to #87:
bdk_file_storeis a development/testing database not meant for production, and its format breaks across BDK major upgrades. A rescan cannot recover from that, since revealed-but-unpaid invoice addresses have no chain history. #87 (switching tobdk_sqlite) was closed in favor of integrating BDK persistence into rgb-lib's existing database layer: one database technology, no coupling between sea-orm's and BDK's SQLite stacks, room for future non-SQLite backends.Design
rusqlite, and a serialized-blob approach would be fragile across upgrades. Keeping the schema identical makes future BDK bumps a mechanical diff against upstream'srusqlite_impl.rs.DbTxnis open (sync, broadcast, address reveal), so with single-writer SQLite a separate connection would deadlock. Bonus: BDK and RGB state now commit or roll back atomically.ChangeSet. The separatebdk_db_watch_onlyfile was a pre-1.0-BDK workaround.Migration
None: the old
bdk_dbfile is ignored and chain data is rebuilt on the next sync. This one-time break is unavoidable; the new store is what prevents it from recurring.