I would like to generate a large number of public Bitcoin addresses (several hundred thousand) quickly and efficiently into a simple text file. What would be the easiest way to get this done? I'm just wondering if there are any particular scripts or services that handle this already without having to roll my own.
3 Answers
If you want to generate a lot of keys in the wallet.dat, use command line parameter:
-keypool=<n> Set key pool size to <n> (default: 100)
Then you can extract the results with Pywallet.
If you want to make them separate, you will have to use a cryptography library that supports secp256k1 ECDSA, like the Bouncy Castle. Simply generate private keys, use the library to generate public keys from them, and then convert them to classic Bitcoin address using this algorithm (requires libraries that support SHA256 and RIPEMD-160).
-
Hmmm. So roll my own then? Not a standard feature of bitcoind to produce them outside of the wallet.dat?– GaryCommented Nov 1, 2011 at 14:56
-
Wouldn't know, what do you want to do with those addresses anyway? Commented Nov 1, 2011 at 15:11
-
1One possible use case would be to pre-load an online service with a bucket of transaction addresses. No private keys stored on the server.– GaryCommented Nov 1, 2011 at 15:45
-
I guess you could also use Pywallet for this, edited my answer. Commented Nov 1, 2011 at 18:22
Vanitygen is a command-line tool that can be used to generate random bitcoin addresses. It also has OpenCL-compatible GPU version called oclvanitygen. Both can be built from source, GitHub, and both are included in the Windows binary package. PGP signature here.
-
Good suggestion, but I need to favour performance over looks. Generating vanity addresses will throw away perfectly acceptable addresses leading to wasted time.– GaryCommented Nov 2, 2011 at 10:03
-
2@Gary Rowe But couldn't you just provide and empty regular expression (something like
1*
) and generate a ton of addresses?– nmatCommented Nov 2, 2011 at 18:24 -
-
i would think that vanitygen is the best performing address generator, but i don't have numbers to compare. see also bitcoin.stackexchange.com/a/2088/1098 for vanitygen speed– hmundtCommented Nov 17, 2013 at 20:01
You can use bitaddress.org. It is a single HTML file so you can save it and generate lots of addresses offline using their Bulk Wallet tab. The biggest problem here is Javascript performance. With current hardware you can generate around 1000 addresses per minute. If you are willing to wait several hours (maybe leave the computer working overnight), this can solve your problem.
-
1Interesting approach, however I'd be looking to create them in blocks of several hundred thousand in a short space of time (a few minutes) so I'd need a compiled execution environment.– GaryCommented Nov 2, 2011 at 10:01