Bitcoin addresses are essentially hash values of public keys encoded in Base58. More details here.
The addresses are essentially random characters chosen from the Base58 alphabet: uppercase and lowercase Latin letters and digits, with 0 (zero), I (capital I), O (capital O), and l (lowercase l) removed to prevent errors.
You could create an address that begins with chosen characters by generating private/public key pairs and hashing the latter until you get the initial string you want [1]. People have done this. The vanitygen software gives the example of searching for an address that starts with “Love” (after the mandatory initial 1).
$ ./vanitygen 1Love ... Pattern: 1Love Address: 1LoveRg5t2NCDLUZh6Q8ixv74M5YGVxXaN Privkey: 5JLUmjZiirgziDmWmNprPsNx8DYwfecUNk1FQXmDPaoKB36fX1o
Search time
You can’t specify a long prefix. The difficulty in finding an address with n specified initial characters grows exponentially, like 58n.
Say it takes a minute on average to find an address with the desired first four characters. Each additional character makes the search take 58 times longer, so specifying 5 characters would take about an hour. If you wanted to find an address that begins 1AcmeCorp
it would take 584 minutes or over 21 years.
Disadvantages
There are several reasons you might not want to use a vanity address.
First, it’s now customary to generate new addresses for each transaction. This gives Bitcoin some degree of privacy, though not much. Presumably if you go to the effort of creating a custom address you’d like to hold on to it. Maybe you’d like to use it as an address for someone to send you donations, for example, and you’re OK reusing the address.
Second, if you use software someone else wrote to generate the custom address, the site may hold onto your private key or send it somewhere.
Third, you can’t use the address with an HD wallet. Related to the first point, HD wallets generate a sequence of key pairs, and thus addresses, according to some deterministic algorithm, and so it can’t hold an address it didn’t generate. But there are wallets that will hold such addresses.
Proof of work
Incidentally, the proof-of-work task for Bitcoin is very similar to finding vanity addresses. You take a block and twiddle what you can until it hashes to a value with a target number of leading zero bits. More on that here.
The post Vanity addresses first appeared on John D. Cook.