Skip to content

Instantly share code, notes, and snippets.

@sipherr
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sipherr/17d112755877f9b61dfb to your computer and use it in GitHub Desktop.
Save sipherr/17d112755877f9b61dfb to your computer and use it in GitHub Desktop.
import random
import BrainWallet
import re
target = "1LdChbUWYc48TQtH78CnpfnVQMpLYXH1Q1"
words = []
lens = {}
with open('dict.txt') as fh:
for s in fh.readlines():
s = s.strip().lower()
if re.match("^\w+$", s):
words.append(s)
l = len(s)
if not l in lens:
lens[l] = []
lens[l].append(s)
while True:
brainWallet = random.choice(words)+random.choice(words)
left = 17 - len(brainWallet)
if left > 0:
brainWallet += random.choice(lens[left])
for i in xrange(10):
bw = brainWallet+str(i)
addr = BrainWallet.get_addr(BrainWallet.gen_eckey(passphrase=bw))
if addr[0] == target:
print addr
print bw
exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment