Wednesday, February 26, 2014
Vanity Bitcoin Address, Lazy Ways vs Hard Ways
Bitcoin address tend to be random and cryptic. Ever wished you could have a more personalised Bitcoin address? Well, you can. I made myself a custom address (or vanity address) recently, and some of my friends have wondered how to do this, so I decided to write up a guide for everyone.
There are a couple of ways to get these vanity addresses.
THE LAZY WAY
Pros – very easy
Cons – may not be secure, may not be free
Websites such as BitcoinVanity will let you generate a custom prefix right in your browser. While this is incredibly convenient, you have to trust websites like these to not save your private keys. Furthermore, online vanity address generators may charge a fee, depending on the length of the prefix. If you feel that you can trust such an online service and have no issue paying for a custom Bitcoin address, then go ahead. But if you’d rather put in a bit of extra effort to get a FREE and SECURE address, read on.
THE BETTER/HARDER WAY
Pros – you have total control, free, secure
Cons – speed depends on the computer you use, harder
Before we continue, let’s take a moment to understand how Bitcoin addresses work. Bitcoin addresses are randomly generated and have a unique “private key” attached to them. The private key is required to access the BTC associated with a particular Bitcoin address. Since addresses are randomly generated, it’s possible to brute-force one’s way to obtaining a particular address. This is what we’ll be doing.
We’ll be using a program called Vanitygen, which will do the brute-forcing for us. This guide is written for Windows users since Windows binaries are available for Vanitygen. It IS possible to compile Vanitygen from source on OSX or Linux, but this is quite the hassle. I’m a Mac person, so I actually took the time to get Vanitygen working on my Mac, but it really wasn’t worth it. It was way too much effort when I could’ve just borrowed someone’s PC. If you don’t have any Windows computers at home, just borrow your friend’s computer as that’ll be much easier than getting Vanitygen to work on OSX or Linux.
Anyway, moving on. Start by downloading Vanitygen for Windows here. Extract the .zip file someplace convenient such as your desktop. Open the folder. You should see this.
Notice that there are 5 different choices. oclvanitygen uses an OpenCL-compatible GPU to generate vanity addresses. If you’ve got a relatively new ATI/AMD graphics card, you can use oclvanitygen. Otherwise, you’ll have to use vanitygen or vanitygen64, which will use your CPU to generate addresses. Similar to mining Bitcoin, using your GPU will be significantly faster than using your CPU, so oclvanitygen is recommended. However, with short prefixes like 1NeiL, CPU vanitygen will work just fine. You can ignore oclvanityminer and oclvanityminer64.
Next, open up a new command prompt window. Go to Start>Run and type in “cmd” without quotes. Hit “OK”.
You should now see a window like this.
The next step is to type in the location of the vanitygen you’re using. In Windows 7 onwards, you can just drag the vanitygen exe onto the cmd window, and the path will automatically be typed for you. Here I will be using vanitygen64.exe because I’m on a laptop with a 64 bit CPU, but no OpenCL GPU.
Hit enter. You should see a lot of text explaining all the options vanitygen offers.
We’ll be using -v and -i in this guide. Let’s get vanitygen going again, but this time with the appropriate options.
Notice how this is done. I dragged vanitygen64.exe onto the cmd window and hit the spacebar. Next, I typed -v, space, -i, space, 1test. The -v option will give me a verbose (wordy) output. The -i option will make my prefix case-insensitive to speed things up. Without -i, the prefix will be case-sensitive, which would be slower. Finally, I typed “1test”. The Bitcoin address that I generate will begin with this prefix. Keep in mind that all Bitcoin addresses start with the number 1, so having the 1 as the first character is essential. For your prefix, you can type “1test”, “1billybob”, or whatever. Just keep in mind that the longer the prefix, the longer it will take to generate your custom address.
Everything looks good. Hit enter.
Aaaand it’s working! Vanitygen is brute-forcing its way to generating a Bitcoin address that begins with “1test” (case-insensitive). 306.15 Kkey/s is the speed at which Vanitygen is working on my computer. (This is pretty slow since I’m on an old Windows laptop using CPU Vanitygen). “Prob 12.3%” means that there is a 12.3% chance of stumbling upon the vanity address I want at that particular instant. The probability of getting my custom address will be 50% in 30.3 seconds. These are just calculated guesses, so don’t think too much of them. If you’re lucky, you’ll get your address before the Prob hits 100%. If you’re unlucky, you’ll get your address after 100%. Usually however, you’ll get your address sometime between 95% – 100% Prob. This step could be really fast or really slow depending on your computer’s speed and the length of your prefix.
About a minute later…SUCCESS!
At the bottom, you see -
There’s the address and the private key associated with it! To use the custom address, all you need to do is import the private key to your Bitcoin wallet.
Now, 1tesTJj3YHugNNV7XPX48erjTJxrWqg27 isn’t exactly the coolest address, but this was just an example. I’m sure you can think of something much better for your own personalised address. You can use your name, a phrase, a word, anything. Be creative. Just keep in mind that the shorter your prefix is, the faster it’ll be generated.
That wraps up this tutorial. And remember, ABSOLUTELY DO NOT SHARE YOUR PRIVATE KEY WITH ANYONE.