Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: michaeladair on April 08, 2015, 02:21:51 PM



Title: Extracting private keys from wallet.dats?
Post by: michaeladair on April 08, 2015, 02:21:51 PM
Is there any way to extract wallet keys without having to turn off my wallet and change wallet.dats? I'm wondering this because here has to be an easier way if I'm stuck with a ton of wallet.dats, I'm wanting to code a bot to do this for me and put em all in a text file. Any ideas?


Title: Re: Extracting private keys from wallet.dats?
Post by: DannyHamilton on April 08, 2015, 02:24:16 PM
pywallet?


Title: Re: Extracting private keys from wallet.dats?
Post by: dsattler on April 08, 2015, 02:29:38 PM
If you're using bitcoin-qt (bitcoin core) wallet, you can open Help/Debug and go to the console. Enter

Quote
dumpprivkey "bitcoinaddress"

to extract the private key. If you encrypted your wallet, you must enter the wallet passphrase with "walletpassphrase" first.


Title: Re: Extracting private keys from wallet.dats?
Post by: NeuroticFish on April 08, 2015, 02:33:22 PM
Private key is shortly after a "keyA" ascii sequence in the file.
Some technical details are here: https://bitcointalk.org/index.php?topic=22697.0;topicseen
They should be useful, especially if you want to code the priv key searcher.


Title: Re: Extracting private keys from wallet.dats?
Post by: michaeladair on April 08, 2015, 05:52:08 PM
If you're using bitcoin-qt (bitcoin core) wallet, you can open Help/Debug and go to the console. Enter

Quote
dumpprivkey "bitcoinaddress"

to extract the private key. If you encrypted your wallet, you must enter the wallet passphrase with "walletpassphrase" first.

Can this be done in cmd using a language like autoit or something... With the wallet.dats on hand?


Title: Re: Extracting private keys from wallet.dats?
Post by: defcon23 on April 08, 2015, 06:17:40 PM
If you're using bitcoin-qt (bitcoin core) wallet, you can open Help/Debug and go to the console. Enter

Quote
dumpprivkey "bitcoinaddress"

to extract the private key. If you encrypted your wallet, you must enter the wallet passphrase with "walletpassphrase" first.

Can this be done in cmd using a language like autoit or something... With the wallet.dats on hand?
not just with the wallet.dat.
 To run this comand you have to run the client on your computer ( bitcoin core )


Title: Re: Extracting private keys from wallet.dats?
Post by: dsattler on April 08, 2015, 09:59:45 PM
If you're using bitcoin-qt (bitcoin core) wallet, you can open Help/Debug and go to the console. Enter

Quote
dumpprivkey "bitcoinaddress"

to extract the private key. If you encrypted your wallet, you must enter the wallet passphrase with "walletpassphrase" first.

Can this be done in cmd using a language like autoit or something... With the wallet.dats on hand?

Here is some info how to call the bitcoind API from various languages:

https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))


Title: Re: Extracting private keys from wallet.dats?
Post by: shorena on April 09, 2015, 07:37:26 AM
If you're using bitcoin-qt (bitcoin core) wallet, you can open Help/Debug and go to the console. Enter

Quote
dumpprivkey "bitcoinaddress"

to extract the private key. If you encrypted your wallet, you must enter the wallet passphrase with "walletpassphrase" first.

Can this be done in cmd using a language like autoit or something... With the wallet.dats on hand?

Here is some info how to call the bitcoind API from various languages:

https://en.bitcoin.it/wiki/API_reference_(JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_(JSON-RPC))

This requires to change the wallet.dat files each time. OP could just use pywallet.