This repository has been archived by the owner on Nov 5, 2022. It is now read-only.
forked from iceland2k14/secp256k1
-
Notifications
You must be signed in to change notification settings - Fork 8
/
HASH160_randomCPU.py
89 lines (74 loc) · 3.47 KB
/
HASH160_randomCPU.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
'''
Made by Mizogg Look for HASH160 Compressed and Uncompressed Using iceland2k14 secp256k1 https://github.com/iceland2k14/secp256k1 fastest Python Libary
Good Luck and Happy Hunting HASH160_randomCPU.py Version 2 scan randomly in Range with CPU Speed Improvments
https://mizogg.co.uk
'''
import secp256k1 as ice
import time, multiprocessing, random
from multiprocessing import pool, Event, Process, Queue, Value, cpu_count
from time import sleep
def hunt(start, stop, h160, cores='all'):
try:
available_cores = cpu_count()
if cores == 'all':
cores = available_cores
elif 0 < int(cores) <= available_cores:
cores = int(cores)
else:
cores = 1
counter = Value('L')
match = Event()
queue = Queue()
workers = []
for r in range(cores):
p = Process(target=main, args=(counter, start, stop, h160))
workers.append(p)
p.start()
for worker in workers:
worker.join()
except(KeyboardInterrupt, SystemExit):
exit('\nCTRL-C detected. Exiting gracefully. Thank you and Happy Hunting')
def main(counter, start, stop, h160):
count = 0
iteration = 0
start_time = time.time()
while True:
iteration += 1
count += 2
ran=random.randrange(start,stop)
HEX = "%064x" % ran
hash160 = ice.privatekey_to_h160(0, True, ran).hex()
hash160u = ice.privatekey_to_h160(0, False, ran).hex()
if hash160 in h160 or hash160u in h160:
print('\nMatch Found ', '\nHASH160 compressed : ', hash160, '\nHASH160 Uncompressed : ', hash160u, '\nPrivatekey (dec): ', ran, '\nPrivatekey (hex): ', HEX)
f=open("winner.txt","a")
f.write('\nPrivatekey (dec): ' + str(ran))
f.write('\nPrivatekey (hex): ' + HEX)
f.write('\nMatching HASH160 Compressed Found : ' + hash160)
f.write('\nMatching HASH160 Uncompressed Found : ' + hash160u)
f.close()
else:
if iteration % 10000 == 0:
elapsed = time.time() - start_time
print(f'It/CPU={iteration} checked={count} hash160={hash160} Keys/Sec={iteration / elapsed:.1f}')
#print('\nHASH160 Uncompressed : ', hash160u, '\nHASH160 Compressed : ', hash160, '\nPrivatekey (dec): ', ran, '\nPrivatekey (hex): ', HEX)
if __name__ == '__main__':
print('[+] Starting.........Please Wait.....HASH160 List Loading.....')
filename ='puzzleHASH160.txt'
with open(filename) as f:
line_count = 0
for line in f:
line != "\n"
line_count += 1
with open(filename) as file:
h160 = file.read().split()
h160 = set(h160)
print('Total HASH160 Loaded and Checking : ',str (line_count))
howmany=int(input("Number of Cores CPU -> "))
start=int(input("start range Min 1-115792089237316195423570985008687907852837564279074904382605163141518161494335 -> "))
stop=int(input("stop range Max 115792089237316195423570985008687907852837564279074904382605163141518161494336 -> "))
print("Starting search... Please Wait min range: " + str(start))
print("Max range: " + str(stop))
print("==========================================================")
print('Total HASH160 Loaded and Checking : ',str (line_count))
hunt(start, stop, h160, cores = howmany)