Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: dillpicklechips on May 12, 2013, 11:15:52 PM



Title: Printing many private keys
Post by: dillpicklechips on May 12, 2013, 11:15:52 PM
What is the most reliable way to print a few hundred private keys along with the matching addresses. I would prefer to not use anything other than BitcoinQT (on linux)  and not have to do each one by hand?

edit, it doesn't have to printed of course just a text file or something with a hundred keys with matching addresses.


Title: Re: Printing many private keys
Post by: dillpicklechips on May 12, 2013, 11:53:35 PM
Thanks. I'm looking for a method that uses Bitcoin qt.


Title: Re: Printing many private keys
Post by: grue on May 13, 2013, 12:06:36 AM
Thanks. I'm looking for a method that uses Bitcoin qt.
bitcoind getnewaddress
bitcoind dumpprivkey addressfrompreviouscall


Title: Re: Printing many private keys
Post by: nimda on May 13, 2013, 12:22:49 AM
Thanks. I'm looking for a method that uses Bitcoin qt.
bitcoind getnewaddress
bitcoind dumpprivkey addressfrompreviouscall

This. Right-click on the icon and choose "debug window" to try out these commands (drop 'bitcoind'), then write yourself a script to call bitcoind.


Title: Re: Printing many private keys
Post by: dillpicklechips on May 13, 2013, 02:49:11 AM
Thanks. I'm looking for a method that uses Bitcoin qt.
bitcoind getnewaddress
bitcoind dumpprivkey addressfrompreviouscall

This. Right-click on the icon and choose "debug window" to try out these commands (drop 'bitcoind'), then write yourself a script to call bitcoind.

Is that script hard to make? I don't know scripting.


Title: Re: Printing many private keys
Post by: grue on May 13, 2013, 03:50:18 AM
This. Right-click on the icon and choose "debug window" to try out these commands (drop 'bitcoind'), then write yourself a script to call bitcoind.
you don't need bitcoin-qt's debug console. it's much easier to use the daemon itself. command line = easy piping.

Is that script hard to make? I don't know scripting.
you were talking about linux, so I assumed you would know a bit about shell scripts


Title: Re: Printing many private keys
Post by: dillpicklechips on May 13, 2013, 04:08:08 AM
This. Right-click on the icon and choose "debug window" to try out these commands (drop 'bitcoind'), then write yourself a script to call bitcoind.
you don't need bitcoin-qt's debug console. it's much easier to use the daemon itself. command line = easy piping.

Is that script hard to make? I don't know scripting.
you were talking about linux, so I assumed you would know a bit about shell scripts
LOL, I just know enough to boot into a Live CD and load Bitcoin. I was looking to make some type of paper wallet to make sure I didn't lose some BTC I would like to back up. I was looking to make about 100 different addresses so that when I want to spend a tiny bit I don't have to import a whole BTC. I was a little worried about the js paper wallet that's online as I'd rather only trust Bitcoin and not another third party.

I'm thinking I'll just sit down and manually do dumpprivkey a hundred times and print that off.


Title: Re: Printing many private keys
Post by: Cyberdyne on May 13, 2013, 04:36:01 AM
Please note that last time I checked, importprivkey is painfully slow and only really practical for 2 or 3 addresses. If you want to import 100+ you'll probably want to do it with something like Armory.

This point has further implications for alt currencies - There's no 'Amory' for alt currencies, making the bulk address part of liteaddress.org far less practical currently.


Title: Re: Printing many private keys
Post by: scintill on May 13, 2013, 04:41:07 AM
Please note that last time I checked, importprivkey is painfully slow and only really practical for 2 or 3 addresses. If you want to import 100+ you'll probably want to do it with something like Armory.

There is a rescan=false modifier that causes it to not rescan the blockchain, which is faster.  It looks like if you add 99 with that flag and then drop it for the last one, it will rescan for all at once, which should be much more reasonable.


Title: Re: Printing many private keys
Post by: dillpicklechips on May 13, 2013, 04:43:31 AM
Please note that last time I checked, importprivkey is painfully slow and only really practical for 2 or 3 addresses. If you want to import 100+ you'll probably want to do it with something like Armory.

This point has further implications for alt currencies - There's no 'Amory' for alt currencies, making the bulk address part of liteaddress.org far less practical currently.

When I want to spend a portion I'd probably just import it into blockchain.info.


Title: Re: Printing many private keys
Post by: Cyberdyne on May 13, 2013, 04:48:34 AM
Please note that last time I checked, importprivkey is painfully slow and only really practical for 2 or 3 addresses. If you want to import 100+ you'll probably want to do it with something like Armory.

There is a rescan=false modifier that causes it to not rescan the blockchain, which is faster.

Thanks. Do you know what version that switch first appeared in?


Title: Re: Printing many private keys
Post by: scintill on May 13, 2013, 04:57:14 AM
Thanks. Do you know what version that switch first appeared in?

Here's the commit, 5 months ago: https://github.com/bitcoin/bitcoin/commit/44051af1a87a5fb8f4e88442c0eb64a1b4ecf2e6.  If I'm reading the tag list right, it looks like it didn't get released until 0.8.0.


Title: Re: Printing many private keys
Post by: Cyberdyne on May 13, 2013, 05:26:17 AM
Thanks. Do you know what version that switch first appeared in?

Here's the commit, 5 months ago: https://github.com/bitcoin/bitcoin/commit/44051af1a87a5fb8f4e88442c0eb64a1b4ecf2e6.  If I'm reading the tag list right, it looks like it didn't get released until 0.8.0.

Thanks, good to know, although I already use Armory for importing bitcoin addresses.

I was asking because I was hoping it would be also in Litecoin, but I guess not yet.


Title: Re: Printing many private keys
Post by: grue on May 13, 2013, 02:48:33 PM
LOL, I just know enough to boot into a Live CD and load Bitcoin. I was looking to make some type of paper wallet to make sure I didn't lose some BTC I would like to back up. I was looking to make about 100 different addresses so that when I want to spend a tiny bit I don't have to import a whole BTC. I was a little worried about the js paper wallet that's online as I'd rather only trust Bitcoin and not another third party.

I'm thinking I'll just sit down and manually do dumpprivkey a hundred times and print that off.
the js paper wallet generator can be used offline for maximum security.


Title: Re: Printing many private keys
Post by: Dabs on May 13, 2013, 09:53:26 PM
You could just make a brand new wallet and then use jackjack's pywallet to extract all the private and public keys. Backup your existing wallet.dat somewhere, close QT, delete the wallet.dat, run QT again, (it will make a new wallet.dat), encrypt it, close QT, then use pywallet to get all the keys. You should have a hundred new keys by doing this.

If you need more, you simply start QT with -keys 500, for example. (or -keypool, I forgot which.)