Bitcoin Forum
November 01, 2024, 12:00:47 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I want to recover a corrupt wallet.dat file. I have pywallet installed.  (Read 127 times)
l_ (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
February 10, 2023, 08:49:38 AM
 #1

Can someone walk me through this?
Thanks - l_
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6310


Self-proclaimed Genius


View Profile
February 10, 2023, 09:12:30 AM
 #2

Try "salvage" first before attempting to use any third-party tool.
If you have Bitcoin Core, you should have "bitcoin-wallet" tool in your Bitcoin directory.
Follow this post to use the command: http://bitcointalk.org/index.php?topic=5380489.msg58965353#msg58965353

For pywallet, you can try to paste a copy of the corrupted wallet.dat to a directory of you choosing, then use --recover with that disk to see if pywallet can fetch any intact keys from your wallet.
For that, follow this guide: http://bitcointalk.org/index.php?topic=5408068.msg60653031#msg60653031

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
l_ (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
February 10, 2023, 09:56:09 AM
 #3

Using the bitcoin-wallet -wallet=mywallet.dat salvage command I get
Failed to rename C:\Users\l_\AppData\Roaming\Bitcoin\wallets\mywallet.dat to C:\Users\l_\AppData\Roaming\Bitcoin\wallets\mywallet.dat.1676022832.bak

Does this mean that I'm unable to salvage the wallet file?
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6310


Self-proclaimed Genius


View Profile
February 10, 2023, 10:48:33 AM
 #4

-snip-
Does this mean that I'm unable to salvage the wallet file?
Probably not, error doesn't look like a failed salvage attempt.
It's self-explanatory, it may happen if you've accidentally entered the command in quick succession, have the wrong date or other reasons why it failed to rename the original wallet.dat into a backup file.

Anyways, did it created a new "wallet.dat" file in place of the old "my_wallet.dat"? If so, try if it'll load in Bitcoin Core with "File->Open Wallet".

BTW, I take that you've already created a backup of your wallet.dat, it's mandatory, specially before attempting to use pywallet.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
l_ (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
February 10, 2023, 04:44:04 PM
 #5

-snip-
Does this mean that I'm unable to salvage the wallet file?
Probably not, error doesn't look like a failed salvage attempt.
It's self-explanatory, it may happen if you've accidentally entered the command in quick succession, have the wrong date or other reasons why it failed to rename the original wallet.dat into a backup file.

Anyways, did it created a new "wallet.dat" file in place of the old "my_wallet.dat"? If so, try if it'll load in Bitcoin Core with "File->Open Wallet".

BTW, I take that you've already created a backup of your wallet.dat, it's mandatory, specially before attempting to use pywallet.


So I renamed the wallet from mywallet.dat to just wallet.dat. It's in this location... "C:\Users\l_\AppData\Roaming\Bitcoin\wallets\wallet.dat"

Running the command 'bitcoin-wallet -wallet=wallet.dat salvage' returns
Failed to rename C:\Users\l_\AppData\Roaming\Bitcoin\wallets\wallet.dat to C:\Users\l_\AppData\Roaming\Bitcoin\wallets\wallet.dat.1676046638.bak
The file name of wallet.dat.1676046638.bak changes with each attempt to run that command, just the last few numbers. I assume this is so it doesn't overwrite anything.

Running the command also creates new files and a folder called database in "C:\Users\l_\AppData\Roaming\Bitcoin\wallets".

It looks like this:
File Folder             [database]
WALLETLOCKFILE  [.walletlock]
Text Document      [db]
DAT File                [wallet]

Previously the only file in this folder was the wallet.dat file...
Opening the Text Document, db, I get the following text

C:\Users\l_\AppData\Roaming\Bitcoin\wallets\wallet.dat: unsupported btree version: 10

In the database file folder there is a text document called log. I'm unable to read this as it's some illegible bytes text.
And the .walletlock file is empty.

I'm assuming that the next step would be to solve why it isn't created the wallet.dat.%numbers%.bak file , because of the failed to rename error...
By the way I'm able to create the wallet.dat.%numbers%.bak file using healthy wallets. For this corrupt wallet though it doesn't seem to work.
nc50lc
Legendary
*
Offline Offline

Activity: 2590
Merit: 6310


Self-proclaimed Genius


View Profile
February 11, 2023, 02:48:27 AM
 #6

File Folder             [database]
WALLETLOCKFILE  [.walletlock]
Text Document      [db]
DAT File                [wallet]
Those are associated with the wallet.dat file in the same directory, it's not recommended to open them manually as text files.

-snip-
Running the command 'bitcoin-wallet -wallet=wallet.dat salvage' returns
Failed to rename C:\Users\l_\AppData\Roaming\Bitcoin\wallets\wallet.dat to C:\Users\l_\AppData\Roaming\Bitcoin\wallets\wallet.dat.1676046638.bak
The file name of wallet.dat.1676046638.bak changes with each attempt to run that command, just the last few numbers. I assume this is so it doesn't overwrite anything.
The "wallet.dat.1676046638.bak" files are the previous wallet.dat file prior to using the command.
The number is the "unix timestamp" (epoch date) of the date when the backup was created.

The wallet.dat, if present should be the "salvaged" wallet, have you tried if it'll load in Bitcoin Core without errors?
If it didn't, try to paste a fresh copy of your corrupted wallet.dat file, run the command with it once and load the wallet to Bitcoin Core.
If it still didn't work, try pywallet --recover.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!