So I’m curious if it’s possible to find a private key where the P2PKH address has a specific string in it, like HelloWorld. Are there any restrictions on what strings can show up? Like, could some super long string never appear at all?
Searching for Target Strings in P2PKH Addresses
6 replies 454 views
chrisomegaFull Member
Posts: 69 · Reputation: 631
#2Sep 14, 2023, 10:47 PM
That's pretty much how vanity addresses work. There are way more private keys than valid addresses. Roughly 2^256 private keys compared to about 2^160 P2PKH addresses. So, for every address, there’s like 2^96 private keys on average. As long as it’s a valid address, you can potentially find the matching private key, just harder with longer strings.
Nice numbers you’ve given. Seems like there’s a ton of cool addresses out there for sure!
Yeah, but strings like 'HelloWorld' can’t actually appear. P2PKH addresses use base58, which removes some characters like '0', 'O', 'I', and 'l'. However, stuff like 'aaaaaaaaaaaaaaaa' could show up but it would take a massive amount of time to brute-force it.
Hey there! Any valid base58 string can pop up in a P2PKH address, since hash160 is pretty random. But yeah, 'HelloWorld' definitely needs a private key. And if the string has invalid characters, it’s a no-go. Longer strings mean a bigger search space too. Sure, 'aaaaaaaaaaaaaa' is possible but good luck finding that, it’d take ages!
Right, it’s all about how long your string is. I’ve got a Python script that can turn your text into prefixes for searching using vanity address generation tools like Keyhunt.
Awesome, does it output one prefix per line? And is it compatible with vanitysearch? Also, clever idea to swap out invalid base58 characters for their valid equivalents. Just watch out, sometimes it changes the focus on a different word, lol!