6

What is the best method to generate large numbers of bitcoin addresses?

I imagine something like the following would break bitcoind in some fashion:

./bitcoind keypool=100000000

3
  • 2
    I think you need to share a bit more about what your real use case is. (According to this there were only a few million address used at all through May 2012.) Why would you need 100 million just for yourself? And do you just need them generated, or do you need to watch all of them? Watching all of them would be the much bigger chore. May 8, 2013 at 20:31
  • Yeah, the only real uses I could see for that many addresses are malicious. Instead of generating so many addresses, you should just re-use addresses. May 9, 2013 at 15:06
  • @DavidOgren I can't disclose too much about my intent unfortunately, but I will try. The addresses are not for myself, they are for a permanent cold storage vault solution where it will be exceedingly difficult to add new addresses to the vault. The reason I need so many is to continue to allow real customers to continue registering to the website in the event of a powerful DDoS registration attack. If 50M visitors register and only 1 of them is real, I want every one of those new registrations to have a working deposit address. So no, I wouldn't need to watch all of them.
    – user3145
    May 10, 2013 at 1:10

3 Answers 3

7

I ran vanitygen -k 1, which will keep creating addresses matching the pattern 1* until stopped, for approximately five seconds and it generated more than 3,000 addresses. No GPU assistance here.

So, do this:

In one Terminal tab, run vanitygen or oclvanitygen:

vanitygen -k -o addrs 1

In another Terminal tab, run this:

watch 'echo "`wc -l addrs | egrep -o "[0-9]+"` / 3" | bc'

When the number in the second terminal tab is greater than 100M, you're done! The divisor is three because the output file will contain addresses in three line sets: Pattern, Address, Private Key.

Now, find a way to automate that and you'll be golden. You can also just shuffle bits around with another program that just gets the first 100M addresses from the file you generated.

2
  • 1
    Mine ran for ~15 minutes and generated 770k addresses. This is on a Macbook Air with an i7, using vanitygen.
    – Colin Dean
    May 8, 2013 at 23:04
  • 1
    That is perfect, thank you both for the suggestion and testing.
    – user3145
    May 10, 2013 at 1:00
3

If you just need the keys, but not imported into bitciond:

  1. Generate 100M random numbers, each 256-bits long - these are your private keys.*
  2. For each of the numbers execute the curve's ScalarBaseMult - to get X and Y.
  3. The X (and Y) is your public key - you just need to hash and b58 encode it, to turn it into a bitcoin address.

*) You might want to check if the numbers are in a range, but it's extremely unlikely that they would not.

If you need 100M keys imported into bitcoind - well, that could be a challenge...

1

The keypool flag can accomplish that, but it would certainly take a long time. At this scale you might want to look into modifying vanitygen to create such a big number of addresses using GPU. However, there are no off-the-shelf solutions for what you are aiming to do, asides using keypool flag.

1
  • It's humbling to know that bitcoind is so robust.
    – user3145
    May 10, 2013 at 1:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.