Author

Topic: Why creating Vanity Segwit address is easier than Legacy address? (Read 151 times)

legendary
Activity: 2268
Merit: 18711
In addition to nc50lc's reply, note that the difficulty will change not just based on the length of the prefix, but also on which characters you put in that prefix.

When considering legacy address for example, because addresses are encoding base16 data in to base58, the length can be variable. Because the length can be variable, you will have one range for some prefixes, while you will have two ranges for other prefixes. What I mean by this is that for some prefixes you will have both 33 character and 34 character addresses which start with this prefix, whereas for other prefixes you will only have 33 character addresses which start with this prefix. (I am deliberately ignoring the edge case of shorter addresses than this which start with repeated 1s. These are even harder to generate.)

The pivotal address is this one: 1QLbz7JHiBTspS962RLKV8GndWFw. If the desired vanity address starts with a string which comes earlier in the base58 alphabet, it will have two ranges, and therefore be easier to find. If the string comes later in the base58 alphabet, there will be only one range and therefore it will be more difficult to find.

To answer your main question about the speed up between legacy v segwit, it is predominantly down to the size of the alphabet as nc50lc has pointed out. Legacy addresses have a 58 character alphabet; segwit addresses have a 32 character alphabet. Ignoring the other complex factors we have just discussed, 632 is around 171 billion billion times smaller than 658.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
Does it mean creating Vanity Legacy and Nested Segwit address is 14.26 times harder than Vanity Native Segwit address? And why?
It has something to do with number of possible combinations.
Since Legacy and Nested-SegWit both are encoded with BASE58 which has 58 possible characters, the total number of combinations will be bigger than bech32 (BASE32).

Additionally,
In your test, you've used 5 character prefix in Legacy and 6 characters in Nested-SegWit,
if you used the same number of characters, the latter will be less difficult with 264104224 difficulty due to the limited range of the first few character in the prefix.

When it comes with speed, notice that Nested-SegWit keys-per-second is a lot slower than legacy or native SegWit?
That's because it has to go through HASH160 "SHA256(RIPEMD160)" twice which is quite slow to compute; the other two only use it once.
Then bech32 has the fastest speed (a little faster than legacy) because bech32's checksum (bip-0173) doesn't use double SHA256 which makes it faster to compute.
sr. member
Activity: 966
Merit: 306
I did not know about the difference and I didn't know about the math behind it but o_e_l_e_o  and ETFbitcoin forced me to learn.

It is impossible to create a Vanity address with too many customized characters like more than 8. It is discussed in Vanity address (Mastering Bitcoin book)
This is only for legacy addresses, and does not hold true for segwit addresses. I can generate an 8 character custom segwit address in around 3 minutes.

That's true when we're talking about legacy address, i used 9 customized characters only as example. Although 9 customized character on legacy address is still possible with few high end GPU in few months.

I looked at https://github.com/JeanLucPons/VanitySearch and found three examples for 3 address types: 1, 3, and bc1q.
I saw the code has figures for difficulty. Are they difficulty when creating that Vanity address?

Legacy: 1
Nested Segwit: 3
Native Segwit: bc1q

Difficulty for Legacy and Nested Segwit is both 15318045009, difficulty for Native Segwit is 1073741824.
Difference is 15318045009 / 1073741824  = 14.26604112.

Does it mean creating Vanity Legacy and Nested Segwit address is 14.26 times harder than Vanity Native Segwit address? And why?

Quote
Exemple (Windows, Intel Core i7-4770 3.4GHz 8 multithreaded cores, GeForce GTX 1050 Ti):

C:\C++\VanitySearch\x64\Release>VanitySearch.exe -stop -gpu 1TryMe
VanitySearch v1.17
Difficulty: 15318045009
Search: 1TryMe [Compressed]
Start Fri Jan 31 08:12:19 2020
Base Key: DA12E013325F12D6B68520E327847218128B788E6A9F2247BC104A0EE2818F44
Number of CPU thread: 7
GPU: GPU #0 GeForce GTX 1050 Ti (6x128 cores) Grid(48x128)
[251.82 Mkey/s][GPU 235.91 Mkey/s][Total 2^32.82][Prob 39.1%][50% in 00:00:12][Found 0]
PubAddress: 1TryMeJT7cfs4M6csEyhWVQJPAPmJ4NGw
Priv (WIF): p2pkh:Kxs4iWcqYHGBfzVpH4K94STNMHHz72DjaCuNdZeM5VMiP9zxMg15
Priv (HEX): 0x310DBFD6AAB6A63FC71CAB1150A0305ECABBE46819641D2594155CD41D081AF1

C:\C++\VanitySearch\x64\Release>VanitySearch.exe -stop -gpu 3MyCoin
VanitySearch v1.11
Difficulty: 15318045009
Search: 3MyCoin [Compressed]
Start Wed Apr  3 14:52:45 2019
Base Key:FAF4F856077398AE087372110BF47A1A713C8F94B19CDD962D240B6A853CAD8B
Number of CPU thread: 7
GPU: GPU #0 GeForce GTX 1050 Ti (6x128 cores) Grid(48x128)
124.232 MK/s (GPU 115.601 MK/s) (2^33.18) [P 47.02%][50.00% in 00:00:07][0]
Pub Addr: 3MyCoinoA167kmgPprAidSvv5NoM3Nh6N3
Priv (WIF): p2wpkh-p2sh:L2qvghanHHov914THEzDMTpAyoRmxo7Rh85FLE9oKwYUrycWqudp
Priv (HEX): 0xA7D14FBF43696CA0B3DBFFD0AB7C9ED740FE338B2B856E09F2E681543A444D58

C:\C++\VanitySearch\x64\Release>VanitySearch.exe -stop -gpu bc1quantum
VanitySearch v1.11
Difficulty: 1073741824
Search: bc1quantum [Compressed]
Start Wed Apr  3 15:01:15 2019
Base Key:B00FD8CDA85B11D4744C09E65C527D35E231D19084FBCA0BF2E48186F31936AE
Number of CPU thread: 7
GPU: GPU #0 GeForce GTX 1050 Ti (6x128 cores) Grid(48x128)
256.896 MK/s (GPU 226.482 MK/s) (2^28.94) [P 38.03%][50.00% in 00:00:00][0]
Pub Addr: bc1quantum898l8mx5pkvq2x250kkqsj7enpx3u4yt
Priv (WIF): p2wpkh:L37xBVcFGeAZ9Tii7igqXBWmfiBhiwwiKQmchNXPV2LNREXQDLCp
Priv (HEX): 0xB00FD8CDA85B11D4744C09E65C527D35E2B1D19095CFCA0BF2E48186F31979C2
Jump to: