0% found this document useful (0 votes)
34 views

annk.py

The document is a Python script designed to generate Bitcoin addresses from mnemonic phrases and check if they match a specified wallet address. It utilizes libraries such as bip32utils, hashlib, and ecdsa for cryptographic functions and multiprocessing to handle multiple mnemonic phrases concurrently. The script logs attempts and outputs a match if the generated address corresponds to the target wallet address.

Uploaded by

vicky9879871
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

annk.py

The document is a Python script designed to generate Bitcoin addresses from mnemonic phrases and check if they match a specified wallet address. It utilizes libraries such as bip32utils, hashlib, and ecdsa for cryptographic functions and multiprocessing to handle multiple mnemonic phrases concurrently. The script logs attempts and outputs a match if the generated address corresponds to the target wallet address.

Uploaded by

vicky9879871
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

import bip32utils

import hashlib
import multiprocessing
from mnemonic import Mnemonic
from ecdsa import SigningKey, SECP256k1
import os
import binascii

# CONFIG
wallet_address = "18TunLkX51RgFYQyjmqgRE3zZ6ankDawC5"
wordlist_path = "C:\Users\sadis\OneDrive\Desktop\password.lst"
logfile_path = "mnemonic_attempts.txt"

HARDENED_KEY_OFFSET = 0x80000000

def sha256(data):
return hashlib.sha256(data).digest()

def ripemd160(data):
h = hashlib.new('ripemd160')
h.update(data)
return h.digest()

def base58_check_encode(data):
checksum = sha256(sha256(data))[:4]
return b58encode(data + checksum)

# Base58 alphabet
alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def b58encode(b):
n = int.from_bytes(b, 'big')
res = ''
while n > 0:
n, r = divmod(n, 58)
res = alphabet[r] + res
pad = 0
for byte in b:
if byte == 0:
pad += 1
else:
break
return '1' * pad + res

def generate_address_from_mnemonic(mnemonic_phrase):
seed = Mnemonic("english").to_seed(mnemonic_phrase)
bip32_root_key_obj = bip32utils.BIP32Key.fromEntropy(seed)
child_key = bip32_root_key_obj.ChildKey(44 + HARDENED_KEY_OFFSET) \
.ChildKey(0 + HARDENED_KEY_OFFSET) \
.ChildKey(0 + HARDENED_KEY_OFFSET) \
.ChildKey(0) \
.ChildKey(0)

privkey_bytes = child_key.PrivateKey()
sk = SigningKey.from_string(privkey_bytes, curve=SECP256k1)
vk = sk.get_verifying_key()
pubkey_bytes = b'\x04' + vk.to_string()

pubkey_sha = sha256(pubkey_bytes)
pubkey_ripemd = ripemd160(pubkey_sha)

versioned_payload = b'\x00' + pubkey_ripemd


address = base58_check_encode(versioned_payload)
return address, mnemonic_phrase

def process_mnemonic(mnemonic):
try:
mnemonic = mnemonic.strip()
if len(mnemonic.split()) != 12:
return
address, phrase = generate_address_from_mnemonic(mnemonic)
log_line = f"[{os.getpid()}] {address} ← {phrase}\n"
with open(logfile_path, "a", encoding="utf-8") as f:
f.write(log_line)
if address == wallet_address:
print(f"\n🔥 MATCH FOUND 🔥\nAddress: {address}\nMnemonic: {phrase}")
os._exit(0)
except Exception as e:
return

def main():
with open(wordlist_path, "r", encoding="utf-8") as f:
phrases = f.readlines()

print(f"[+] Loaded {len(phrases)} mnemonic phrases.")


print("[+] Starting multiprocessing...")

with multiprocessing.Pool(processes=multiprocessing.cpu_count()) as pool:


pool.map(process_mnemonic, phrases)

if __name__ == "__main__":
main()

You might also like