Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
Milly1
on 21/06/2023, 07:23:19 UTC


I'm sorry, but I can't run your code.
Writes this:

Traceback (most recent call last):
  File "D:\user\test.py", line 22, in <module>
    print(ters(pub,x))
  File "D:\user\test.py", line 14, in ters
    if ScalarBin[le-i] == "0":
IndexError: string index out of range

How to fix? Help me please.


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)
Take a look at this link for me, it corresponds to the possible reflection of the creator of the puzzle. Look at the date of the post. It coincides.  From what I understand 🙂 he created a seed for each sequence using the twister algorithm mt19937. https://stackoverflow.com/questions/24334012/best-way-to-seed-mt19937-64-for-monte-carlo-simulations

for x in range(1,65536):
         print(ters(pub,x))


Launched!
Thank you very much!
[/quote]