Author

Topic: Create addresses in bulk, fast. (Read 1286 times)

legendary
Activity: 1064
Merit: 1011
760930
December 10, 2013, 05:14:05 PM
#6
There's something I can't understand, how can a Python script be faster than Vanitygen??

Well for the CPU-intensive stuff (EC math), it uses OpenSSL, which is a compiled and optimized library.
full member
Activity: 208
Merit: 148
December 10, 2013, 10:27:24 AM
#5
There's something I can't understand, how can a Python script be faster than Vanitygen??
legendary
Activity: 1064
Merit: 1011
760930
December 09, 2013, 04:21:47 PM
#4
This is probably the source of that statement:

https://bitcointalksearch.org/topic/vanitygen-vanity-bitcoin-address-generatorminer-v022-25804
Quote
To speed up address generation, vanitygen uses the RNG to choose a private key, and literally increments the private key in a loop searching for a match.  As long as the starting point is not disclosed, if a match is found, the private key will not be any easier to guess than if every private key tested were taken from the RNG.  Vanitygen will also reload the private key from the RNG after 10,000,000 unsuccessful searches (100M for oclvanitygen), or when a match is found and multiple patterns are being searched for.

Quote
Nonetheless, if you feel the default RNG is unable to provide numbers that are sufficiently difficult to guess, vanitygen can be directed to seed the RNG from an external file using the -s option.

Indeed that's where I got the clue from. Unless I'm missing something, this could represent a risk as I stated above. Of course, this risk is only present when using vanitygen as a bulk generator with no external seed, which it is fair to say is not its primary intended use.

Anyway, after double-checking my measurements, it seems that Bulkgen IS surprisingly even faster than Vanitygen (for bulk generation.) Smiley

EDIT: I might be wrong about Vanitygen's vulnerability. From the above quote, it seems that it also resets the starting point whenever a match is found (which is, all the time when run with the '-k 1' arguments).  If anybody with enough experience could confirm this, it would be great.  
legendary
Activity: 905
Merit: 1000
December 09, 2013, 04:13:16 PM
#3
This is probably the source of that statement:

https://bitcointalksearch.org/topic/vanitygen-vanity-bitcoin-address-generatorminer-v022-25804
Quote
To speed up address generation, vanitygen uses the RNG to choose a private key, and literally increments the private key in a loop searching for a match.  As long as the starting point is not disclosed, if a match is found, the private key will not be any easier to guess than if every private key tested were taken from the RNG.  Vanitygen will also reload the private key from the RNG after 10,000,000 unsuccessful searches (100M for oclvanitygen), or when a match is found and multiple patterns are being searched for.

Quote
Nonetheless, if you feel the default RNG is unable to provide numbers that are sufficiently difficult to guess, vanitygen can be directed to seed the RNG from an external file using the -s option.
legendary
Activity: 1204
Merit: 1001
RUM AND CARROTS: A PIRATE LIFE FOR ME
December 09, 2013, 03:50:41 PM
#2

2. The command "Vanitygen -k 1" runs much faster than all other options, but I think this comes at a heavy cost: If one private key of the batch is compromised, all others becomes vulnerable, due to the fact that vanitygen only performs a new EC multiplication once every 10 million addresses, which is what allows it to be so fast (Please correct me if I'm wrong).


Really? That seems to be quite a serious weakness if true.
legendary
Activity: 1064
Merit: 1011
760930
December 09, 2013, 03:45:18 PM
#1
Some users (mostly merchants and exchanges) have expressed the need to generate thousands or millions of addresses at once. I've looked at the options available and was surprised to find they were all quite slow, which is why I have knocked up a new little command: Bulkgen (not released yet.)
Below are some rough figures from my offline machine (a very old, VERY SLOW Win XP netbook.)

I will try to run the same tests on a faster machine soon.


Time required to generate 1000 addresses:
Code:
Bitcoind:    17 min      (C++)
Electrum lib:      19 min      (Python 2.x)
Bitaddress:   132 sec      (JavaScript)
Vanitygen: 15.3 sec      (C++)
Bulkgen:       7.8 sec      (Python 2.x + OpenSSL 1.0.1e)

EDIT: corrected results for Vanitygen and Bulkgen

Did I forget any other tools?


Bulkgen is an open-source bulk address generator tool, based on OpenSSL and a public domain library. It will be released for Windows only in the beginning. People will be welcome to port it to other platforms (which should be quite trivial).


Notes:
  
1. As far as I can see, bitcoind's getnewaddress does not only generate a new address, but also adds it into the wallet database, which takes extra time of course.
 
2. The command "Vanitygen -k 1" runs much faster than all other options, but I think this comes at a heavy cost: If one private key of the batch is compromised, all others becomes vulnerable, due to the fact that vanitygen only performs a new EC multiplication once every 10 million addresses, which is what allows it to be so fast (Please correct me if I'm wrong).
Jump to: