Pages:
Author

Topic: Pywallet 2.2: manage your wallet [Update required] - page 2. (Read 208227 times)

newbie
Activity: 4
Merit: 0
So i use the --dumpwallet command on the recoveredwallet into wallet.txt?
I'd try Bitcoin Core first... nothing to lose, easiest way to go about it. Just make a copy of the .dat file... then try opening it with Bitcoin Core... just be prepared to wait while it rescans the blockchain looking for transactions. Note this is NOT redownloading the blocks (assuming your node is NOT pruned), it just has to scan the block data.


and then how do i import those into a wallet of my choice.
Really depends on what wallet you want to import it too... But the --dumpwallet command should give you the private keys in WIF format... assuming that you include the --passphrase parameter when dumping the wallet.


For Bitcoin Core, you just use the importprivkey command on the console in Bitcoin Core (make sure to set rescan to false until you import the last key, otherwise it will run rescan every. single. time. Shocked Shocked Shocked)

Or you can look up one of the many many many guides on how to import private keys into Electrum... Like this one: https://bitcoinelectrum.com/importing-your-private-keys-into-electrum/

Google is your friend. Wink

ty i try to google when I can, just was confused on a few things that you set straight. Appreciate it.
HCP
legendary
Activity: 2086
Merit: 4361
So i use the --dumpwallet command on the recoveredwallet into wallet.txt?
I'd try Bitcoin Core first... nothing to lose, easiest way to go about it. Just make a copy of the .dat file... then try opening it with Bitcoin Core... just be prepared to wait while it rescans the blockchain looking for transactions. Note this is NOT redownloading the blocks (assuming your node is NOT pruned), it just has to scan the block data.


and then how do i import those into a wallet of my choice.
Really depends on what wallet you want to import it too... But the --dumpwallet command should give you the private keys in WIF format... assuming that you include the --passphrase parameter when dumping the wallet.


For Bitcoin Core, you just use the importprivkey command on the console in Bitcoin Core (make sure to set rescan to false until you import the last key, otherwise it will run rescan every. single. time. Shocked Shocked Shocked)

Or you can look up one of the many many many guides on how to import private keys into Electrum... Like this one: https://bitcoinelectrum.com/importing-your-private-keys-into-electrum/

Google is your friend. Wink
newbie
Activity: 4
Merit: 0
a recovered_wallet.dat may or may not open with Bitcoin Core... theoretically, it should be compatible, so you should be able to open it directly... but it's possible that pywallet is not creating it in a format that Bitcoin Core can handle.

In which case, dumping the private keys out of it, then importing those into the wallet of your choice would be a viable solution.


Note that Electrum would enable you to import and scan the keys in a matter of minutes, whereas rescanning in Bitcoin Core could take hours. Neither guarantees that the "keys" found are actually going to contain any coins.

So i use the --dumpwallet command on the recoveredwallet into wallet.txt? and then how do i import those into a wallet of my choice. I have bitcoincore installed. almost done dling the blockchain


or should i just try opening the wallet in bitcoin core first. the old wallets were from 2013
HCP
legendary
Activity: 2086
Merit: 4361
a recovered_wallet.dat may or may not open with Bitcoin Core... theoretically, it should be compatible, so you should be able to open it directly... but it's possible that pywallet is not creating it in a format that Bitcoin Core can handle.

In which case, dumping the private keys out of it, then importing those into the wallet of your choice would be a viable solution.


Note that Electrum would enable you to import and scan the keys in a matter of minutes, whereas rescanning in Bitcoin Core could take hours. Neither guarantees that the "keys" found are actually going to contain any coins.
newbie
Activity: 4
Merit: 0
Ok so I ran --recover on the old computer and got recovered wallet and pywallet partial recovery json what do I do next? dumpwallet? and then I import the keys with bitcoin core somehow? or do i just try to open the wallet with bitcoin core?
HCP
legendary
Activity: 2086
Merit: 4361
My Bitcoin Core is fully synced and I tried opening this wallet but get stuck on "Opening Wallet. Not sure what do next.
It's likely that Bitcoin Core was "rescanning" your "new" wallet with all the recovered keys in it... it will be starting from basically block 0... and this can take several hours to complete.

