Aside from adding ^^^^^^^ under ECC operations on screen, everytime I fix a missing lib/module, it returns error about some line 447 or 464 in secp256k1 module, error about pkg-config which I can't install because no such file, even if I download it and add it to my folder, it wont work. Is this related to the py version? I have python 3.10, and also 3.11. Is there a place where I could paste my script to have access to everything instead of installing and moving needed files one by one? Lol
I have some old scripts which some moron AI helped me to code back then, if I can get python scripts running without any errors I could test them.
Sir plz, don't banned me just learn here.😅
Try to install visual studio code to start programming, it shows errors in the code, you can easily download libraries, you can use it for python or another language, the problem is that it can be slow when executing the codes, but with it you can edit the codes , avoid errors save them and then run it in the command window.
As for the puzzle, notice that the code you try to execute to reduce the pubkey is wrong, it uses an upub key to convert it to an Upub key, that code is used to convert compressed to uncompressed.
Original
import secp256k1 as ice
pub=ice.pub2upub('0433709eb11e0d4439a729f21c2c443dedb727528229713f0065721ba8fa46f00e2a1c304a39a77775d3579d077b6ee5e4d26fd3ec36f52ad674a9b47fdd999c48')
N=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
k=mod_inverse(2,N)
neg1=ice.point_negation(ice.scalar_multiplication(1))
def ters(Qx,Scalar):
ScalarBin = str(bin(Scalar))[2:]
le=len(ScalarBin)
for i in range (1,le+1):
if ScalarBin[le-i] == "0":
Qx=ice.point_multiplication(k,Qx)
else:
Qx=ice.point_addition(Qx,neg1)
Qx=ice.point_multiplication(k,Qx)
return ice.point_to_cpub(Qx)
for x in range(1,65536):
print(ters(pub,x))
Fixed
import secp256k1 as ice
pub=ice.pub2upub('Here Compressed Public Key')
N=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
k=mod_inverse(2,N)
neg1=ice.point_negation(ice.scalar_multiplication(1))
def ters(Qx,Scalar):
ScalarBin = str(bin(Scalar))[2:]
le=len(ScalarBin)
for i in range (1,le+1):
if ScalarBin[le-i] == "0":
Qx=ice.point_multiplication(k,Qx)
else:
Qx=ice.point_addition(Qx,neg1)
Qx=ice.point_multiplication(k,Qx)
return ice.point_to_cpub(Qx)
for x in range(1,65536):
f= (ters(pub,x))
data= open(“halfpub.txt”,”a”)
data.write(f+”\n”)
data.close()