Bitcoin Forum
June 21, 2024, 12:17:36 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Dumpwallet not available. What to use instead of it?  (Read 156 times)
Gorilla22 (OP)
Jr. Member
*
Offline Offline

Activity: 42
Merit: 66


View Profile
September 28, 2022, 03:10:23 PM
 #1

Hi guys,

I tried to dumpwallet my another old Core but discovered that its version doesn't have "dumpwallet" option on console.

Though it worked with dumpprivkeys. But I need all private keys and addresses.

Is there any other possibility which can replace "dumpwallet" with the same result, getting private keys and addresses?

I prefer not to upgrade the version.

Thank you!

Here is the list of options from console:


 
addmultisigaddress <nrequired> <'["key","key"]'> [account]
addnode <node> <add|remove|onetry>
backupwallet <destination>
createmultisig <nrequired> <'["key","key"]'>
createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...}
decoderawtransaction <hex string>
dumpprivkey <bitcoinaddress>
encryptwallet <passphrase>
getaccount <bitcoinaddress>
getaccountaddress <account>
getaddednodeinfo <dns> [node]
getaddressesbyaccount <account>
getbalance [account] [minconf=1]
getblock <hash>
getblockcount
getblockhash <index>
getblocktemplate [params]
getconnectioncount
getdifficulty
getgenerate
gethashespersec
getinfo
getmininginfo
getnewaddress [account]
getpeerinfo
getrawmempool
getrawtransaction <txid> [verbose=0]
getreceivedbyaccount <account> [minconf=1]
getreceivedbyaddress <bitcoinaddress> [minconf=1]
gettransaction <txid>
gettxout <txid> <n> [includemempool=true]
gettxoutsetinfo
getwork [data]
help [command]
importprivkey <bitcoinprivkey> [label] [rescan=true]
keypoolrefill
listaccounts [minconf=1]
listaddressgroupings
listlockunspent
listreceivedbyaccount [minconf=1] [includeempty=false]
listreceivedbyaddress [minconf=1] [includeempty=false]
listsinceblock [blockhash] [target-confirmations]
listtransactions [account] [count=10] [from=0]
listunspent [minconf=1] [maxconf=9999999] ["address",...]
lockunspent unlock? [array-of-Objects]
move <fromaccount> <toaccount> <amount> [minconf=1] [comment]
sendfrom <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]
sendmany <fromaccount> {address:amount,...} [minconf=1] [comment]
sendrawtransaction <hex string>
sendtoaddress <bitcoinaddress> <amount> [comment] [comment-to]
setaccount <bitcoinaddress> <account>
setgenerate <generate> [genproclimit]
settxfee <amount>
signmessage <bitcoinaddress> <message>
signrawtransaction <hex string> [{"txid":txid,"vout":n,"scriptPubKey":hex,"redeemScript":hex},...] [<privatekey1>,...] [sighashtype="ALL"]
stop
submitblock <hex data> [optional-params-obj]
validateaddress <bitcoinaddress>
verifymessage <bitcoinaddress> <signature> <message>
nc50lc
Legendary
*
Offline Offline

Activity: 2450
Merit: 5724


Self-proclaimed Genius


View Profile
September 28, 2022, 03:27:23 PM
 #2

I prefer not to upgrade the version.
Unfortunately, if your offline Bitcoin Core is lower than version v0.9.0, dumpwallet wont be available
and there's no alternative command since it's added to do its job which the previous version do not have.

The only way to export all of the private keys in one go without upgrading to an earlier version is to use third-party tools like pywallet.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BitMaxz
Legendary
*
Online Online

Activity: 3290
Merit: 3021


BTC price road to $80k


View Profile WWW
September 28, 2022, 03:37:33 PM
 #3

If your Bitcoin core doesn't have that option then like the above said pywallet is your option to dump the wallet.

You can download the this tool from here https://github.com/jackjack-jj/pywallet
Then don't forget to download and install python 2.7 in your PC/laptop to make this tool work.

Then use this command below

Code:
python pywallet.py --dumpwallet --wallet=wallet.dat
You must open the command prompt on the same folder where your wallet.dat is located.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NeuroticFish
Legendary
*
Offline Offline

Activity: 3710
Merit: 6427


Looking for campaign manager? Contact icopress!


View Profile
September 28, 2022, 03:45:25 PM
 #4

I will add that if by chance you know the relevant addresses and they're not too many you can also do dumpprivkey for each address separately.
This way you don't need external tools.

If your wallet is password protected, you'll need something like:

Code:
walletpassphrase "your password" 600
dumpprivkey "your address"

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
Gorilla22 (OP)
Jr. Member
*
Offline Offline

