Bitcoin Forum
May 03, 2024, 11:42:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help in exporting privkeys from multiple bitcoin core wallet.dats and importing  (Read 116 times)
666uazan (OP)
Jr. Member
*
Offline Offline

Activity: 185
Merit: 1


View Profile
February 12, 2018, 07:48:21 PM
 #1

Basically this is my problem:

I have several wallet.dat files from bitcoin core.
I want to export all the privkeys of all those wallets.
Then import them all into 1 single wallet.dat.
I want to do this without opening the wallet.dat with bitcoin core. Because it takes a lot of time to rescan.
Thank you!
1714779768
Hero Member
*
Offline Offline

Posts: 1714779768

View Profile Personal Message (Offline)

Ignore
1714779768
Reply with quote  #2

1714779768
Report to moderator
1714779768
Hero Member
*
Offline Offline

Posts: 1714779768

View Profile Personal Message (Offline)

Ignore
1714779768
Reply with quote  #2

1714779768
Report to moderator
1714779768
Hero Member
*
Offline Offline

Posts: 1714779768

View Profile Personal Message (Offline)

Ignore
1714779768
Reply with quote  #2

1714779768
Report to moderator
"This isn't the kind of software where we can leave so many unresolved bugs that we need a tracker for them." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714779768
Hero Member
*
Offline Offline

Posts: 1714779768

View Profile Personal Message (Offline)

Ignore
1714779768
Reply with quote  #2

1714779768
Report to moderator
1714779768
Hero Member
*
Offline Offline

Posts: 1714779768

View Profile Personal Message (Offline)

Ignore
1714779768
Reply with quote  #2

1714779768
Report to moderator
1714779768
Hero Member
*
Offline Offline

Posts: 1714779768

View Profile Personal Message (Offline)

Ignore
1714779768
Reply with quote  #2

1714779768
Report to moderator
LoyceV
Legendary
*
Offline Offline

Activity: 3304
Merit: 16587


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
February 12, 2018, 08:49:24 PM
 #2

I want to do this without opening the wallet.dat with bitcoin core. Because it takes a lot of time to rescan.
As a work around: you can load them all at once in Bitcoin Core (thanks to multi wallet support). I just tested it with 2 wallets, after that it shows all addresses in the GUI.
It still needs to rescan them all, but you can make it a one-time thing to start, then let it run overnight (or longer?).
If you want to give it a try, start Bitcoin Core with command line options:
Code:
--wallet=wallet1.dat --wallet=wallet2.dat --wallet=wallet3.dat

666uazan (OP)
Jr. Member
*
Offline Offline

Activity: 185
Merit: 1


View Profile
February 12, 2018, 09:22:45 PM
 #3

I did that with 3 wallets for testing purpose.
But it shows in the GUI only the first wallet... what now?
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
February 12, 2018, 09:36:45 PM
 #4

I have several wallet.dat files from bitcoin core.
I want to export all the privkeys of all those wallets.
Then import them all into 1 single wallet.dat.

You can use pywallet[1] to dump your private keys without opening the wallet in core.
The command would be the following:
Code:
./pywallet --dumpwallet --walletfile=YOUR_WALLET_FILE

You would have to run this command for every wallet seperately.
But if you have quite a lot of wallet files, you could write a simple script (3 liner) to do this automatically for each wallet.

[1] https://github.com/jackjack-jj/pywallet

BitMaxz
Legendary
*
Offline Offline

Activity: 3248
Merit: 2955


Block halving is coming.


View Profile WWW
February 12, 2018, 11:52:38 PM
 #5

I did that with 3 wallets for testing purpose.
But it shows in the GUI only the first wallet... what now?

Here you can try this command this time you can export all private keys

Code:
dumpwallet "filename"

sample dumpwallet myprivatekeys
and hit enter
The you can see where it save and you can open it in text file

or you can export it only selected address
Code:
dumpprivkey 1YouRBitcoinaddress

Do this if you wanted only selected addresses to be exported.. 
For importing you can use this command

Code:
importprivkey [Anylabelyouwant] [rescan=false]

or import wallet from dump wallet you can use this command
Code:
importwallet filename

Hope this works..

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
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!