How to crackWin 7 Bitcoins? A Bitcoin puzzle to guess the key!

1. About the Bitcoin puzzle

The Bitcoin Puzzle™ at PrivateKeys.pw is a series of Bitcoin challenges where wallets are funded using partial private keys—each puzzle limits the unknown part of the key to a specific number of bits. Participants must brute-force the missing bits to discover the private key and claim the funds

2. How to brute-force the missing bits

There are many brute force cracking methods here. The official one provides cracking using graphics cards, but I can’t use Nvidia graphics cards because I use an Apple silicon computer. For this reason, I first look for free cloud solutions, and secondly, make a cracking program that can be accepted by a wide range of computers, not limited to Nvidia graphics cards. In today’s article, I will take you to explore multi-threaded CPU cracking methods and cracking using free cloud. Wish you good luck!

3.Preparation

(I). Python source code

This code was written by shousake, a Bitcoin puzzle brute-force code.

Install base58==2.1.1 and ecdsa==0.19.1

pip install base58==2.1.1 ecdsa==0.19.1

Copy the code to crack.py

You can change “your target address” to any Bitcoin address you want to crack. You can change “start range” and “stop range” to the range of addresses you want to crack. You can change “Number of threads” to the number of threads you want, the number of threads does not exceed the maximum value of your computer.

from multiprocessing import Process, current_process
import random
import hashlib
import base58
from ecdsa import SigningKey, SECP256k1
import signal
import sys

target_address = '12VVRNPi4SJqUTsp6FmqDqY5sGosDtysn4' # your target address

def hex_to_wif(hex_private_key):
    private_key_bytes = bytes.fromhex(hex_private_key)
    payload = b'\x80' + private_key_bytes + b'\x01'
    checksum = hashlib.sha256(hashlib.sha256(payload).digest()).digest()[:4]
    return base58.b58encode(payload + checksum).decode()

def hex_to_compressed_public_key(hex_private_key):
    private_key_bytes = bytes.fromhex(hex_private_key)
    signing_key = SigningKey.from_string(private_key_bytes, curve=SECP256k1)
    public_key = signing_key.get_verifying_key().to_string()
    return (b'\x02' if public_key[32] % 2 == 0 else b'\x03') + public_key[:32]

def compressed_public_key_to_address(compressed_public_key):
    sha256_hash = hashlib.sha256(compressed_public_key).digest()
    ripemd160_hash = hashlib.new('ripemd160', sha256_hash).digest()
    payload = b'\x00' + ripemd160_hash
    checksum = hashlib.sha256(hashlib.sha256(payload).digest()).digest()[:4]
    return base58.b58encode(payload + checksum).decode()

def scan():
    start = 0x1000000000000000000      # start range
    end =   0x1ffffffffffffffffff      # stop range
    print(f"范围: {hex(start)} - {hex(end)}")
    while True:
        num = random.randint(start, end)
        hex_key = hex(num)[2:].zfill(64)
        pubkey = hex_to_compressed_public_key(hex_key)
        address = compressed_public_key_to_address(pubkey)
        if address == target_address:
            print(f"[{current_process().name}] 匹配成功!")
            print(f"WIF 私钥: {hex_to_wif(hex_key)}")
            print(f"Hex 私钥: {hex_key}")
            with open('output.txt', 'w', encoding='utf-8') as f:
                f.write(hex_to_wif(hex_key) + '\n')  # 加 '\n' 换行
            break

def signal_handler(sig, frame):
    print("\n程序已终止。")
    sys.exit(0)

if __name__ == '__main__':
    signal.signal(signal.SIGINT, signal_handler)
    workers = 5     # Number of threads
    processes = []
    for _ in range(workers):
        p = Process(target=scan)
        p.start()
        processes.append(p)

    for p in processes:
        p.join()
(II). Run
python crack.py

4. Run you script at Python Lab

I have already introduced how to register in the previous article. So in this article I will talk about how to run your own python script.

(I). Add Python Dependencies to requirements.txt

base58==2.1.1
ecdsa==0.19.1

(II). Copy the code to Notebook

(III). Run the code

If you are lucky enough, you can find the key!

5. Withdraw Bitcoin

Once you have cracked the private key, congratulations, you have gained control of the Bitcoin. Now you just need to copy the Bitcoin private key to any wallet, such as OKX wallet, Gate wallet, Bybit wallet, safepal wallet, etc. Take it out quickly, don’t wait!

留下评论

您的邮箱地址不会被公开。 必填项已用 * 标注