Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
mcdouglasx
on 18/08/2023, 11:40:22 UTC

Code:
from sympy import mod_inverse
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))
Hey man, I wanted to try your script but error is  sympy module not found or doesn't exist. Any other way to get mod inverse working?

To install the `sympy` module on Windows, type CMD in the search bar and open Command Prompt and type
 pip install mpmath, first and then pip install sympy.
put ice dll and secpt256k1.py in the same folder where you have the script.