Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
nomachine
on 27/10/2023, 15:55:18 UTC
The same goal, only simplified. Wink
simplified..but you're pulling hashes from all over. this seems like it will take forever to find a match. even with impressive speed. and the peed may be that impressive because its not generating the correct hash values, they dont match the private keys. 0000000000000000000000000000000000000000000000c856c4ca3cb9c8766e
Iteration 133394: Generated hash 04133ae3a72b383457c8116a13a8f6fe12236ced
Private Key Hex: 0000000000000000000000000000000000000000000000c85509b05931fa7e0f
Iteration 133395: Generated hash 5503e52f2f7b052b7f0d06680931e1e5f7dc72bf
Private Key Hex: 0000000000000000000000000000000000000000000000c5783688057c9ff90e
Iteration 133396: Generated hash dea497f05ab93a4cd82c04b7042e8909cb71ed86
Private Key Hex: 00000000000000000000000000000000000000000000002bfa3a7bcb95a6bda1
Iteration 133397: Generated hash 4924746a8c9c8d0de3598cecd6a12005579b4c75
Private Key Hex: 0000000000000000000000000000000000000000000000c8c0e47fd806b23588
Iteration 133398: Generated hash 31c10fc8c9584b7d454e191f7ba046f171ea5ebc
Private Key Hex: 00000000000000000000000000000000000000000000004d1d18f8ba61efb1c9
Iteration 133399: Generated hash b6c3e00fdc24f63f5b9ae43c86ddad3048259c0f


Code:
import os
import hashlib

# List of target Hash 160 values to search for
target_public_key_hashes = [
    bytes.fromhex('20d45a6a762535700ce9e0b216e31994335db8a5'),
    bytes.fromhex('739437bb3dd6d1983e66629c5f08c70e52769371'),
    bytes.fromhex('e0b8a2baee1b77fc703455f39d51477451fc8cfc'),
    bytes.fromhex('61eb8a50c86b0584bb727dd65bed8d2400d6d5aa'),
    bytes.fromhex('f6f5431d25bbf7b12e8add9af5e3475c44a0a5b8'),
]

min_range =  37000000000000000000
max_range = 55340232221128654832

while True:
    random_bytes = os.urandom(9)
    initial_bytes = b'\x00' * 23
    full_bytes = initial_bytes + random_bytes
    h160 = hashlib.new('ripemd160', hashlib.sha256(full_bytes).digest()).digest()
   
    if h160 in target_public_key_hashes:
        dec = int.from_bytes(full_bytes, byteorder='big')
        if min_range <= dec <= max_range:
            print(f"Found match with hash {h160.hex()}. Decoded value: {dec}")
            target_public_key_hashes.remove(h160)  # Remove the found hash from the list
            if not target_public_key_hashes:
                print("All target hashes found.")
                break


You can filter full_bytes based on a decimal range, you can add a condition to check if the decimal value falls within the specified range. Three more lines of code.  Wink