Code snippets, scripts, and experiments worth keeping.
ETH BIP39 Wallet Brute-Forcer
PythonWeb3Crypto
Automated BIP39 mnemonic phrase generator that derives Ethereum addresses using the standard HD wallet derivation path (m/44'/60'/0'/0/0) and checks their on-chain balance via Infura RPC. Generates valid 12-word seed phrases, converts them to private keys, and queries the Ethereum mainnet. If a wallet with a non-zero balance is found, it logs the phrase, address, and balance to a file. Purely educational — the probability of hitting a funded wallet is astronomically low (~1 in 2¹²⁸).
Python
import time
from mnemonic import Mnemonic
from bip32utils import BIP32Key, BIP32_HARDEN
from eth_account import Account
from web3 import Web3
# === CONFIG ===
INFURA_PROJECT_ID = "YOUR_INFURA_PROJECT_ID" # <- replace with yours
OUTPUT_FILE = "found_wallets.txt"
w3 = Web3(Web3.HTTPProvider(f"https://mainnet.infura.io/v3/{INFURA_PROJECT_ID}"))
if not w3.is_connected():
raise Exception("❌ Cannot connect to Ethereum. Check your Infura ID.")
mnemo = Mnemonic("english")
def phrase_to_eth_address(phrase: str) -> str:
"""Derive an ETH address from a BIP39 mnemonic using the standard path."""
seed = mnemo.to_seed(phrase)
root = BIP32Key.fromEntropy(seed)
acct = (
root.ChildKey(44 + BIP32_HARDEN)
.ChildKey(60 + BIP32_HARDEN)
.ChildKey(0 + BIP32_HARDEN)
.ChildKey(0)
.ChildKey(0)
)
priv = acct.PrivateKey().hex()
return Account.from_key(priv).address
def save_found(phrase, address, balance):
"""Append a discovered wallet to the output file."""
with open(OUTPUT_FILE, "a", encoding="utf-8") as f:
f.write(
f"Phrase: {phrase}\n"
f"Address: {address}\n"
f"Balance: {balance} ETH\n"
f"{'-' * 50}\n"
)
print(f"💰 FOUND! {address} → {balance} ETH")
def main():
print("🔁 Automated random BIP39 phrase brute-force (12 words)")
print("Stop: Ctrl+C\n")
count = 0
while True:
try:
# Generate a VALID 12-word mnemonic phrase
phrase = mnemo.generate(strength=128)
address = phrase_to_eth_address(phrase)
balance_wei = w3.eth.get_balance(address)
balance = w3.from_wei(balance_wei, "ether")
count += 1
if balance > 0:
save_found(phrase, address, balance)
if count % 50 == 0:
print(f"[{count}] Last address: {address} | Balance: {balance} ETH")
time.sleep(0.1) # respect Infura rate limits
except KeyboardInterrupt:
print(f"\n⏹️ Stopped. Total checked: {count}")
break
except Exception as e:
print(f"⚠️ Error: {e}")
time.sleep(1)
if __name__ == "__main__":
main()