The x-coordinate for puzzle 135 is 76 digits and the y-coordinate is 77 digits?
This may help with searching a sub-range of keys. My terminal process killed running 1E32 but I only have 4GB of RAM.
Try 1E21 and be sure to check the length of the x_values on output they range from 75-77.
Good Luck!
Why are you even saving it to a file? You can do the matching right away.

from ecdsa import SigningKey, SECP256k1
import ecdsa
# Define Puzzle #135 coordinates
x_given = 9210836494447108270027136741376870869791784014198948301625976867708124077590
y_given = 69440582532487379038177105219556131878098716909078780397935812212458092996863
# Define the target x-coordinate to match exactly
target_x = x_given # You can set this to any specific value
# Define private key search range
k_lower = 21778071482940061661655974875633165533184 # + 10**26
k_upper = 43556142965880123323311949751266331066367 # - 10**26
# Define a threshold to check for x-values and y-values near the given coordinates
threshold = 10**76 # Adjust based on how "near" to the given coordinates we want
def private_key_to_public_xy(private_key):
"""Computes the x and y coordinates of the public key from a given private key."""
sk = SigningKey.from_secret_exponent(private_key, curve=SECP256k1)
vk = sk.verifying_key
# Extract x and y coordinates
x_coord = int.from_bytes(vk.to_string()[:32], 'big') # First 32 bytes are x
y_coord = int.from_bytes(vk.to_string()[32:], 'big') # Next 32 bytes are y
return x_coord, y_coord
# Reduce step size to scan more precisely
step_size = int(1e35) # Smaller step size for finer detail
print("Scanning for private keys that generate x and y values close to the given coordinates...")
for k in range(k_lower, k_upper, step_size):
x_value, y_value = private_key_to_public_xy(k)
# Check if x_value matches the target_x exactly
if x_value == target_x:
print(f"Exact match found! Private Key = {k}, x = {x_value}, y = {y_value}")
break # Stop searching after finding the exact match
You will quickly realize that this is useless. Without a kangaroo, you have no chance of finding a match.