<<  >> (p.192)
    Author Topic: Bitcoin puzzle transaction ~32 BTC prize to who solves it  (Read 324360 times)
    nomachine
    Full Member
    ***
    Offline Offline

    Activity: 714
    Merit: 110


    View Profile
    October 27, 2023, 03:04:25 PM
    Last edit: November 04, 2023, 01:07:40 PM by nomachine
     #3821

    hows this one? ready for some fun?  Roll Eyes THIS ONE SCRIPT IS SEARCHING FOR PUZZLES 66 -71 from a single hex which is 20000000000000000...2ffffffffffffffff. I can also adjust the step size.

    Code:
    import os, random, secrets, hashlib, ecdsa

    # 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'),
    ]

    while True:
        dec = secrets.SystemRandom().randrange(36893488147419103231, 2361183241434822606847)
        private_key_bytes = (b'\x00' * 32)[:-len(dec.to_bytes((dec.bit_length() + 7)/ 8, 'big'))] + dec.to_bytes((dec.bit_length() + 7)/ 8, 'big')
        signing_key = ecdsa.SigningKey.from_string(private_key_bytes, curve=ecdsa.SECP256k1)
        h160 = hashlib.new('ripemd160', hashlib.sha256(signing_key.get_verifying_key().to_string("compressed")).digest()).digest()   
        if h160 in target_public_key_hashes:
            dec = int.from_bytes(full_bytes, byteorder='big')
            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

    The same goal, only simplified. Wink

    BTC: bc1qdwnxr7s08xwelpjy3cc52rrxg63xsmagv50fa8
Page 191
Viewing Page: 192