I want to change the code to base G to generate public keys.
import bitcoin with open("Privkey.txt","r") as f: content = f.readlines() # you may also want to remove whitespace characters like `n` at the end of each line content = (x.strip() for x in content) f.close() outfile = open("key2pub.txt","w") for x in content: outfile.write(x+":"+bitcoin.privtopub(x)+"n") outfile.close()
This script imports the Bitcoin module.
As you know, secp256k1 uses points on an elliptic curve:
Gx = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 Gy = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
Now I have to change these points into my own. Let us admit to points:
Gx = 0xad4f5dc4a9fba25dd7ecb50b0382c29f52c8fc6826e1d5e4c347eec2010e47ed Gy = 0xbf1e735b3a83b8bee5d60e1bd441e55b425d4b9ef3c1dca7298e829eec33ea4d
I just start programming in Python 3 and do not understand the modules
How can I change this code?