<p>Each leading 1 in an address after the first 1 represents a leading zero <em>byte</em> in the 160 bit hash of the public key, and so makes the search 256 times harder.  See <a href="https://en.bitcoin.it/wiki/Base58Check_encoding" rel="nofollow">the wiki page for Base58Check encoding</a> for details.  Whereas any other character makes the search only around 56 times harder.</p>

<p>Every version 0 bitcoin address begins with a 1.  And 1 in 256 of them begin with two 1's.  However, I don't know where the 23 comes from.  Perhaps it's a result of <a href="http://en.wikipedia.org/wiki/Benford%27s_law" rel="nofollow">Benford's law</a> - we're changing to base 58, and so can expect more addresses to start with '12' than any other 2 characters.</p>

<p>To see this, suppose there were 256 addresses, from 0x00 to 0xFF, and that we converted them to base 10 to make addresses.  There are 256 different addresses, and 111 of the 256 begin with a '1' (1, 10, 11, ..., 19, 100, 101, ..., 199).  In bitcoin's base58 encoding, value 1 is encoded by character '2'.</p>

<p><strong>Edit</strong>: the above is kind of convincing until you see that:</p>

<ul>
<li>'12' through '16' all have difficulty 23,</li>
<li>'17' through '1P' have difficulty 22,</li>
<li>'1Q' has difficulty 65 and</li>
<li>'1R' through '1z' have difficulty 1353.</li>
</ul>

CC BY-SA 3.0
2012-05-28T06:26:55.043Z
2012-05-28T06:32:21.667Z
2012-05-28T06:32:21.667Z
Chris Moore
<p>I've been looking at generating some vanity addresses today, and I found it surprising that the program generating the address predicts that it will take a different amount of tries to compute a vanity address of the same length, but with a different pattern. For example, generating "11..." takes 256 tries, while "12..." takes 23. Shouldn't it takes the same amount of tries to generate both of them, or am I missing some important detail?</p>

CC BY-SA 3.0
2012-05-28T02:00:13.133Z
Why should it take the same amount of tries to generate both of them? Do you think there are the same number of hashes that yield a "11" as there are hashes that yield a "12"? Wouldn't that be an *amazing* coincidence? (Since the hashes live in a power of two space and the accounts live in a power of 58 space it would be shocking if they perfectly lined up like that.)
David Schwartz
CC BY-SA 3.0
2012-05-28T04:39:50.123Z
Shocking if it was perfectly equal, but '11...' takes over 10 times longer than '12...'.  That seems more shocking to me.
Chris Moore
CC BY-SA 3.0
2012-05-28T05:25:11.180Z
@ChrisMoore Bitcoin treats leading 1s specially. '11' only occurs when the leading byte is zero.
theymos
CC BY-SA 3.0
2012-05-28T06:45:49.077Z
@ChrisMoore: How many seven-digit numbers between one million and two million inclusive start with 2? Only one of them. How many start with 1? All the rest of them. There's nothing surprising about a 10-to-1 ratio.
David Schwartz
<vanity-address><base58check>
Why does it take a different time to generate a different pattern of the same length in vanitygen?
ThePiachu
# Why does it take a different time to generate a different pattern of the same length in vanitygen?

(Asked by: username_0 on 2012-05-27)

I've been looking at generating some vanity addresses today, and I found it surprising that the program generating the address predicts that it will take a different amount of tries to compute a vanity address of the same length, but with a different pattern. For example, generating "11..." takes 256 tries, while "12..." takes 23. Shouldn't it takes the same amount of tries to generate both of them, or am I missing some important detail?

**Tags:** vanity-address, base58check

> **Comments:**
> **username_1**: Why should it take the same amount of tries to generate both of them? Do you think there are the same number of hashes that yield a "11" as there are hashes that yield a "12"? Wouldn't that be an *amazing* coincidence? (Since the hashes live in a power of two space and the accounts live in a power of 58 space it would be shocking if they perfectly lined up like that.)  
> **username_2**: Shocking if it was perfectly equal, but '11...' takes over 10 times longer than '12...'.  That seems more shocking to me.  
> **username_3**: @ChrisMoore Bitcoin treats leading 1s specially. '11' only occurs when the leading byte is zero.  
> **username_1**: @ChrisMoore: How many seven-digit numbers between one million and two million inclusive start with 2? Only one of them. How many start with 1? All the rest of them. There's nothing surprising about a 10-to-1 ratio.  

---

## 1 answers

### Answer by username_2 on 2012-05-28. Score: 3

Each leading 1 in an address after the first 1 represents a leading zero *byte* in the 160 bit hash of the public key, and so makes the search 256 times harder. See [the wiki page for Base58Check encoding](https://en.bitcoin.it/wiki/Base58Check_encoding) for details. Whereas any other character makes the search only around 56 times harder.

Every version 0 bitcoin address begins with a 1. And 1 in 256 of them begin with two 1's. However, I don't know where the 23 comes from. Perhaps it's a result of [Benford's law](http://en.wikipedia.org/wiki/Benford%27s_law) - we're changing to base 58, and so can expect more addresses to start with '12' than any other 2 characters.

To see this, suppose there were 256 addresses, from 0x00 to 0xFF, and that we converted them to base 10 to make addresses. There are 256 different addresses, and 111 of the 256 begin with a '1' (1, 10, 11, ..., 19, 100, 101, ..., 199). In bitcoin's base58 encoding, value 1 is encoded by character '2'.

**Edit**: the above is kind of convincing until you see that:

* '12' through '16' all have difficulty 23,
* '17' through '1P' have difficulty 22,
* '1Q' has difficulty 65 and
* '1R' through '1z' have difficulty 1353.


---

