you can speed up this Python code 100 times in Cyclone.
How do you think prefixes can be generated in Cyclone?
There is already a search in the script using AVX2 instructions to compare two 128-bit values.
However, the search focus on the last 4 bytes of the hashes rather than just the beginning.
// 8 keys are ready - time to use avx2
if (localBatchCount == HASH_BATCH_SIZE) {
computeHash160BatchBinSingle(localBatchCount, localPubKeys, localHashResults);
// Results check
for (int j = 0; j < HASH_BATCH_SIZE; j++) {
__m128i cand16 = _mm_loadu_si128(reinterpret_cast<const __m128i*>(localHashResults[j]));
__m128i cmp = _mm_cmpeq_epi8(cand16, target16);
if (_mm_movemask_epi8(cmp) == 0xFFFF) {
// Checking last 4 bytes (20 - 16)
A Bitcoin address is derived from a RIPEMD-160 hash (20 bytes).
To match 1MVDYgVaSN, you need to match the first 10 bytes.
// Match only the first 10 bytes: mask should be 0x03FF (10 ones in binary)
if ((_mm_movemask_epi8(cmp) & 0x03FF) == 0x03FF) {
// Extract first 10 characters from the matching Bitcoin address
std::string first10(reinterpret_cast<char*>(localPubKeys[j]), 10);
std::cout << "Match found! First 10 chars: " << first10 << std::endl;
}