And even better, what if we can apply the prefix concept on hash160 too. Instead of looking for address prefix, we look for hash160 prefix. Even more speed. In fact, this would be the fastest way ever.
Won't work, rmd160 has 40 characters and by searching for their prefix, should we stop hashing half way? Meaning converting sha256 hash of public key into rmd160 but only looking for a specific prefix, either we generate the whole hash and compare with our target or we can't generate just a prefix to compare because it would break the function and we wouldn't know the result.
About brute force tools, bitcrack, vanity etc they all convert rmd160 to address, otherwise why would they accept an address as an input to check against?Ok, after digging through bitcrack code to look at its stride function, I did find where it converts all addresses provided to rmd160...
// Convert each address from base58 encoded form to a 160-bit integer
for (unsigned int i = 0; i < targets.size(); i++) {
if (!Address::verifyAddress(targets[i])) {
throw KeySearchException("Invalid address '" + targets[i] + "'");
}
KeySearchTarget t;
Base58::toHash160(targets[i], t.value);
_targets.insert(t);
}
_device->setTargets(_targets);
}