Activity: 42
Merit: 66


View Profile
September 28, 2022, 04:03:57 PM
 #5

nc50lc,
BitMaxz,


Thank you for your replies.
I see....
Probably upgrading Core is a more simple and convenient option. To backup wallet.dat first, then upgrade. I can download the new version installation file to new PC, then transfer it to the old PC where Core is located  and upgrade offline.
Will it work this way?
Is it still necessary to verify signatures if the upgraded Core is supposed to never go online?

As to pywallet tool, is it safe? Does one need to verify signatures on download?
I never used python and don't know how it works. But I can learn of course if I choose this option.
Is it safe to download Python?

I just try to find best combination of security and convenience/simplicity. Not because I am lazy, but because I do many things for the first time, and need to learn them first.

NeuroticFish,

Thank you for your reply.
Yes, I did dumpprivkey for all visible addresses.
But some amounts may be on change addresses, and change addresses are available only through dumpwallet (as much as I know).
When I was experimenting with another Core, I found my btc on change addresses.
nc50lc
Legendary
*
Offline Offline

Activity: 2450
Merit: 5724


Self-proclaimed Genius


View Profile
September 28, 2022, 04:40:31 PM
 #6

Probably upgrading Core is a more simple and convenient option. To backup wallet.dat first, then upgrade. I can download the new version installation file to new PC, then transfer it to the old PC where Core is located  and upgrade offline.
Will it work this way?
Yes, but if you do not want to touch your old datadir and old bitcoin installation (for some reason) you don't even have to install over your old Bitcoin Core.
Just install it somewhere else (a different folder) and launch it with extra parameters to use different datadir with a copy of your wallet.dat file.

Example process:
  • Install the latest version of Bitcoin Core to a different directory; e.g.: in "C:/Program Files/bitcoin-latest"
  • Create your "other" bitcoin data directory in any folder and make a folder named "wallets" inside it; e.g.: in "C:/bitcoin_temp"
  • Paste a copy of your wallet.dat inside that "wallets" folder (note: without the quotation marks), I'd suggest you to rename it into something else like old_wallet.dat
  • Go to "bitcoin-latest" install directory and find Bitcoin-qt and create a shortcut (Right-click->Create shortcut)
  • Open the created shortcut's Properties (Right-click->Properties) and add --datadir=C:/bitcoin_temp to the "Target"
  • So Target should look like: "C:\Program Files\bitcoin-latest\bitcoin-qt.exe" --datadir=C:\bitcoin_copy
  • Open Bitcoin Core using that shortcut and the wallet should be selectable in "File->Open wallet" menu.
  • Then use dumpwallet.

Either this or use pywallet.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
nc50lc
Legendary
*
Offline Offline

Activity: 2450
Merit: 5724


Self-proclaimed Genius


View Profile
September 28, 2022, 04:59:51 PM
 #7

Is it important to verify signatures on Core download anyway, even if it will never be launched online?
I left that so you can decide for yourself, since IMO it's not necessary for air-gap PC as long as the source is legit.
But If I were to decide, I'd still verify the signature in the online PC where it's downloaded before transferring it to the air-gap PC.
See, I also have contradicting answers  ;D

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Gorilla22 (OP)
Jr. Member
*
Offline Offline

Activity: 42
Merit: 66


View Profile
September 28, 2022, 05:05:16 PM
 #8

nc50lc,

Thank you for sharing your opinion about verifying.

Here I am developing further your idea with not overwriting Core.

May be I don't need to download anything at all?

Because I have 2 Core on the old PC. And another one is version with dumpwallet.

I can use it this way:

1. back up wallet.dat of this newer Core.
2. replace it with copied wallet.dat of older Core.'
3. dumpwallet.
4. Replace wallet.dat with original one.

Will it work?
BitMaxz
Legendary
*
Online Online

Activity: 3290
Merit: 3021


BTC price road to $80k


View Profile WWW
September 28, 2022, 11:04:42 PM
 #9

I can use it this way:

1. back up wallet.dat of this newer Core.
2. replace it with copied wallet.dat of older Core.'
3. dumpwallet.
4. Replace wallet.dat with original one.

Will it work?

it should work even if you don't need to do the 4th step just delete your old wallet.dat it the core itself will generate a new wallet.dat.

You can also install the latest Bitcoin core on your new PC and transfer the old wallet.dat file there but the problem is that it is not safe if you dump a wallet from a PC connected to the internet.

Just always make sure before you do anything from your old wallet make sure you already have a backup copy of your old wallet if anything goes wrong while upgrading it to the latest version you can recover it by using pywallet.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
nc50lc
Legendary
*
Offline Offline