Check the debug.log in your Bitcoin Core datadir... you should hopefully see a bunch of debug lines like this:
Code:
...
2021-05-19T05:59:34Z [default_wallet] Still rescanning. At block 538973. Progress=0.525272
2021-05-19T06:00:34Z [default_wallet] Still rescanning. At block 544471. Progress=0.538657
2021-05-19T06:01:34Z [default_wallet] Still rescanning. At block 550317. Progress=0.555550
2021-05-19T06:02:34Z [default_wallet] Still rescanning. At block 555563. Progress=0.571671
2021-05-19T06:03:34Z [default_wallet] Still rescanning. At block 561564. Progress=0.590429
...

It should also give you an idea how how quickly it is syncing... note that the progress value is from 0 to 1.0, where 1.0 == 100%... so in the lines above... the last line was at just over 59% complete Wink




I'm in the same boat as this guy. Except things are shuffled in the wallet. I can find ke and y1 and na and me but pywallet leads to the same error. Also don't remember getting that windows error. I did try --recover but no keys or possible wallets were found. Any ideas what command to try or where to proceed next?
Sounds like a corrupted recovery... or possibly the text editor you're using is formatting the binary data in a really weird way... what text editor did you use? I'd recommend Notepad++

If Pywallet isn't able to find any keys to recover, then it's possible the recovered wallet is too badly damaged or the data has been overwritten on disk, so it wasn't able to find anything resembling a wallet.dat.

It can be a bit "hit and miss"... so maybe try different recovery software... or maybe raw image the drive then try scanning the raw image for the hex markers for wallet.dat fields/private keys etc
newbie
Activity: 4
Merit: 0
Hello I used Recuva on an old HDD from 2013/2014 and found a wallet.dat file. Recuva said the wallet.dat file was in excellent condition. I tried using 2 versions of Bitcoin Core (0.21.1 and 0.8.6) to read the wallet.dat and was given the warning "wallet.dat corrupt, salvage failed". I installed Python 2.7.11, Pywallet, and all its dependencies and tried the following commands.


Pywallet DumpWallet Attempt:
Code:
python pywallet.py --dumpwallet --datadir=./ --wallet=wallet.dat

'ecdsa' package is not installed, pywallet won't be able to sign/verify messages
ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again. (Bitcore was not open)

Pywallet Recovery Attempt:
I reformatted a flash drive in FAT32 and put the wallet.dat file in it and attempted the following recovery code
Code:
python pywallet.py --recover --recov_device=E:\wallet.dat  --recov_size=14.5Gio --recov_outputdir=.

Found 0 possible wallets
Found 0 possible encrypted keys
Found 0 possible unencrypted keys
WindowsError: exception: access violation reading 0x000000005FF07E98

The wallet.dat file is 328KB. I inspected it using a HexEditor and Notepad++ and it doesn't look corrupted. When I search notepad++ for 'key', there is 1 match, but when I search for 'name' there are no matches. My next step is to recover the HDD using GetDataBack instead of Recuva, and then reattempt what I have done so far. I would appreciate any help!

I'm in the same boat as this guy. Except things are shuffled in the wallet. I can find ke and y1 and na and me but pywallet leads to the same error. Also don't remember getting that windows error. I did try --recover but no keys or possible wallets were found. Any ideas what command to try or where to proceed next?
legendary
Activity: 2702
Merit: 1030
Yes I am a pirate, 300 years too late!
Import the keys into a blank wallet.
newbie
Activity: 4
Merit: 0
recov_device should just be the drive letter (in windows) if you want to check an entire drive... you don't want to specify a "file"

Try:
Code:
python pywallet.py --recover --recov_device=E: --recov_size=1000Gio --recov_outputdir=.

Thank you this worked! I got a recovered wallet.dat file that was much bigger than my original (~1000KB) with a bunch of keys in it. I ran the code below and got a few hundred addresses. My Bitcoin Core is fully synced and I tried opening this wallet but get stuck on "Opening Wallet. Not sure what do next.

Code:
pywallet.py --dumpwallet  --wallet=wallet.dat > walletdump.txt

Code:
Example Output:
 "addr": "1GK46gd6C8nXXXXXXXXXXXX3HMgbqHF",
            "compressed": false,
            "encrypted_privkey": "5613a75d7ad6c19135a26eXXXXXXXXXXXXXXXX1908e61cb08cf49e21dXXXXXb1c65142912",
            "label": "recovered: 93bfXXXXXXXXXXXXXXXXXX710881d50XXXXX89585154c",
            "pubkey": "04ef1bc57033e7942233fb6d21f421XXXXXXXXXXXXXXXXXXXXXXXXXX6f74cf794ced69144dbb379c373d4b780fa4151bb50a3",
            "reserve": 0
        },
