[JavaScript] Vanity Address / Passphrase


Find a passphrase with vanity addresses.

Specify a pattern, e.g. 1st address shall begin with 1CP, or both 1st and 2nd shall begin with 1A. The script tries multiple passphrases until it finds the specified pattern.

I searched for pattern 1A, 1B and 1C, found a passphrase, and imported it in Counterwallet.

Note: Only around 10 passphrases are tested per second. You must therefore be patient and only pick very simple patterns. If the code were in a different language and optimized, it could probably search 1000 times faster (which actually is the equivalent of just two more characters…).

This is really cool JP, however when i click the generate button it completely freezes my google chrome browser (all tabs, not just the vanity tab). Is this an issue you have run into?

Thanks for informing me. I did not run into this issue on my browsers (Chrome, FF, Opera, IE). The code is designed to stop after 1000 iterations though (with message no passphrase found). This is around 100 seconds on a normal computer, and obviously too long too wait when the browser freezes completely.

I’ll reduce the default to 50 iterations so the browser won’t freeze for more than a few seconds. People just testing out the default “1C” pattern will anyway have a 90% chance of finding it before 50 iterations. Advanced users will have the option to type “inf” to allow for an indefinite loop.

I looked into this and to my surprise JavaScript is actually quite a fast language. The reason is that JavaScript engines have improved a lot these last years. Also, I tried to speed up performance by removing unnecessary steps from Bitcore, but even after removing significant dead-weight there was no noticeable performance increase (therefore, in the Github code I keep the original Bitcore code).

However, if someone manages to circumvent Bitcore altogether by putting the necessary steps directly into the iteration, I hope the speed will improve drastically.