Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
JamesH1453
on 11/01/2023, 12:32:31 UTC
I cannot get your @jolly_jocker code to run correctly.

However, I think what you are trying to achieve is using the known WIF key part and tumble searching the remaining characters to find the WIF private key. I am able to again, use the known key part and add a randomize search for the remaining part and output this in hexadecimal format. It is not any faster than a general hexadecimal search.

I am not sure if you can generate a WIF private key with a check sum and convert/compare ; and then print the WIF key again in the same script.
I do agree that this puzzle is about testing the strength and secure-ness of bitcoin with new, creative code.

This is a basic python script and variation of VanityGen:
Code:
import secrets
import base58
import binascii
from bitcoin import privtopub, pubtoaddr
import sys

vanity = "13zb1hQbWVsc2S7ZTZnP2G4undNNpdh5so"
btc_addr = ""

while btc_addr[:len(vanity)] != vanity:
    prefix = "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qa"
    alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
    postfix = ''.join(secrets.choice(alphabet) for i in range(18))
    first_encode = base58.b58decode(prefix + postfix)
    private_key_full = binascii.hexlify(first_encode)
    private_key = private_key_full[2:-8]
    btc_pubkey = privtopub(private_key.decode())
    btc_addr = pubtoaddr(btc_pubkey)
    
print(private_key.decode())
print(btc_pubkey)
print(btc_addr)

sys.exit()


Hello, Thanks for all your posts !
I modified your script a little, so that it loads the database of all BTC addresses plus searches for puzzle patterns at the same time. Grin
Code:
import os
import time
import secrets
import base58
import binascii
from bitcoin import privtopub, pubtoaddr
import sys
import multiprocessing
from halo import Halo
import random, string
import threading

print("Loading TXT Please Wait and Good Luck...")  
filename ='list.txt'
with open(filename) as f:
    add = f.read().split()
add = set(add)

spinner = Halo(text='Loading', spinner='dots')

r = 0
cores=1 #CPU Control Set Cores
def seek(r):
        F = []
        while True:
            prefix = "KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qa"
            alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
            postfix = ''.join(secrets.choice(alphabet) for i in range(18))
            first_encode = base58.b58decode(f'{prefix}{postfix}')
            private_key_full = binascii.hexlify(first_encode)
            private_key = private_key_full[2:-8]
            btc_pubkey = privtopub(private_key.decode())
            btc_addr = pubtoaddr(btc_pubkey)
            spinner.start()
              
            if btc_addr.startswith("13zb1"):
               t = time.ctime()
               spinner.stop()
               print("Pattern Found:",t, btc_addr, private_key)
               print("\n continue...\n")
               spinner.start()

            if btc_addr in add:
               t = time.ctime()
               spinner.stop()
               print("Winner Found!:",t, btc_addr, private_key)  
               f=open(u"Winner.txt","a") #Output File
               f.write('WIF private key: ' + str(private_key) + '\n' +
                            'public key: ' + str(btc_pubkey) + '\n' +
                            'BTC address: ' + str(btc_addr) + '\n\n')
               f.close()
               sleep(1)
               break

#CPU Control Command
if __name__ == '__main__':
        os.system('clear')
        t = time.ctime()
        print(t, "GOOD LUCK AND HAPPY HUNTING...")
        
        jobs = []
        for r in range(cores):
                p = multiprocessing.Process(target=seek, args=(r,))
                jobs.append(p)
                p.start()


HI
after run code:


Code:
Wed Jan 11 16:00:39 2023 GOOD LUCK AND HAPPY HUNTING...
⠙ LoadingProcess Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "ffff.py", line 32, in seek
    btc_pubkey = privtopub(private_key.decode())
  File "/usr/local/lib/python3.8/dist-packages/bitcoin/main.py", line 294, in privkey_to_pubkey
    raise Exception("Invalid privkey")
Exception: Invalid privkey