Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
nomachine
on 19/07/2024, 17:35:19 UTC
I have a script program almost complete to do that, it actually check the mempool if there is a TX it extract the public key, send it to my keyhunt server retrieve the private key and the last part is  still  not complete, just need to make the TX i already have some script for that I just need to put all together, if you wait me i can finish it tomorrow and test it with a smaller TX. Send me a email or telegram i can show you that tomorrow.

can you show us that script, please?

I wil show you part of my last script...Uses Iceland's rsz_rdiff_scan.py to get public key....


Code:
# Setup logging
logging.basicConfig(level=logging.INFO)

def run_rsz_rdiff_scan(address):
    command = f"python3 rsz_rdiff_scan.py -a {address}"
    result = subprocess.run(command, shell=True, capture_output=True, text=True)
    return result.stdout

def extract_public_key(output):
    match = re.search(r'PubKey:\s+([0-9a-fA-F]+)', output)
    if match:
        return match.group(1)
    return None

def save_public_key(pubkey):
    with open("66.txt", "w") as f:
        f.write(pubkey)

def run_keyhunt():
    command = "./keyhunt -m bsgs -f 66.txt -b 66 -q -S -t 12 -k 4096 -S"
    subprocess.run(command, shell=True)

def extract_private_key():
    try:
        with open("KEYFOUNDKEYFOUND.txt", "r") as f:
            for line in f:
                if "Key found privkey" in line:
                    privkey = line.split("Key found privkey")[1].strip()
                    return privkey
    except FileNotFoundError:
        logging.error("KEYFOUNDKEYFOUND.txt not found")
    return None

def convert_to_wif(privkey):
    return ice.btc_pvk_to_wif(privkey)

def start_electrum_daemon():
    command = "electrum daemon -d"
    subprocess.run(command, shell=True)
    time.sleep(1)

def stop_electrum_daemon():
    command = "electrum stop"
    subprocess.run(command, shell=True)
    time.sleep(1)

def restore_wallet(wif_key, password):
    command = f"electrum -w /root/.electrum/wallets/66 restore {wif_key} --password {password}"
    result = subprocess.run(command, shell=True, capture_output=True, text=True)
    logging.info(f"restore_wallet output: {result.stdout} {result.stderr}")

and so on....