Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: TookDk on April 08, 2014, 09:54:11 AM



Title: Importing private key into Bitcoin Core 0.9.0
Post by: TookDk on April 08, 2014, 09:54:11 AM
I was wondering about how private keys are stored in wallet.dat.

I use bitcoin core 0.9.0 as my hot-wallet, I have a series of public keys i use for different purposes.

If I import a private key with the command: importprivkey  (e.g. a selfgenerated vainity key)
Will this key just be added to wallet.dat in equal terms as the other private keys, which bitcoin-core has generated?

What happen if this newly imported private key later get compromised? This will compromise funds send to the corresponding public key, right?

I know I have almost answered the questions my self, just want to have a confirmation that I understood the application correct. 

Is there any good know practices about using vanity keys? Should they be also be kept separate from you other keys, or is it find to use bitcoin-core to manage all your private keys?


Title: Re: Importing private key into Bitcoin Core 0.9.0
Post by: Light on April 08, 2014, 10:17:45 AM
I was wondering about how private keys are stored in wallet.dat.

I use bitcoin core 0.9.0 as my hot-wallet, I have a series of public keys i use for different purposes.

If I import a private key with the command: importprivkey  (e.g. a selfgenerated vainity key)
Will this key just be added to wallet.dat in equal terms as the other private keys, which bitcoin-core has generated?

What happen if this newly imported private key later get compromised? This will compromise funds send to the corresponding public key, right?

I know I have almost answered the questions my self, just want to have a confirmation that I understood the application correct. 

Is there any good know practices about using vanity keys? Should they be also be kept separate from you other keys, or is it find to use bitcoin-core to manage all your private keys?

Yes in Qt it is just the same as the pregenerated ones and any future ones you may generate. If it gets compromised, it is the same as for any other private key, those funds can easily be moved and you'll unfortunately lose access to them. Vanity keys are exactly the same as the keys that are used normally, just that they have been found by bruteforcing private keys to match a specific pattern, so treat them no differently.

On a side note, if you're creating vanity addresses, try and make compressed keys as there is no reason really not to, and they use less space and IIRC they may lead to you needing less tx fees.


Title: Re: Importing private key into Bitcoin Core 0.9.0
Post by: TookDk on April 08, 2014, 10:53:53 AM
I believe I understand Bitcoin-Core correct then.

I have not been experimenting with generating compressed keys yet, but I get the idea about lowering the tx size.

Thanks for the reply, cheers!


Title: Re: Importing private key into Bitcoin Core 0.9.0
Post by: Opperdienaar on August 02, 2014, 03:48:30 PM
I generated some vanity addresses with vanitygen 0.22
I tried to import it in bitcoin core by in the debug window, open wallet, importprivkey "key" label
That all seems to work, the first one actually works, but with the second one, I request on this address to get QR code. It shows a different address from the vanity address. This new address is after this operation available under the same label as the vanity address. When I change the label and repeat a request for payment, it shows another address and this is added to the receive addresses.
Seems like a bug.

Figured it out, you need to click on reuse existing address.


Title: Re: Importing private key into Bitcoin Core 0.9.0
Post by: griffga on August 04, 2014, 01:47:31 AM
Have you tried using the importprivkey command from the bitcoin-core console area?


Title: Re: Importing private key into Bitcoin Core 0.9.0
Post by: Rocket Launcher on August 04, 2014, 04:27:26 AM
i think to invest more btc without open it just create wallet one who never open it again .
alot hacker easy to copy key if your pc . not get infected