CLI: Generate a new private key, unrelated to any existing wallet

0

1

I have a wallet on an offline computer, which has too many backups on connected computers.

I would like to generate a totally new bitcoin address on the offline computer, and use it as a cold storage address. I will then sign an offline transaction from the wallet to that new address and be safe.

How can I create a new Bitcoin private key from the Bitcoin CLI, without using any existing wallet keys / addresses?

I've looked into getnewaddress, but it seems to be getting the keys from the keypool on the existing wallet.

Note - I know I can use bitaddress.org offline, but I would like to use the basic bitcoin-core tools for this one.

Adam Matan

Posted 2016-07-15T13:08:41.907

Reputation: 547

pybitcointools' CLI random_key function perhaps?hartmut 2016-07-15T13:40:14.930

@hartmut Thanks! Nice option, but I'd rather use bitcoin-core.Adam Matan 2016-07-16T01:25:59.393

Answers

2

Maybe do:

1.) Move to current wallet.dat to a different location (will result in creating a fresh wallet)

2.) Start bitcoind/qt with -keypool=1 (if you want to avoid keypools)

3.) Call getnewaddress

You might also consider using a hardware wallet.

Jonas Schnelli

Posted 2016-07-15T13:08:41.907

Reputation: 5 465

0

Yes it grabs from the keypool which is a security/back-up feature so that you have future addresses private keys stored.

I guess I don't understand your problem, why don't you want it to pull from the keypool exactly? I suppose you could change your bitcoin.conf to keypool=1 or some other small number, and then generate new addresses. That way your newly generated address will be a new one that is not from the previously existing key pool. But again I'm not sure what purpose this would serve. The new keys will be saved to your wallet either way, whether your have keypool=1 or keypool=1000.

m1xolyd1an

Posted 2016-07-15T13:08:41.907

Reputation: 3 356

This does not work with HD wallets, as of bitcoin core 0.13user2084795 2016-08-15T10:08:45.680

Also, you can not reduce the keypool by setting keypool=1 (You actually need to drain it by calling getnewaddress repeatedly)user2084795 2016-08-15T10:10:12.477

0

you need to use multiple wallet.dat files. create multiple wallet.dat files from file > backup wallet, after encrypting each wallet from settings > encrypt wallet create as below example : savings-wallet-1.dat savings-wallet-2.dat spending-wallet-1.dat

and so on...

on linux : replace ~/.bitcoin/wallet.dat with the one you wish to use for your current session

Karan Ahuja

Posted 2016-07-15T13:08:41.907

Reputation: 151