0x1A96CA8D8 | 82762283.93 keys/s
Generated number (decimal): 7137437912
single thread, M2 Proc.
int main() {
const uint64_t minRange = 0x100000000;
const uint64_t maxRange = 0x1ffffffff;
const uint64_t magic_number = 0x1a96ca8d8 - minRange;
uint64_t max = maxRange - minRange + 1; // range size
uint64_t speed;
uint64_t count = 0;
struct timespec start, ticks;
clock_gettime(CLOCK_MONOTONIC, &start);
while (max--) {
if (count == magic_number) {
printf("Generated number: %16llx\n", count + minRange);
// break;
}
++count;
}
clock_gettime(CLOCK_MONOTONIC, &ticks);
uint64_t ns = (ticks.tv_sec - start.tv_sec) * 1000000000ULL + ticks.tv_nsec - start.tv_nsec;
// avoid 64-bit overflow
speed = count * 1000000ULL / (ns / 1000);
printf("Ops: %llu speed: %llu ops/s\n", count, speed);
return 0;
}
Generated number: 1a96ca8d8
Ops: 4294967296 speed: 3099732241 ops/s
Apple M1, single thread.
It has incredible possibilities for compiling. I was able to run this on an ARM processor as well on Amd Zen 2, 3 and 4
We're bounded by secp256k1 field operations, it can't work faster than what a CPU is capable of. I made a kangaroo in plain C, and the bottleneck is the EC point addition, I can't squeeze out more than 852.000 affine point additions per second (the only speed up would be some assembler code). If someone finds a magical way to find an scale-invariant hash of a Jacobian point it would run 10x faster though. Otherwise we're stuck with having to compute a modular inverse at every kangaroo jump, and no programming language can save you from this limitation.