Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random_mini_key #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions bitcoin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ def subtract_privkeys(p1, p2):
k2 = decode_privkey(p2, f2)
return encode_privkey((decode_privkey(p1, f1) - k2) % N, f1)





# Hashes


Expand Down Expand Up @@ -419,6 +423,18 @@ def random_electrum_seed():
+ str(int(time.time() * 1000000))
return sha256(entropy)[:32]

def random_mini_key():
charset = get_code_string(58)[1:] # Base58 without the 1
while True:
randstr = ''.join([random.choice(charset) for i in xrange(29)])
key = "S{0}?".format(randstr)
if ord(bin_sha256(key)[0]) != 0:
continue
if ord(bin_sha256(key)[0]) == 0:
break
return key[:-1]


# Encodings

def b58check_to_bin(inp):
Expand Down