you can test it. key hunt speed in my pc is 60 Mk/s
In the Cuda programming, an algorithm is executed in parallel, and in fact, this search operation in each core performs a similar task in parallel, and the cores do not help each other's process to increase the search speed, but each of them works as an island exactly the same way. They do something else and that's why this program has problems
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 14 17:50:54 2024
1000 Bitcoin Puzzle Scanner for 2^66 ~ 2^67
@author: Amin Solhi , Contacts => email:
[email protected] , +9891111842779
"""
import bitcoin
import ecdsa
import secrets
from timeit import default_timer as timer
import datetime
global target_address
global output_file
global rng
global private_key
global ks
global start
global random_mode
target_address = "13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so"
output_file = "data.txt"
rng = 20 # int(input("Enter Random Space Number 1 ~ 100 :"))
private_key="20000000000000000"
ks=0
start = timer()
random_mod = True # True or False
print ("\nBTCGEN Bitcoin Puzzle #66 Scanner \n")
print ("BTC Address : ",target_address)
print ("OutPut File : ",output_file)
print ("Randome Mod : ",f"{str(random_mod)}")
if (random_mod):
print ("Random Key : ",f'per {rng}K key')
print ("Device : CPU")
print ("Global Start: ",private_key)
print ("Global END : 40000000000000000")
print('\n')
def remove_zeros(input_string):
result = ""
zero = ""
for char in input_string:
if char != "0":
zero = "finish"
if zero =="finish" :
result += char
return result
t=""
t +="0"*47
def h(a):
#a = a[:1] + '0' + a[1:]
if (len(a) < 64):
#a = a[:1] + '0' + a[1:]
a = '0' + a[:]
if (len(a) < 64):
a = h(a)
return a
def generate_random_priv():
p=str(secrets.choice(range(2, 4)))
return (p+secrets.token_hex(8))
def generate_private_key(num_hex):
num_decimal = int(num_hex, 16)
num_decimal += 1
num_hex = h(str(f'{num_decimal:x}'))
return (num_hex)
def private_key_to_public_key(private_key):
sk = ecdsa.SigningKey.from_string(bytes.fromhex(private_key), curve=ecdsa.SECP256k1)
vk = sk.get_verifying_key()
compressed_public_key = vk.to_string("compressed").hex()
return compressed_public_key
def onmain():
#start = timer()
global private_key
global rng
global ks
global start
global target_address
global i
for _ in range(rng*1000):#while True:
ks+=1
private_key = generate_private_key(private_key)#secrets.randbelow(32)) # Generate a random private key
public_key = private_key_to_public_key(private_key) # Convert private key to compressed public key
#print (private_key)
#print(i,"--- ",timer()-start,"seconds ---" ,)
# Generate Bitcoin address from public key
bitcoin_address = bitcoin.pubtoaddr(public_key)
if (bitcoin_address == target_address):
f = open(output_file, "a")
f.write('\nprivate key int: '
+ private_key
+'\nBitcoin address: '
+ bitcoin_address+'\n_________\n')
f.close()
print(f"\nFound matching Bitcoin address for private key: {private_key}")
input("")
print(f"\r[Total : {(ks/1000000)} Mk/{int(timer()-start)}s] [Private key hex: {(remove_zeros(private_key))}] ", end="")
def onmain_random():
#start = timer()
global private_key
global rng
global ks
global start
global target_address
global i
global random_str
for _ in range(rng*1000):#while True:
ks+=1
private_key = generate_private_key(private_key)#secrets.randbelow(32)) # Generate a random private key
public_key = private_key_to_public_key(private_key) # Convert private key to compressed public key
#print (private_key)
#print(i,"--- ",timer()-start,"seconds ---" ,)
# Generate Bitcoin address from public key
bitcoin_address = bitcoin.pubtoaddr(public_key)
if (bitcoin_address == target_address):
f = open(output_file, "a")
f.write('\nprivate key int: '
+ private_key
+'\nBitcoin address: '
+ bitcoin_address+'\n_________\n')
f.close()
print(f"\nFound matching Bitcoin address for private key: {private_key}")
input("")
print(f"\r[{str(datetime.timedelta(seconds=int(timer()-start)))}] [Total : {(ks/1000000)} Mk] [R: {i}] [Private key hex: {(remove_zeros(private_key))}] ", end="")
def main():
global private_key
global i
global random_str
random_str =""
i=0
if (random_mod):
while True:
i+=1
private_key=generate_random_priv()
onmain_random()
else:
while True:
i+=1
onmain()
if __name__ == "__main__":
main()