Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
Mikorist
on 11/12/2022, 17:54:23 UTC
Cool thanks .. Can you test speed and post results for us?

Here is GPU version

 
Code:
import os
os.environ['CUDA_VISIBLE_DEVICES'] = "0"
import numba
from numba import cuda, jit
import time
import base58
import binascii, base58
import string
import secrets
import secp256k1 as ice
from time import sleep


os.system('clear')

print(t, 'GOOD LUCK AND HAPPY HUNTING....')


#puzzle 66
addr="13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so"
x=57191151445131609186
y=57191152174079909761

numba.jit()
while True:
    dec0 = secrets.SystemRandom().randrange(x,y)     
    hex = "%064x" % dec0
    WIF=ice.btc_pvk_to_wif(hex)
    if WIF.startswith('5H') or WIF.startswith('5J') or WIF.startswith('5K') or WIF.startswith('K') or WIF.startswith('L'):
        if WIF.startswith('5H') or WIF.startswith('5J') or WIF.startswith('5K'):
            first_encode = base58.b58decode(WIF)
            private_key_full = binascii.hexlify(first_encode)
            private_key = private_key_full[2:-8]
            private_key_hex = private_key.decode("utf-8")
            dec = int(private_key_hex,16)
                       
        elif WIF.startswith('K') or WIF.startswith('L'):
            first_encode = base58.b58decode(WIF)
            private_key_full = binascii.hexlify(first_encode)
            private_key = private_key_full[2:-8]
            private_key_hex = private_key.decode("utf-8")
            dec = int(private_key_hex[0:64],16)
        HEX = "%064x" % dec
        wifc = ice.btc_pvk_to_wif(HEX)
        wifu = ice.btc_pvk_to_wif(HEX, False)
        uaddr = ice.privatekey_to_address(0, False, dec)
        caddr = ice.privatekey_to_address(0, True, dec)
        #first_5 = addr[:5]
       
        if uaddr.startswith('13zb1h') or caddr.startswith('13zb1h'):
            t = time.ctime()
            print('Time : ', t)
            print('PrivateKey (hex) : ', HEX)
            print('PrivateKey (dec) : ', dec)
            print('PrivateKey (wif) Compressed   : ', wifc)
            print('PrivateKey (wif) UnCompressed : ', wifu)
            print('Bitcoin Address Compressed   = ', caddr)
            print('Bitcoin Address UnCompressed = ', uaddr)
            print("\n continue...\n")
     
        if uaddr in addr or caddr in addr:
            t = time.ctime()
            print (t,'WINNER WINNER Check WINNER.txt')
            f=open('WINNER.txt','a')
            f.write('==========================================================================================\n')
            f.write(f"{t}\nPrivateKey (hex): {HEX}\nBitcoin Address Compressed    : {caddr}\nBitcoin Address UnCompressed  : {uaddr}\nPrivateKey (wif) Compressed   : {wifc}\nPrivateKey (wif) UnCompressed : {wifu}\n")
            f.write('==========================================================================================\n')
            f.close()   
            sleep(4)
            break

About a million in 0.02 seconds on my old laptop. Grin