In fact, for block 66, a private key must be generated with the 81129638414569788207641586040831 number, and this process is slow with a CPU, but using a graphics processor speeds it up.
This is a demonstration and test of how slow Python is. Even if it's a few million keys per second.
Random sequence:
from multiprocessing.pool import Pool
from subprocess import check_output
from tqdm import tqdm
from tqdm.contrib.concurrent import process_map
import secp256k1 as ice
import math
import random
import sys
div=16384
start=0x20000000000000000
end=0x3ffffffffffffffff
rng=0x3ffffffffffffffff-0x20000000000000000
stepout=int(rng/div)
stepin=0x200000000
right='13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so'
sys.stdout.write("\033[01;33m")
print('[+] target: '+right)
def int_to_bytes3(value, length = None): # in: int out: bytearray(b'\x80...
if not length and value == 0:
result = [0]
else:
result = []
for i in range(0, length or 1+int(math.log(value, 2**8))):
result.append(value >> (i * 8) & 0xff)
result.reverse()
return bytearray(result)
def pvk_to_addr(pvk):
return ice.privatekey_to_address(0, True, pvk)
global c
c = 0
def go(r):
global c
if c % 100 == 0:
print(f'[+] {c:,} Keys\r'.replace(',', ' '), end='')
c = c + 1
by = int_to_bytes3(r, 32)
pvk = int.from_bytes(by, byteorder='big') # Convert bytearray to integer
ad = pvk_to_addr(pvk)
# print('\r'+ad,end='')
if ad == right:
print('found!')
print(r)
print(hex(r))
HEX = "%064x" % int(r)
wifc = ice.btc_pvk_to_wif(HEX)
print(wifc)
print('\a')
with open('found.txt', 'w') as f:
f.write(str(r))
f.write('\n')
f.write(hex(r))
f.write('\n')
f.write(wifc)
f.write('\n')
f.flush()
sys.exit(0)
return
def n(a,b):
return list(range(a,b))
s=int(rng/div)
pool = Pool(10)
u=1048576
while True:
ra=random.randint(start,end-u)
rb=ra+u
print(f'\r[+] from: {hex(ra)} to: {hex(rb)} range: {hex(u)}={u}')
#global c
c=0
pool.map(go, range(ra,rb), chunksize=32768)
pool.close()
pool.join()
Sequential sequence:
from multiprocessing.pool import Pool
from subprocess import check_output
from tqdm import tqdm
from tqdm.contrib.concurrent import process_map
import secp256k1 as ice
import math
import random
import sys
div=16384
start=0x20000000000000000
end=0x3ffffffffffffffff
rng=0x3ffffffffffffffff-0x20000000000000000
stepout=int(rng/div)
stepin=0x200000000
right='13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so'
sys.stdout.write("\033[01;33m")
print('[+] target: '+right)
def int_to_bytes3(value, length = None): # in: int out: bytearray(b'\x80...
if not length and value == 0:
result = [0]
else:
result = []
for i in range(0, length or 1+int(math.log(value, 2**8))):
result.append(value >> (i * 8) & 0xff)
result.reverse()
return bytearray(result)
def pvk_to_addr(pvk):
return ice.privatekey_to_address(0, True, pvk)
global c
c = 0
def go(r):
global c
if c % 100 == 0:
print(f'[+] {c:,} Keys\r'.replace(',', ' '), end='')
c = c + 1
by = int_to_bytes3(r, 32)
pvk = int.from_bytes(by, byteorder='big') # Convert bytearray to integer
ad = pvk_to_addr(pvk)
# print('\r'+ad,end='')
if ad == right:
print('found!')
print(r)
print(hex(r))
HEX = "%064x" % int(r)
wifc = ice.btc_pvk_to_wif(HEX)
print(wifc)
print('\a')
with open('found.txt', 'w') as f:
f.write(str(r))
f.write('\n')
f.write(hex(r))
f.write('\n')
f.write(wifc)
f.write('\n')
f.flush()
sys.exit(0)
return
def n(a,b):
return list(range(a,b))
s=int(rng/div)
pool = Pool(10)
u = 1048576
for ra in range(start, end - u + 1, u):
rb = ra + u
print(f'\r[+] from: {hex(ra)} to: {hex(rb)} range: {hex(u)}={u}')
c = 0
pool.map(go, range(ra, rb), chunksize=32768)
pool.close()
pool.join()