Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
pbies
on 01/11/2024, 16:18:02 UTC
@albert0bsd
Can you provide us some of the tools that can be used to search the range since the range is not fixed?

Try this (you may want to convert it to use CUDA):

Code:
#!/usr/bin/env python3

import hashlib
import multiprocessing
from tqdm import tqdm
from hdwallet import HDWallet
from hdwallet.symbols import BTC
from numba import cuda
from tqdm.contrib.concurrent import process_map

N = 115792089237316195423570985008687907852837564279074904382605163141518161494337

minKey = 0x659756abf6c17ca70e0000000000000000000140be6ddd93e441f8d4b4a85653b20b4cdcc5c748207a0daa16191d07a425d8080c276f9412472e0429e61bc355
maxKey = 0x659756abf6c17ca70fffffffffffffffffffff40be6ddd93e441f8d4b4a85653b20b4cdcc5c748207a0daa16191d07a425d8080c276f9412472e0429e61bc355
target_address = "1ECDLP8osCZHBB1LH5PVAUfFegeMgFb52q"

initial_stride = 0x1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

hdwallet = HDWallet(symbol=BTC)

def go(x):
y=hex(int(x/N))[2:]
hdwallet.from_private_key(private_key=y)
a=hdwallet.p2pkh_address()
if a=='1ECDLP8osCZHBB1LH5PVAUfFegeMgFb52q':
print('\n'+y)
o=open('found.txt','w')
o.write(y+'\n')
o.flush()
o.close()

r=range(minKey, maxKey, initial_stride)
count=int((maxKey-minKey)/initial_stride)

print(f'from\n{hex(minKey)}\nto\n{hex(maxKey)}\ncount\n{hex(count)}')
print('Working...')
for i in tqdm(r,total=count):
go(i)

print('\a', end='', file=sys.stderr)