Activity: 2450
Merit: 5724


Self-proclaimed Genius


View Profile
September 29, 2022, 04:52:34 AM
 #10

May be I don't need to download anything at all?

Because I have 2 Core on the old PC. And another one is version with dumpwallet.

I can use it this way:

1. back up wallet.dat of this newer Core.
2. replace it with copied wallet.dat of older Core.'
3. dumpwallet.
4. Replace wallet.dat with original one.
Two different Core versions in the same old PC?
Without using the command line argument -datadir, those two should've used the same data directory thus, same wallet.dat file.
Or did you already know how to use -datadir which separates the two Bitcoin Core?

Anyways, that'll do, but make sure that Bitcoin Core isn't running while switching the wallet.dat files.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Gorilla22 (OP)
Jr. Member
*
Offline Offline

Activity: 42
Merit: 66


View Profile
September 29, 2022, 08:12:43 AM
Last edit: September 29, 2022, 01:55:58 PM by Gorilla22
Merited by nc50lc (1)
 #11

nc50lc,

Yes 2 Core on the same PC. But I have 2 users on it. Both of them are me, one user is like "for serious business", another one is like for "things other than work".
So these 2 Core belong to two different users and can run independently.

They are synced also different way, the newer Core has more "fresh" sync than the older Core.

Unfortunately, it did not work with using  wallet.dat from older Core on the newer Core.

I tried several times and the newer Core reacted by different ways on it:

- didn't launch for a very long time
- tried to launch but said "corrupt wallet.dat"
- Launched but created a new wallet.dat, with no transaction history, no balance etc.

Core was changing wallet.dat during every attempt to launch. And every time by different way! :-)

After every attempt  I was closing Core and replacing changed older wallet.dat with original older wallet.dat.

Btw, when I replaced older wallet.dat with newer wallet.dat (the original one for this Core), then it launched perfectly OK.

So it doesn't want to launch properly just with the wallet.dat that "doesn't belong to it" :-)

Can one draw conclusion that this method doesn't work?

Or may be the difference in sync is the problem? If this is the problem, may be it is possible to try  with replacing not only wallet.dat, but also with replacing sync data?
May be this will work?
If you think this may work, please tell me which data on newer Core should be replaced with the data from older Core.
Which files and folders.

Another solution I can imagine: Create the 3-d user on old PC, install latest version of Core there quite simple way, try replacing wallet.dat.

Are there chances this will work?

UPDATE: It worked!!!! I'll write later how I did it!

UPDATE: Here is how it was done.

This option

1. back up wallet.dat of this newer Core.
2. replace it with copied wallet.dat of older Core.'
3. dumpwallet.
4. Replace wallet.dat with original one.

But I was waiting over 2 hours until Core launches and start running. I didn't try to shut it down (because it takes so long time to launch), I was just waiting.
And it worked.
After it launched, the right wallet with right balance and history was shown.
And I was able to do dumpwallet.


The issue is solved.

Many thanks guys for your replies and advices!


nc50lc
Legendary
*
Offline Offline

Activity: 2450
Merit: 5724


Self-proclaimed Genius


View Profile
September 29, 2022, 02:24:25 PM
 #12

Quote from: Gorilla22
Yes 2 Core on the same PC. But I have 2 users on it. Both of them are me, one user is like "for serious business", another one is like for "things other than work".
So these 2 Core belong to two different users and can run independently.
Okay, that explains it.

-snip-
So it doesn't want to launch properly just with the wallet.dat that "doesn't belong to it" :-)
Can one draw conclusion that this method doesn't work?
-snip-
UPDATE: It worked!!!! I'll write later how I did it!
But I was waiting over 2 hours until Core launches and start running. I didn't try to shut it down (because it takes so long time to launch), I was just waiting.
And it worked.
After it launched, the right wallet with right balance and history was shown.
It just had to rescan the blockchain for the newly replaced wallet.dat,
since the newer Bitcoin Core has "fresher" blockchain, it took a while to reach the tip.
As a bonus, your old wallet.dat's balance appeared since its transactions are probably within the older blocks that the newer Core has.

For comparison, rescan will take way more hours than that if your Bitcoin Core is fully synced.

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Gorilla22 (OP)
Jr. Member
*
Offline Offline

Activity: 42
Merit: 66


View Profile
September 29, 2022, 04:46:59 PM
Last edit: September 29, 2022, 05:03:54 PM by Gorilla22
 #13

nc50lc,

Thank you very much!

And I have got a new challenge with this wallet :-)

I'll start a new topic about it :-)


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!