Post
Topic
Board Bitcoin Discussion
Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it
by
tmar777
on 15/12/2023, 09:12:17 UTC
Working on a script to run on a quantum computer, WE SHALL SEE THE RESULTS  Grin

Code:
.from qiskit import QuantumCircuit, execute, Aer
from qiskit.circuit.library import PhaseOracle

target_address_hex = "20d45a6a762535700ce9e0b216e31994335db8a5"
target_address_decimal = int(target_address_hex, 16)

def sha256_compression_function(qc, message_bits):
    # Implement SHA-256 compression using quantum gates
    # You need to add the actual logic here

    # For demonstration purposes, we'll just apply a simple quantum oracle
    oracle = PhaseOracle(message_bits, target=target_address_decimal)
    qc.append(oracle, range(qc.num_qubits))

# Define the range for iteration
start_range = 36893488147419103232
end_range = -73786976294838206464

# Main loop
for decimal_value in range(start_range, end_range+1):
    # Convert decimal value to bytes and binary string
    message_bytes = decimal_value.to_bytes(32, byteorder="big")
    binary_message = ''.join(format(byte, '08b') for byte in message_bytes)

    # Create quantum circuit
    qc = QuantumCircuit(256)

    # Apply bit operations to encode the initial state and message onto the qubits
    # Implement encoding logic based on your requirements

    # Implement the SHA-256 compression function using a quantum oracle
    sha256_compression_function(qc, binary_message)

    # Measure the final state of the qubits
    qc.measure_all()

    # Simulate the circuit
    job = execute(qc, backend=Aer.get_backend('qasm_simulator'), shots=1024)

    # Get the results and extract the final state
    counts = job.result().get_counts(qc)
    final_state = [int(bits, 2) for bits in counts.keys()][0]

    # Check if the generated hash matches the target address
    if final_state == target_address_decimal:
        print(f"Target address found!")
        print(f"Decimal Value: {decimal_value}")
        print(f"Simulated Bitcoin hash160: {hex(final_state)[2:].zfill(40)}")
        break


Hi mate,

how it is going so far? How much is the real rate of keys/s?