Following up on my earlier crash reports (uncaught DbException / STATUS_STACK_BUFFER_OVERRUN,
and the later Db::put crash on the #38 build). While debugging that, I found two separate,
serious ways an ordinary user can silently lose funds with this wallet — neither is really a
crash bug, they're design issues, and I think they're worth documenting (or fixing) prominently.
Issue 1: wallet.dat alone is not a safe backup
I backed up wallet.dat alone (just that one file, copied out of %AppData%\Bitflash\) before
upgrading versions. After upgrading and replacing wallet.dat with my backup, the wallet would
not load — this is what I reported earlier (DbException, both Db::open and Db::put depending on
the exact test).
I traced it to: %AppData%\Bitflash\ also contains a database/ subfolder (BDB transactional
environment — log files, region files, etc.) alongside wallet.dat, blk0001.dat,
blkindex.dat. Berkeley DB in transactional mode ties the wallet file to this environment
(LSNs recorded in the file's pages). Copying wallet.dat alone, without its matching
database/ folder, produces a file that a different (freshly created) environment can't
open/write to correctly — hence Db::open/Db::put: Invalid argument.
Confirmed experimentally: copying the entire %AppData%\Bitflash\ folder (wallet.dat +
database/ + blk*.dat together) into a fresh install fixed it immediately. Copying wallet.dat
alone reproduced the failure every single time, across multiple versions (v1.2.1, v1.2.3, and
the #38 build), which is why it initially looked like a version-to-version regression but
wasn't.
By the time I understood this, I had already cleared the folder that had the working
environment (in a sandboxing tool), leaving me with only the standalone wallet.dat — which,
per the above, isn't enough on its own to reopen the wallet. Recovery attempts since then
(file recovery tools, Sandboxie's own snapshot features) haven't turned up a usable copy, and
my disk is an SSD with TRIM, which likely means the original data is physically gone. This may
end up being a real, permanent loss of funds for me, caused entirely by backing up the
"obviously important" file and not knowing the rest of the folder mattered too.
Issue 2: mined coins vanish if you restore a wallet.dat backup made before mining them
Separately, and worse: I created a new wallet and immediately backed up the entire data
directory (the full folder, correctly this time — not just wallet.dat). I then mined several
blocks with that wallet. On a whim I switched to a different wallet, then a few minutes later
restored my original backup (the one saved before I'd mined those blocks). After restoring
it, the mined coins were gone — not visible in the wallet at all.
As far as I can tell, this is because the wallet generates receiving keys/addresses on demand
rather than deterministically from a single seed. My backup only contained the keys that
existed at backup time; the address(es) that received the mined block rewards were generated
after that backup, so restoring the earlier wallet.dat means the keys for those coins simply
aren't present in the file — even though the coins are presumably still sitting on-chain at
those addresses. This is the exact "keypool exhaustion" / non-deterministic wallet backup
problem that affected early Bitcoin Core (pre-BIP32/HD wallets), well before HD wallets
(deterministic key derivation from a single seed) became the standard fix industry-wide around
2013.
Question for the maintainers
I want to ask this directly and I hope it comes across as constructive rather than just
frustrated, because I am frustrated: why is a project released in 2026 reproducing data-loss
bugs that the Bitcoin ecosystem identified and fixed roughly a decade ago (non-deterministic
wallets requiring constant re-backup, an unhandled-exception crash path, a wallet file that
silently depends on an untracked second folder)? These aren't obscure edge cases — they're
exactly the kinds of bugs that cost real users real money in Bitcoin's own early years, which
is why HD wallets, seed phrases, and defensive exception handling became standard practice
industry-wide. Is there a reason this project intentionally started from the 0.1.0 codebase
without carrying forward those fixes, or is this just development priority / time constraint,
and HD wallets / safer backups are on the roadmap?
Suggestions, roughly in order of impact vs. effort
-
Immediate, cheap: add a line to the README and any in-app "backup your wallet" messaging
stating explicitly that (a) a safe backup means the entire data directory, not just
wallet.dat, and (b) any backup is a point-in-time snapshot — coins received/mined after
that backup will not be recoverable from it, so backups need to be repeated regularly or
after any new address is used.
-
Medium effort: add a "Backup Wallet" menu action that zips up the whole data directory
to a location the user picks, instead of relying on users to know which files matter.
-
The real fix for issue 2: move to deterministic (HD/BIP32-style) key derivation from a
single seed phrase, the way virtually every modern wallet does. This turns "backup" into
"write down 12/24 words once," and makes both of the issues above structurally impossible —
there's no environment-coupling problem and no stale-backup problem if the keys are all
derivable from one seed instead of stored as a growing, mutable list in a database file.
-
For issue 1 specifically, short of full HD wallets: a "Dump Private Keys" / export
function that writes out just the raw keys + labels in a plain, environment-independent
format would let a user salvage access even from an isolated wallet.dat.
Not asking for anything specific here
I don't want to prescribe exactly which of these you implement — just flagging that the
current setup makes it very easy for a well-intentioned user (me, twice now) to think they've
backed up correctly and still end up unable to recover funds, with no warning anywhere that
either of these could happen.
Happy to help test any of the above if useful.
Following up on my earlier crash reports (uncaught DbException / STATUS_STACK_BUFFER_OVERRUN,
and the later Db::put crash on the #38 build). While debugging that, I found two separate,
serious ways an ordinary user can silently lose funds with this wallet — neither is really a
crash bug, they're design issues, and I think they're worth documenting (or fixing) prominently.
Issue 1: wallet.dat alone is not a safe backup
I backed up
wallet.datalone (just that one file, copied out of%AppData%\Bitflash\) beforeupgrading versions. After upgrading and replacing
wallet.datwith my backup, the wallet wouldnot load — this is what I reported earlier (DbException, both Db::open and Db::put depending on
the exact test).
I traced it to:
%AppData%\Bitflash\also contains adatabase/subfolder (BDB transactionalenvironment — log files, region files, etc.) alongside
wallet.dat,blk0001.dat,blkindex.dat. Berkeley DB in transactional mode ties the wallet file to this environment(LSNs recorded in the file's pages). Copying
wallet.datalone, without its matchingdatabase/folder, produces a file that a different (freshly created) environment can'topen/write to correctly — hence
Db::open/Db::put: Invalid argument.Confirmed experimentally: copying the entire
%AppData%\Bitflash\folder (wallet.dat +database/ + blk*.dat together) into a fresh install fixed it immediately. Copying wallet.dat
alone reproduced the failure every single time, across multiple versions (v1.2.1, v1.2.3, and
the #38 build), which is why it initially looked like a version-to-version regression but
wasn't.
By the time I understood this, I had already cleared the folder that had the working
environment (in a sandboxing tool), leaving me with only the standalone wallet.dat — which,
per the above, isn't enough on its own to reopen the wallet. Recovery attempts since then
(file recovery tools, Sandboxie's own snapshot features) haven't turned up a usable copy, and
my disk is an SSD with TRIM, which likely means the original data is physically gone. This may
end up being a real, permanent loss of funds for me, caused entirely by backing up the
"obviously important" file and not knowing the rest of the folder mattered too.
Issue 2: mined coins vanish if you restore a wallet.dat backup made before mining them
Separately, and worse: I created a new wallet and immediately backed up the entire data
directory (the full folder, correctly this time — not just wallet.dat). I then mined several
blocks with that wallet. On a whim I switched to a different wallet, then a few minutes later
restored my original backup (the one saved before I'd mined those blocks). After restoring
it, the mined coins were gone — not visible in the wallet at all.
As far as I can tell, this is because the wallet generates receiving keys/addresses on demand
rather than deterministically from a single seed. My backup only contained the keys that
existed at backup time; the address(es) that received the mined block rewards were generated
after that backup, so restoring the earlier wallet.dat means the keys for those coins simply
aren't present in the file — even though the coins are presumably still sitting on-chain at
those addresses. This is the exact "keypool exhaustion" / non-deterministic wallet backup
problem that affected early Bitcoin Core (pre-BIP32/HD wallets), well before HD wallets
(deterministic key derivation from a single seed) became the standard fix industry-wide around
2013.
Question for the maintainers
I want to ask this directly and I hope it comes across as constructive rather than just
frustrated, because I am frustrated: why is a project released in 2026 reproducing data-loss
bugs that the Bitcoin ecosystem identified and fixed roughly a decade ago (non-deterministic
wallets requiring constant re-backup, an unhandled-exception crash path, a wallet file that
silently depends on an untracked second folder)? These aren't obscure edge cases — they're
exactly the kinds of bugs that cost real users real money in Bitcoin's own early years, which
is why HD wallets, seed phrases, and defensive exception handling became standard practice
industry-wide. Is there a reason this project intentionally started from the 0.1.0 codebase
without carrying forward those fixes, or is this just development priority / time constraint,
and HD wallets / safer backups are on the roadmap?
Suggestions, roughly in order of impact vs. effort
Immediate, cheap: add a line to the README and any in-app "backup your wallet" messaging
stating explicitly that (a) a safe backup means the entire data directory, not just
wallet.dat, and (b) any backup is a point-in-time snapshot — coins received/mined after
that backup will not be recoverable from it, so backups need to be repeated regularly or
after any new address is used.
Medium effort: add a "Backup Wallet" menu action that zips up the whole data directory
to a location the user picks, instead of relying on users to know which files matter.
The real fix for issue 2: move to deterministic (HD/BIP32-style) key derivation from a
single seed phrase, the way virtually every modern wallet does. This turns "backup" into
"write down 12/24 words once," and makes both of the issues above structurally impossible —
there's no environment-coupling problem and no stale-backup problem if the keys are all
derivable from one seed instead of stored as a growing, mutable list in a database file.
For issue 1 specifically, short of full HD wallets: a "Dump Private Keys" / export
function that writes out just the raw keys + labels in a plain, environment-independent
format would let a user salvage access even from an isolated wallet.dat.
Not asking for anything specific here
I don't want to prescribe exactly which of these you implement — just flagging that the
current setup makes it very easy for a well-intentioned user (me, twice now) to think they've
backed up correctly and still end up unable to recover funds, with no warning anywhere that
either of these could happen.
Happy to help test any of the above if useful.