HCP
legendary
Activity: 2086
Merit: 4361
recov_device should just be the drive letter (in windows) if you want to check an entire drive... you don't want to specify a "file"

Try:
Code:
python pywallet.py --recover --recov_device=E: --recov_size=1000Gio --recov_outputdir=.
newbie
Activity: 4
Merit: 0
Did you run pywallet as administrator? Also I wouldn't count on recovery software to be the best option. I would run pywallet on the whole hard drive rather than on a file you recovered via recuva or whatever software. Make sure you include the passphrase when you run pywallet, if the wallet was encrypted. If It finds any private keys you can then use them with Electrum, I don't think you can just use a wallet recovered by pywallet straight into Bitcoin Core. Obviously it will be safer to try this on your cloned version of the hard drive. Good luck.

I will try running pywallet as admin on the entire hard drive. What command should i run for a 1TB HDD. Will the below command work? I appreciate the help!

Code:
python pywallet.py --recover --recov_device=E:  --recov_size=932Gio --recov_outputdir=.

EDIT: I figured out the code to run this and fixed it above.
full member
Activity: 217
Merit: 109
Did you run pywallet as administrator? Also I wouldn't count on recovery software to be the best option. I would run pywallet on the whole hard drive rather than on a file you recovered via recuva or whatever software. Make sure you include the passphrase when you run pywallet, if the wallet was encrypted. If It finds any private keys you can then use them with Electrum, I don't think you can just use a wallet recovered by pywallet straight into Bitcoin Core. Obviously it will be safer to try this on your cloned version of the hard drive. Good luck.
newbie
Activity: 4
Merit: 0
I tried using 2 versions of Bitcoin Core (0.21.1 and 0.8.6) to read the wallet.dat and was given the warning "wallet.dat corrupt, salvage failed".

If you see error message when you open Bitcoin Core normally, you can external Bitcoin Core tools to salvage your wallet properly. Check this thread, Salvagewallet in latest Bitcoin core.

My next step is to recover the HDD using GetDataBack instead of Recuva, and then reattempt what I have done so far.

I strongly suggest you to make RAW copy of your HDD using tools such as http://www.hddguru.com/software/HDD-Raw-Copy-Tool/. After doing that, you can use the software to scan the RAW copy instead.
If you're searching text with a hex editor then you need to type key!. The exclamation mark is important, but is not used for the master key (mkey). You might not get a hit on the word name as that doesn't always appear in a wallet.dat. It is another term for address. If the wallet was encrypted by using a passphrase, then the private keys should be searched by the term ckey! if using a hex editor.


I searched for 'mkey', 'ckey', 'key!', and 'key' using a Hex Editor and I only got 1 match for 'key', nothing else. Can I do anything with this? I am in the process of making a raw copy of my HDD using HDD-Raw-Copy-Tool and searching that for a wallet.dat file. Will probably have to delay that until the weekend though.

full member
Activity: 217
Merit: 109
I tried using 2 versions of Bitcoin Core (0.21.1 and 0.8.6) to read the wallet.dat and was given the warning "wallet.dat corrupt, salvage failed".

If you see error message when you open Bitcoin Core normally, you can external Bitcoin Core tools to salvage your wallet properly. Check this thread, Salvagewallet in latest Bitcoin core.

My next step is to recover the HDD using GetDataBack instead of Recuva, and then reattempt what I have done so far.

I strongly suggest you to make RAW copy of your HDD using tools such as http://www.hddguru.com/software/HDD-Raw-Copy-Tool/. After doing that, you can use the software to scan the RAW copy instead.
If you're searching text with a hex editor then you need to type key!. The exclamation mark is important, but is not used for the master key (mkey). You might not get a hit on the word name as that doesn't always appear in a wallet.dat. It is another term for address. If the wallet was encrypted by using a passphrase, then the private keys should be searched by the term ckey! if using a hex editor.
newbie
Activity: 4
Merit: 0
Hello I used Recuva on an old HDD from 2013/2014 and found a wallet.dat file. Recuva said the wallet.dat file was in excellent condition. I tried using 2 versions of Bitcoin Core (0.21.1 and 0.8.6) to read the wallet.dat and was given the warning "wallet.dat corrupt, salvage failed". I installed Python 2.7.11, Pywallet, and all its dependencies and tried the following commands.


