How can I generate a large number of Bitcoin addresses?

11

4

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.

Gary Rowe

Posted 2011-11-01T10:09:12.097

Reputation: 7 175

Answers

6

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).

ThePiachu

Posted 2011-11-01T10:09:12.097

Reputation: 41 594

Hmmm. So roll my own then? Not a standard feature of bitcoind to produce them outside of the wallet.dat?Gary Rowe 2011-11-01T14:56:31.167

Wouldn't know, what do you want to do with those addresses anyway?ThePiachu 2011-11-01T15:11:39.147

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.Gary Rowe 2011-11-01T15:45:35.973

I guess you could also use Pywallet for this, edited my answer.ThePiachu 2011-11-01T18:22:20.397

8

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.

Serith

Posted 2011-11-01T10:09:12.097

Reputation: 5 220

i would think that vanitygen is the best performing address generator, but i don't have numbers to compare. see also http://bitcoin.stackexchange.com/a/2088/1098 for vanitygen speed

hmundt 2013-11-17T20:01:50.947

Good suggestion, but I need to favour performance over looks. Generating vanity addresses will throw away perfectly acceptable addresses leading to wasted time.Gary Rowe 2011-11-02T10:03:44.623

2@Gary Rowe But couldn't you just provide and empty regular expression (something like 1*) and generate a ton of addresses?nmat 2011-11-02T18:24:28.453

@nmat Good point - hadn't considered thatGary Rowe 2011-11-03T09:13:16.670

7

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.

nmat

Posted 2011-11-01T10:09:12.097

Reputation: 10 879

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.Gary Rowe 2011-11-02T10:01:40.510