Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: PetePete on May 06, 2014, 04:38:37 PM



Title: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: PetePete on May 06, 2014, 04:38:37 PM
Hey I'm using the most recent Bitcoin core client and I was wondering if I would be able to extract or just view the private key either from the client software or the wallet.dat? Any help appreciated.


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: shorena on May 06, 2014, 05:00:54 PM
start bitcoin core -> help -> debug window -> console:

- help to see the list of commands and how they work (or see here: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list )
- walletpassphrase "password" 120 to unlock your wallet, 120 is the timeout in seconds befor it locks inself again. 2 Minutes should be enough ;)
- dumpprivkey "bitcoinaddress" to get a private key to a given address


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: PetePete on May 06, 2014, 05:06:20 PM
Thanks for your help! Thing is I'm generating a new address for every transaction for will the private key be the same for all of these? Also once I get the private key will everything remain the same in the client? Can I use it as normal?


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: shorena on May 06, 2014, 05:21:48 PM
Thanks for your help! Thing is I'm generating a new address for every transaction for will the private key be the same for all of these?

No, a new addresse comes with a new private key.

Also once I get the private key will everything remain the same in the client?

Yes, you just get a copy of the private key. Well if you lose that you might notice that your "available" amount of BTC is deminishing, so take care of the key ;)

Can I use it as normal?

Yes, you can use the wallet as you used it before.


In case you want to backup, you should not backup the private keys, but the wallet.dat.


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: DeathAndTaxes on May 06, 2014, 05:24:17 PM
Hey I'm using the most recent Bitcoin core client and I was wondering if I would be able to extract or just view the private key either from the client software or the wallet.dat? Any help appreciated.

Unless you have a specific purpose and in mind and fully understand the internal working of Bitcoin you shouldn't.  Just use the wallet, it will manage your keys for you.  Make a backup of your wallet.dat file.  That will backup all your private keys (plus the next 100 you are going to use in the future).  Messing around with raw private keys is a good way to end up losing funds if you don't know what you are doing.

Experimenting is one thing but for production use let the wallet "do its job". :)


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: PetePete on May 06, 2014, 05:25:08 PM
Ok, this is really intriguing to me!! Feel like im making some progress in understanding just the basic characteristics of Bitcoin.

Is there some kind of reader that can read the contents of the wallet.dat file so I can just view the private keys im using?


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: DeathAndTaxes on May 06, 2014, 05:27:55 PM
Ok, this is really intriguing to me!! Feel like im making some progress in understanding just the basic characteristics of Bitcoin.

Is there some kind of reader that can read the contents of the wallet.dat file so I can just view the private keys im using?

There is a tool called pywallet which can parse the wallet file, display data, dump keys, etc.  You can find it by searching the forum.


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: PetePete on May 06, 2014, 05:58:57 PM
Hmm interesting think I might just keep away... All I wanted to do is write down or print the private keys so that I have them in physical format as well as in digital format. Of course I would try my up most to keep the private keys hidden from view.

If I do decide to try and view the private keys using this software, is there any advice that can be offered to prevent me from messing up?


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: PetePete on May 06, 2014, 06:02:05 PM
hmm pywallet looks complicated to install..


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: DannyHamilton on May 07, 2014, 01:38:02 PM
is there any advice that can be offered to prevent me from messing up?

Yes.

1. Create a backup copy of your wallet.dat before you start messing with things.  That way if you damage anything, you can recover the wallet.dat.

2. Do not use written or printed copies of private keys as a backups for a Bitcoin-Qt (or Bitcoin Core) wallet that you are using.  The wallet regularly generates new private keys without telling you.  If all you have is the written (or printed) private keys, then you may not have access to your bitcoins (if the wallet has moved that access to a new set of private keys since the time when you wrote, or printed, them).


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: PetePete on May 07, 2014, 05:44:31 PM
Thanks for that warning Danny..

Think I will just wait tight for multi sig services in the mean time just make sure I have backups of my wallet.dat.. Possibly try looking at the contents of my wallet.dat file on an offline PC just for curiosity.


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: DeathAndTaxes on May 07, 2014, 05:50:17 PM
Possibly try looking at the contents of my wallet.dat file on an offline PC just for curiosity.

Then you will need to bite the bullet and install pywallet. 


Title: Re: How can I find/extract my priavte key from my Bitcoin core client/ wallet.dat?
Post by: PetePete on May 08, 2014, 03:20:15 PM
On my to do list :)