It will certainly be touching the checkpoint BUT WHEN NO BODY CAN TELL FOR CERTAIN!
I saw someone commented on my script saying how script generated checkpoints and stuff,, please study pub key generation before using this script
Certainly!!!
I did comment but never said script generated checkpoint. I said I generated the checkpoint randomly myself between the range of 130 bits so i saved it in the checkpoints.txt file. but I was eventually advised how I could get the key subtractor from albertobsd but I couldn't compile the code so I downloaded the windows version from WanderingPhilosopher and it worked like magic.
I tried it with generating 1000 keys for a test and I thought of how I could derive the decimal representations of the public keys of so many numbers most especially if we are working with billions of numbers. now I wrote this code that takes arguments for -f for the file you got from your key extractor and -o for the output you want to save the decimal representation of the public keys for the x coordinates as advised, which in my case I always used the checkpoints.txt as my -o as it makes it more easy because it's all in the same directory
code is below
import argparse
def extract_x_coordinate(compressed_key):
# Remove the prefix (02 or 03) and extract x-coordinate
x_coord_hex = compressed_key[2:]
x_coord_decimal = int(x_coord_hex, 16)
return x_coord_decimal
def main():
parser = argparse.ArgumentParser(description='Extract x-coordinates of compressed public keys and save as decimals')
parser.add_argument('-f', '--input-file', required=True, help='Path to the input file containing compressed public keys')
parser.add_argument('-o', '--output-file', required=True, help='Path to the output file to save decimal x-coordinates')
args = parser.parse_args()
try:
with open(args.input_file, 'r') as input_file:
lines = input_file.readlines()
decimal_coordinates = []
for line in lines:
compressed_key = line.split()[0] # Extract only the public key part
decimal_x_coord = extract_x_coordinate(compressed_key)
decimal_coordinates.append(str(decimal_x_coord))
with open(args.output_file, 'w') as output_file:
output_file.write('\n'.join(decimal_coordinates))
print(f"Decimal x-coordinates saved to {args.output_file}")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
main()
I am still testing your code out @unpluggedcoin
I see something different and it's something good
let me fully understand how the code works
thanks