Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
vincetcm
on 19/03/2022, 22:01:32 UTC
you can select the number of cores via ' a = ' in the top of the scrypt ..
I have to deal with the upload first... I haven't done it yet..

i just see that " a " wasn't a good choice for the cores, since a is already used in scrypt.. change from "a = 4" to "c =4" and in the part "for r in range(a): " to " for r in range(c): " important!!

Although it works with "a" , it could lead to errors!


The corrected code !

Code:
import time
import random
import secp256k1 as ice
from time import sleep
from multiprocessing import Process, Value

c = 4
y = 2097152
counter = Value('L')
def process1(number,counter,):
    while True:
        a = random.randint(2**63, 2**64)
        for x in range(number):
            x = x
            bina = bin(a)[2:]
            zeros = bina.count("0")
            if zeros >= 16:
                if zeros <= 43:
                    addr = ice.privatekey_to_address(0, True, a)
                    with counter.get_lock():
                            counter.value += 1
                    
                    if addr.startswith('16jY7q'):
                        print('\n Pattern found: '+hex(a)+' | '+ addr)
                        sleep(1)
                        print("\n continue...\n")
                        
                    if addr == "16jY7qLJnxb7CHZyqBP8qca9d51gAjyXQN":
                        file=open(u"16jY.Info.txt","a")
                        file.write('\n '+hex(a)+' | '+ addr)
                        file.close()
                        wait = input("Press Enter to Exit.")
                        sleep(1)
                        exit()
                        
                    if x == 0:
                        print ('', hex(a), bina, zeros, '', str(counter.value))
                
                
            a = a +1
        pass

if __name__ == '__main__':
    t = time.ctime()
    print('',t)
    number = y
    workers = []
    print('\n\n BINARY MULTI PY \n #64: 8000000000000000...ffffffffffffffff\n\n')
    print('                                                                                    zeros')
    print(' == PRIVKEY HEX == |____________________________ BINARY ____________________________|  | CNT == \n')
    for r in range(c):
        p = Process(target=process1, args=(number,counter,))
        workers.append(p)
        p.start()

    for worker in workers:
        worker.join()          

 


donate BTC: 1DonateZNR9BUaCqJTgXCoyyCpRSosFujR


Traceback (most recent call last):
  File "main.py", line 3, in <module>
    import secp256k1 as ice
ModuleNotFoundError: No module named 'secp256k1'