Here is a calculator to calculate the estimated time it would take to use the Kangaroo Algorithm on a given range and the Keys per second:
import math
import re
def normalize_key(key):
# Remove '0x' prefix if present
key = key.lower().replace('0x', '')
# Pad with leading zeros if necessary
key = key.zfill(64)
# Ensure the key is 64 characters long
if len(key) != 64:
raise ValueError("Invalid key length. Must be 64 hexadecimal characters.")
return key
def parse_keys_per_second(kps_input):
# Remove commas and convert to float
kps = float(kps_input.replace(',', ''))
return kps
def pollards_kangaroo_time(start_key, stop_key, keys_per_second):
# Convert hexadecimal keys to integers
start = int(start_key, 16)
stop = int(stop_key, 16)
# Calculate the range size
range_size = stop - start + 1
# Pollard's Kangaroo expected number of steps
# The square root of the range size multiplied by 2
expected_steps = int(2 * math.sqrt(range_size))
# Calculate time in seconds
time_seconds = expected_steps / keys_per_second
# Convert to more readable time units
minutes, seconds = divmod(time_seconds, 60)
hours, minutes = divmod(minutes, 60)
days, hours = divmod(hours, 24)
years, days = divmod(days, 365.25) # Using 365.25 to account for leap years
return years, days, hours, minutes, seconds, expected_steps, range_size
# Get input from user
start_key = input("Enter start key (64 hex chars, or shorter hex number): ")
stop_key = input("Enter stop key (64 hex chars, or shorter hex number): ")
keys_per_second = input("Enter keys per second (e.g., 29500000000 or 29,500,000,000): ")
# Normalize and validate inputs
try:
start_key = normalize_key(start_key)
stop_key = normalize_key(stop_key)
keys_per_second = parse_keys_per_second(keys_per_second)
except ValueError as e:
print(f"Error: {e}")
exit(1)
# Calculate time and steps
years, days, hours, minutes, seconds, expected_steps, range_size = pollards_kangaroo_time(start_key, stop_key, keys_per_second)
# Print results
print(f"\nEstimated time to complete Pollard's Kangaroo algorithm:")
print(f"{years:.2f} years, {days:.2f} days, {hours:.2f} hours, {minutes:.2f} minutes, {seconds:.2f} seconds")
print(f"\nTotal operations (expected steps): {expected_steps:,}")
print(f"Total key range size: {range_size:,}")
# Calculate speedup compared to brute force
brute_force_time = range_size / keys_per_second
pollard_time = years * 365.25 * 86400 + days * 86400 + hours * 3600 + minutes * 60 + seconds
speedup = brute_force_time / pollard_time
print(f"\nSpeedup compared to brute force: {speedup:.2f}x")
I know it gives good estimates because I ran a test on puzzle 100 with my 4070 and the program said it would take about 14 days at about 1340 MK/s:
Kangaroo v2.2
Start:8000000000000000000000000
Stop :FFFFFFFFFFFFFFFFFFFFFFFFF
Keys :1
Number of CPU thread: 32
Range width: 2^99
Jump Avg distance: 2^48.95
Number of kangaroos: 2^20.55
Suggested DP: 26
Expected operations: 2^50.61
Expected RAM: 990.8MB
DP size: 26 [0xffffffc000000000]
SolveKeyCPU Thread 0: 1024 kangaroos
SolveKeyCPU Thread 1: 1024 kangaroos
SolveKeyCPU Thread 29: 1024 kangaroos
SolveKeyCPU Thread 14: 1024 kangaroos
SolveKeyCPU Thread 17: 1024 kangaroos
SolveKeyCPU Thread 20: 1024 kangaroos
SolveKeyCPU Thread 6: 1024 kangaroos
SolveKeyCPU Thread 16: 1024 kangaroos
SolveKeyCPU Thread 9: 1024 kangaroos
SolveKeyCPU Thread 5: 1024 kangaroos
SolveKeyCPU Thread 24: 1024 kangaroos
SolveKeyCPU Thread 12: 1024 kangaroos
SolveKeyCPU Thread 18: 1024 kangaroos
SolveKeyCPU Thread 15: 1024 kangaroos
SolveKeyCPU Thread 25: 1024 kangaroos
SolveKeyCPU Thread 22: 1024 kangaroos
SolveKeyCPU Thread 31: 1024 kangaroos
SolveKeyCPU Thread 8: 1024 kangaroos
SolveKeyCPU Thread 3: 1024 kangaroos
SolveKeyCPU Thread 13: 1024 kangaroos
SolveKeyCPU Thread 27: 1024 kangaroos
SolveKeyCPU Thread 7: 1024 kangaroos
SolveKeyCPU Thread 26: 1024 kangaroos
SolveKeyCPU Thread 11: 1024 kangaroos
SolveKeyCPU Thread 2: 1024 kangaroos
SolveKeyCPU Thread 4: 1024 kangaroos
SolveKeyCPU Thread 23: 1024 kangaroos
SolveKeyCPU Thread 30: 1024 kangaroos
SolveKeyCPU Thread 19: 1024 kangaroos
SolveKeyCPU Thread 28: 1024 kangaroos
SolveKeyCPU Thread 10: 1024 kangaroos
SolveKeyCPU Thread 21: 1024 kangaroos
GPU: GPU #0 NVIDIA GeForce RTX 4070 (46x0 cores) Grid(92x128) (122.0 MB used)
SolveKeyGPU Thread GPU#0: creating kangaroos...
SolveKeyGPU Thread GPU#0: 2^20.52 kangaroos [21.0s]
[1342.45 MK/s][GPU 1264.50 MK/s][Count 2^38.15][Dead 0][04:18 (Avg 14.8d)][2.1/4.7MB]
And this is what the calculator estimated:
Enter start key (64 hex chars, or shorter hex number): 8000000000000000000000000
Enter stop key (64 hex chars, or shorter hex number): FFFFFFFFFFFFFFFFFFFFFFFFF
Enter keys per second (e.g., 29500000000 or 29,500,000,000): 1,342,450,000
Estimated time to complete Pollard's Kangaroo algorithm:
0.00 years, 13.00 days, 17.00 hours, 28.00 minutes, 7.32 seconds
Total operations (expected steps): 1,592,262,918,131,443
Total key range size: 633,825,300,114,114,700,748,351,602,688
Speedup compared to brute force: 398065729532860.81x
Now, I know this is a stretch and isn't possible in its current state but you'll get the point. Hypothetically, if you were to use Elon Musk's new supercomputer with 100,000 H100s to run the Kangaroo Algorithm on puzzle 130 (doesn't have to be JLP), it would take about 18.5 hours:
Enter start key (64 hex chars, or shorter hex number): 200000000000000000000000000000000
Enter stop key (64 hex chars, or shorter hex number): 3FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Enter keys per second (e.g., 29500000000 or 29,500,000,000): 781250000000000
Estimated time to complete Pollard's Kangaroo algorithm:
0.00 years, 0.00 days, 18.00 hours, 33.00 minutes, 4.35 seconds
Total operations (expected steps): 52,175,271,301,331,132,416
Total key range size: 680,564,733,841,876,926,926,749,214,863,536,422,912
Speedup compared to brute force: 13043817825332781056.00x
Just thought I would share FYI