Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
nomachine
on 21/02/2024, 07:29:21 UTC
Has anyone ever seen a tool that tries only a set of keys?

Of course we saw it. If you are missing no more than 10 characters, maybe it will work.

Code:
import sys
import os
import time
import secrets
import random
import binascii
import base58
import secp256k1 as ice
import multiprocessing
from multiprocessing import cpu_count

def generate_private_key_WIF(start, miss):
    return start + "".join(
        secrets.choice(
            "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
        )
        for _ in range(miss)
    )

def check_private_key(start, miss, target_caddr):
    while not STOP_EVENT.is_set(): 
        private_key_WIF_str = generate_private_key_WIF(start, miss)
        if start[0] == '5':
            private_key_WIF = private_key_WIF_str
            first_encode = base58.b58decode(private_key_WIF)
            private_key_full = binascii.hexlify(first_encode)
            private_key = private_key_full[2:-8]
        if start[0] in ['L', 'K']:
            private_key_WIF = private_key_WIF_str
            first_encode = base58.b58decode(private_key_WIF)
            private_key_full = binascii.hexlify(first_encode)
            private_key = private_key_full[2:-10]
        private_key_hex = private_key.decode("utf-8")
        dec = int(private_key_hex[0:64], 16)
        HEX = "%064x" % dec
        mul = ice.scalar_multiplication(dec)
        caddr = ice.pubkey_to_address(0, 1, mul)
        message = "\r[+] {} ".format(private_key_WIF_str)
        messages = []
        messages.append(message)
        output = "\033[01;33m" + ''.join(messages) + "\r"
        sys.stdout.write(output)
        sys.stdout.flush()
        if caddr == target_caddr:
            wifc = ice.btc_pvk_to_wif(HEX)
            t = time.ctime()
            sys.stdout.flush()
            print(f"\n\033[01;33m[+] BINGO!!! {t} \033[0m") 
            print(f"\033[32m[+] PUZZLE SOLVED: {wifc} \033[0m")
            with open('BINGO.txt', 'a') as file:
                t = time.ctime()
                file.write('\n\nMatch Found: ' + t)
                file.write('\nPrivatekey (dec): ' + str(dec))
                file.write('\nPrivatekey (hex): ' + hex(dec)[2:])
                file.write('\nPrivatekey (wif): ' + wifc)
               
            STOP_EVENT.set() 
            return 

if __name__ == '__main__':
    start = "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qZM21gaY8W"
    miss = 52 - (len(start))
    # Define the target
    target_caddr = "18ZMbwUFLMHoZBbfpCjUJQTCMCbktshgpe"
    os.system("clear")
    t = time.ctime()
    sys.stdout.write(f"\033[01;33m[+] {t}\n")
    sys.stdout.write(f"\033[01;33m[+] Ending characters missing: {miss}\n")
    sys.stdout.write(f"\033[01;33m[+] Target address: {target_caddr}\n")
    sys.stdout.flush()

    # Create a global STOP_EVENT
    STOP_EVENT = multiprocessing.Event()

    # Create a pool of worker processes
    num_processes = multiprocessing.cpu_count()
    pool = multiprocessing.Pool(processes=num_processes)

    # Start the worker processes with different starting points
    for i in range(num_processes):
        pool.apply_async(check_private_key, args=(start, miss, target_caddr))

    # Close the pool and wait for all processes to complete
    pool.close()
    pool.join()


  • Wed Feb 21 08:23:37 2024
  • Ending characters missing: 10
  • Target address: 18ZMbwUFLMHoZBbfpCjUJQTCMCbktshgpe
  • KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qZM21gaY8WhMLMGKsr4w
  • BINGO!!! Wed Feb 21 08:23:37 2024
  • PUZZLE SOLVED: KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qZM21gaY8WN2CdwnTG57

But here we need to solve Puzzle 66.
20 characters are missing from KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3q

That is impossible to solve. It doesn't matter how you present the private key. The numbers are so big that it is impossible. It doesn't matter which programming language it is.