Bitcoin

Recover Bitcoin from wallet.dat from 2012 (probably not backed up properly)

great. So, I have had a Bitcoin Core wallet since around August 2012. I don’t think I backed it up “properly” in that I just copied the wallet.dat file, compressed it, and put it in cloud storage.

There were some changes to 2 of the addresses and I later found out that these addresses were also split into BTC Cash.

I loaded Bitcoin Core 22.0.0 and got the blockchain fully synced. At this point, no wallet has been loaded or a new wallet has been created. Then I tried. restore that much old-wallet.dat After about 20 minutes or more, the following pop-up error occurs.

Wallet open failure: DB error while adding transaction to wallet, write failure

and db.log at AppData\Roaming\..\old-wallet\ show

file wallet.dat has LSN 1/76511, past end of log at 1/476
Commonly caused by moving a database from one database environment
to another without clearing the database LSNs, or by removing all of
the log files from a database environment
(..... these 4 lines repeat 48 times)

that much debug.log

2024-03-02T17:22:43Z Using BerkeleyDB version Berkeley DB 4.8.30: (April  9, 2010)
2024-03-02T17:22:43Z Using wallet C:\Users\...\AppData\Roaming\Bitcoin\wallets\Old-Wallet\wallet.dat
2024-03-02T17:22:43Z BerkeleyEnvironment::Open: LogDir=C:\Users\...\AppData\Roaming\Bitcoin\wallets\Old-Wallet\database ErrorFile=C:\Users\...\AppData\Roaming\Bitcoin\wallets\Old-Wallet\db.log
2024-03-02T17:22:43Z init message: Loading wallet…
2024-03-02T17:22:43Z (Old-Wallet) Wallet file version = 10500, last client version = 260000
2024-03-02T17:22:43Z (Old-Wallet) Legacy Wallet Keys: 0 plaintext, 206 encrypted, 0 w/ metadata, 206 total.
2024-03-02T17:22:43Z (Old-Wallet) Descriptors: 0, Descriptor Keys: 0 plaintext, 0 encrypted, 0 total.
2024-03-02T17:22:43Z (Old-Wallet) Wallet completed loading in              56ms
2024-03-02T17:22:43Z init message: Rescanning…
2024-03-02T17:22:43Z (Old-Wallet) Rescanning last 493953 blocks (from block 338894)...
2024-03-02T17:22:43Z (Old-Wallet) Rescan started from block 00000000000000000ff6f346bea61d1c87e455e2dd4e1da154e830dcfddba1f9... (slow variant inspecting all blocks)
2024-03-02T17:23:43Z (Old-Wallet) Still rescanning. At block 350638. Progress=0.066077
2024-03-02T17:23:43Z (Old-Wallet) Saving scan progress 350638.
2024-03-02T17:24:43Z (Old-Wallet) Still rescanning. At block 361394. Progress=0.074327
2024-03-02T17:24:43Z (Old-Wallet) Saving scan progress 361394.
2024-03-02T17:25:43Z (Old-Wallet) Still rescanning. At block 368839. Progress=0.081201
2024-03-02T17:25:43Z (Old-Wallet) Saving scan progress 368839.
2024-03-02T17:26:43Z (Old-Wallet) Still rescanning. At block 377874. Progress=0.089103
2024-03-02T17:26:43Z (Old-Wallet) Saving scan progress 377874.
2024-03-02T17:27:43Z (Old-Wallet) Still rescanning. At block 385876. Progress=0.097212
2024-03-02T17:27:43Z (Old-Wallet) Saving scan progress 385876.
2024-03-02T17:28:43Z (Old-Wallet) Still rescanning. At block 392935. Progress=0.105676
2024-03-02T17:28:43Z (Old-Wallet) Saving scan progress 392935.
2024-03-02T17:29:43Z (Old-Wallet) Still rescanning. At block 398759. Progress=0.113347
2024-03-02T17:29:43Z (Old-Wallet) Saving scan progress 398759.
2024-03-02T17:30:43Z (Old-Wallet) Still rescanning. At block 404095. Progress=0.121186
2024-03-02T17:30:43Z (Old-Wallet) Saving scan progress 404095.
2024-03-02T17:31:43Z (Old-Wallet) Still rescanning. At block 410007. Progress=0.129667
2024-03-02T17:31:43Z (Old-Wallet) Saving scan progress 410007.
2024-03-02T17:32:43Z (Old-Wallet) Still rescanning. At block 415252. Progress=0.137660
2024-03-02T17:32:43Z (Old-Wallet) Saving scan progress 415252.
2024-03-02T17:33:43Z (Old-Wallet) Still rescanning. At block 420359. Progress=0.145469
2024-03-02T17:33:43Z (Old-Wallet) Saving scan progress 420359.
2024-03-02T17:34:43Z (Old-Wallet) Still rescanning. At block 424845. Progress=0.152556
2024-03-02T17:34:43Z (Old-Wallet) Saving scan progress 424845.
2024-03-02T17:35:43Z (Old-Wallet) Still rescanning. At block 429990. Progress=0.160343
2024-03-02T17:35:43Z (Old-Wallet) Saving scan progress 429990.
2024-03-02T17:36:43Z (Old-Wallet) Still rescanning. At block 435183. Progress=0.168730
2024-03-02T17:36:44Z (Old-Wallet) Saving scan progress 435183.
2024-03-02T17:37:44Z (Old-Wallet) Still rescanning. At block 439881. Progress=0.176782
2024-03-02T17:37:44Z (Old-Wallet) Saving scan progress 439881.
2024-03-02T17:38:44Z (Old-Wallet) Still rescanning. At block 444238. Progress=0.185090
2024-03-02T17:38:44Z (Old-Wallet) Saving scan progress 444238.
2024-03-02T17:39:44Z (Old-Wallet) Still rescanning. At block 448552. Progress=0.193078
2024-03-02T17:39:44Z (Old-Wallet) Saving scan progress 448552.
2024-03-02T17:40:44Z (Old-Wallet) Still rescanning. At block 453098. Progress=0.201544
2024-03-02T17:40:44Z (Old-Wallet) Saving scan progress 453098.
2024-03-02T17:41:44Z (Old-Wallet) Still rescanning. At block 457196. Progress=0.209873
2024-03-02T17:41:44Z (Old-Wallet) Saving scan progress 457196.
2024-03-02T17:42:44Z (Old-Wallet) Still rescanning. At block 461365. Progress=0.217692
2024-03-02T17:42:44Z (Old-Wallet) Saving scan progress 461365.
2024-03-02T17:43:44Z (Old-Wallet) Still rescanning. At block 465338. Progress=0.225723
2024-03-02T17:43:44Z (Old-Wallet) Saving scan progress 465338.
2024-03-02T17:44:44Z (Old-Wallet) Still rescanning. At block 469048. Progress=0.233615
2024-03-02T17:44:44Z (Old-Wallet) Saving scan progress 469048.
2024-03-02T17:45:44Z (Old-Wallet) Still rescanning. At block 473171. Progress=0.241268
2024-03-02T17:45:44Z (Old-Wallet) Saving scan progress 473171.
2024-03-02T17:46:07Z (Old-Wallet) AddToWallet 4306eb4278cd03af36b9b4bb2bbfceaa2297acad4293c724255c792d8c02d9ac  new Confirmed (block=000000000000000000dc975c23fd082c77d57feef2f98ec23a27f907616101ba, height=475104, index=548)
2024-03-02T17:46:07Z Flushed fee estimates to fee_estimates.dat.
2024-03-02T17:49:13Z New block-relay-only v1 peer connected: version: 70016, blocks=832847, peer=33
  • So I found out that Bitcoin QT doesn’t prompt for the encryption password when importing this. wallet.dat…or at least I don’t remember seeing the prompt. Not sure if that means anything.

  • Use this wallet key tool old-wallet.dat file. (You were prompted for the encryption key every time you decrypted it.) So IMO, if a reader can open the database, the database can’t be compromised like that.

    Turns out it’s a list of strings. One column had the addresses, another had the private keys associated with each address, and another had what appeared to be address labels that I remembered giving to some of the addresses. that much date created The columns don’t seem to be correct.

Wallet Key Tool screenshot

However, I ended up with more addresses than I had created (I had 6 or 8 addresses and ended up with over 200 rows of address/key combinations).

My questions are:

-> Is it possible to use Bitcoin Core to achieve this? old-wallet.dat If the file is imported correctly, the address will be displayed in the GUI.

-> Is there a way to rebuild the wallet.dat file? The conflict seems to be occurring because the latest transaction may have additional columns that are not in the older database.

-> Is there any other way to force fetch the address/key? Where can I sweep/access Bitcoin (such as from Bitcoin Core or using another wallet)?

-> Why can third-party tools read .dat files (after decryption) but Bitcoin Core cannot? Or why isn’t there a simple way to do this?

Related Articles

Back to top button