#//---------------------------------------------------------------------------- # #// Confirm proximity of target address within SubRanges for BTC Puzzle # #//---------------------------------------------------------------------------- # #//[+] Puzzle Number : 69 #//[+] BTC Address : 19vkiEajfhuZ8bs8Zu2jgmC6oqZbWqhxhG #//[+] BTC HASH160 : 61eb8a50c86b0584bb727dd65bed8d2400d6d5aa #//[+] BTC PUBLIC KEY : [unknown at this time] #//[+] BTC Search Range : #//[+] -- from : 0x100000000000000000 #//[+] -- to : 0x1fffffffffffffffff #//[+] BTC Start Range HEX : 100000000000000000 #//[+] BTC Start Range DEC : 295147905179352825856 #//[+] BTC End Range HEX : 1fffffffffffffffff #//[+] BTC End Range DEC : 590295810358705651711 #//Subrange file: BTC69_Subranges_1000.txt (tuple hex format) try: import sys import os import time import hashlib import binascii import multiprocessing from multiprocessing import Process, Queue from multiprocessing.pool import ThreadPool import threading import datetime import os import logging import ecdsa import hashlib import base58 import ecdsa from tqdm import tqdm import platform import time import sys import ast import requests import shutil # If required imports are unavailable, we will attempt to install them! except ImportError: import subprocess subprocess.check_call(["python3", '-m', 'pip', 'install', 'base58==1.0.0']) subprocess.check_call(["python3", '-m', 'pip', 'install', 'ecdsa==0.13']) subprocess.check_call(["python3", '-m', 'pip', 'install', 'requests==2.19.1']) import base58 import ecdsa import requests import shutil # Determine if running on Windows is_windows = platform.system() == "Windows" if is_windows: import datetime address_to_search = "19EEC52krRUK1RkUAEZmQdjTyHT7Gp1TYT" # Replace with the actual address current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") os.system(f"title BTC Puzzle - NO PUBLIC KEY VERSION: {address_to_search} [{current_time}]") import os import shutil import ecdsa import hashlib import multiprocessing import datetime def generate_preliminary_search_chunks(start_range_hex, end_range_hex, num_chunks): start_range_dec = int(start_range_hex, 16) end_range_dec = int(end_range_hex, 16) total_range = end_range_dec - start_range_dec + 1 chunk_size = total_range // num_chunks preliminary_search_chunks = [] start = start_range_dec for i in range(num_chunks): end = start + chunk_size - 1 if i == num_chunks - 1: end = end_range_dec start_hex = hex(start) end_hex = hex(end) preliminary_search_chunks.append((start_hex, end_hex)) start = end + 1 return preliminary_search_chunks def search_chunk(chunk, target_address, target_hash160): start_hex, end_hex = chunk start_dec = int(start_hex, 16) end_dec = int(end_hex, 16) for private_key in range(start_dec, end_dec + 1): myhex = "%064x" % private_key myhex = myhex[:64] priv = int(myhex, 16) sk = ecdsa.SigningKey.from_secret_exponent(priv, curve=ecdsa.SECP256k1) pub = b'04' + sk.get_verifying_key().to_string() pub_hex = pub.hex() hash160 = hashlib.new('ripemd160', hashlib.sha256(bytes.fromhex(pub_hex)).digest()).hexdigest() address = '1' + hashlib.new('ripemd160', hashlib.sha256(bytes.fromhex(hashlib.sha256(bytes.fromhex(pub_hex)).hexdigest())).digest()).hexdigest()[:40] if address == target_address and hash160 == target_hash160: return (address, myhex, pub_hex) return None def process_chunk(chunk, target_address, target_hash160, output_file): result = search_chunk(chunk, target_address, target_hash160) if result: address, private_key, pub_key = result output = f"Timestamp: {datetime.datetime.now()}\nFound matching Bitcoin address: {address}\nPrivate key: {private_key}\nPublic Key: {pub_key}" with open(output_file, "w") as found_f: found_f.write(output) print(f"Target solution found. Output saved at {output_file}") def process_subranges(subrange_sets, target_address, target_hash160, target_pubkey): for subrange_set in subrange_sets: start_range_hex, end_range_hex = subrange_set print(f"Processing subrange set: {start_range_hex} - {end_range_hex}") preliminary_search_chunks = generate_preliminary_search_chunks(start_range_hex, end_range_hex, 8) for i, chunk in enumerate(preliminary_search_chunks): chunk_start_hex, chunk_end_hex = chunk output_file = f"output_chunks/output_{start_range_hex}_{end_range_hex}_chunk_{i}.txt" process_chunk(chunk, target_address, target_hash160, output_file) if __name__ == "__main__": target_address = "19EEC52krRUK1RkUAEZmQdjTyHT7Gp1TYT" target_hash160 = "5a416cc9148f4a377b672c8ae5d3287adaafadec" target_pubkey = "026caad634382d34691e3bef43ed4a124d8909a8a3362f91f1d20abaaf7e917b36" with open("subranges_hex.txt", "r") as file: subrange_sets = eval(file.read()) if not os.path.exists("output_chunks"): os.makedirs("output_chunks") process_subranges(subrange_sets, target_address, target_hash160, target_pubkey)
Write, Run & Share Python code online using OneCompiler's Python online compiler for free. It's one of the robust, feature-rich online compilers for python language, supporting both the versions which are Python 3 and Python 2.7. Getting started with the OneCompiler's Python editor is easy and fast. The editor shows sample boilerplate code when you choose language as Python or Python2 and start coding.
OneCompiler's python online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample python program which takes name as input and print your name with hello.
import sys
name = sys.stdin.readline()
print("Hello "+ name)
Python is a very popular general-purpose programming language which was created by Guido van Rossum, and released in 1991. It is very popular for web development and you can build almost anything like mobile apps, web apps, tools, data analytics, machine learning etc. It is designed to be simple and easy like english language. It's is highly productive and efficient making it a very popular language.
When ever you want to perform a set of operations based on a condition IF-ELSE is used.
if conditional-expression
#code
elif conditional-expression
#code
else:
#code
Indentation is very important in Python, make sure the indentation is followed correctly
For loop is used to iterate over arrays(list, tuple, set, dictionary) or strings.
mylist=("Iphone","Pixel","Samsung")
for i in mylist:
print(i)
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
while condition
#code
There are four types of collections in Python.
List is a collection which is ordered and can be changed. Lists are specified in square brackets.
mylist=["iPhone","Pixel","Samsung"]
print(mylist)
Tuple is a collection which is ordered and can not be changed. Tuples are specified in round brackets.
myTuple=("iPhone","Pixel","Samsung")
print(myTuple)
Below throws an error if you assign another value to tuple again.
myTuple=("iPhone","Pixel","Samsung")
print(myTuple)
myTuple[1]="onePlus"
print(myTuple)
Set is a collection which is unordered and unindexed. Sets are specified in curly brackets.
myset = {"iPhone","Pixel","Samsung"}
print(myset)
Dictionary is a collection of key value pairs which is unordered, can be changed, and indexed. They are written in curly brackets with key - value pairs.
mydict = {
"brand" :"iPhone",
"model": "iPhone 11"
}
print(mydict)
Following are the libraries supported by OneCompiler's Python compiler
Name | Description |
---|---|
NumPy | NumPy python library helps users to work on arrays with ease |
SciPy | SciPy is a scientific computation library which depends on NumPy for convenient and fast N-dimensional array manipulation |
SKLearn/Scikit-learn | Scikit-learn or Scikit-learn is the most useful library for machine learning in Python |
Pandas | Pandas is the most efficient Python library for data manipulation and analysis |
DOcplex | DOcplex is IBM Decision Optimization CPLEX Modeling for Python, is a library composed of Mathematical Programming Modeling and Constraint Programming Modeling |