Pywallet DumpWallet Attempt:
Code:
python pywallet.py --dumpwallet --datadir=./ --wallet=wallet.dat

'ecdsa' package is not installed, pywallet won't be able to sign/verify messages
ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again. (Bitcore was not open)

Pywallet Recovery Attempt:
I reformatted a flash drive in FAT32 and put the wallet.dat file in it and attempted the following recovery code
Code:
python pywallet.py --recover --recov_device=E:\wallet.dat  --recov_size=14.5Gio --recov_outputdir=.

Found 0 possible wallets
Found 0 possible encrypted keys
Found 0 possible unencrypted keys
WindowsError: exception: access violation reading 0x000000005FF07E98

The wallet.dat file is 328KB. I inspected it using a HexEditor and Notepad++ and it doesn't look corrupted. When I search notepad++ for 'key', there is 1 match, but when I search for 'name' there are no matches. My next step is to recover the HDD using GetDataBack instead of Recuva, and then reattempt what I have done so far. I would appreciate any help!
full member
Activity: 217
Merit: 109
Is the latest update useable and stable? Python 3 supported? Thanks.
HCP
legendary
Activity: 2086
Merit: 4361
Not overly familiar with the Dogecoin Core client (I've used it but not extensively)... but it might have the -salvagewallet option that might be able to recover something? Huh

Failing that, Python2.7 and an old copy of PyWallet before the latest 2021 updates (made by JackJack recently) might be your best bet with a Dogecoin wallet.dat. Either this version from the last commit back in 2014... or you can try my one here: https://github.com/HardCorePawn/pywallet

Basically, the only mods I had made from the 2014 version were to stop it complaining about "key-meta" records and such that were in "newer" wallet.dat's.
newbie
Activity: 2
Merit: 0
Hey HCP, I did try that. The wallet is considered corrupted by the doge coin wallet - I was trying to follow this post: https://walletrecovery.info/how-to-recover-your-corrupt-or-deleted-bitcoin-core-wallet/ for recovery. (Trying to help a non-tech savvy friend get his coins back  Lips sealed but have limits to my time, kids etc. but also I'm not super xCoin savvy.)
HCP
legendary
Activity: 2086
Merit: 4361
Have you tried downloading the Dogecoin Core wallet and opening the wallet.dat files with that? Huh

You don't need the dogecoin blockchain synced to be able to open the wallet. Just shutdown Dogecoin Core, then replace the wallet.dat in the Dogecoin data directory with a copy of one of your old wallets (renamed as wallet.dat) and then restart Dogecoin Core.

If the wallet file is actually corrupt, you'll likely get errors from Dogecoin Core saying so. If you don't get any errors, you can try using walletpassphrase and dumpwallet from the Core client console to dump the keys from the wallet file.
newbie
Activity: 2
Merit: 0
Probably user error, but I've tried a few different tactics to get pywallet working with Dogecoin.

I've got a few old wallets we recovered from an old hard drive.

Is there any special option I have to pass in to get it to work?

Code:
python pywallet.py -d -w //wallet.dat.r1 --passphrase=xxxxxx
WARNING:root:pycrypto or libssl not found, decryption may be slow
(22, 'Invalid argument -- __db_meta_setup: /Users/jono/pywallet/wallet.dat: unexpected file type or format')
ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again.
I've tried this, I've tried downloading the super old https://github.com/01BTC10/dogecoin-pywallet to a file pywallet_doge_old.py - and ran with this:

Code:
python pywallet_doge_old.py --datadir= --wallet=wallet.dat.r1 --otherversion 30 --dumpwallet  --passphrase=xxxxxxx
#=>
WARNING:root:pycrypto or libssl not found, decryption may be slow
ERROR:root:Couldn't open wallet.dat/main. Try quitting Dogecoin and running this again.
I don't have Dogecoin running nor installed, I also had to get creative to get all the dependencies for pywallet installed - I'd be screwed if I wasn't a developer :vomit:

Anyone have any feedback?
Pages:
Jump to: