How to generate public and private key pairs from the 12 seed words in python I basically followed the instructions here How to generate mycelium addresses from the 12 words in python So my code is similar: from bip32utils import BIP32Key from bip32utils import BIP32_HARDEN from bip32utils import Base58 import os, bip39 strength_bits = 128 entropy = os.urandom(strength_bits // 8) wallet_generator = bip39.Mnemonic('english') mnemonic = wallet_generator.to_mnemonic(entropy) assert wallet_generator.to_entropy(mnemonic) == entropy # see, bijective! # Or specify the mnemonic directly if you prefer: mnemonic = 'aware report movie exile buyer drum poverty supreme gym oppose float elegant' passphrase = 'test' seed = bip39.Mnemonic.to_seed(mnemonic, passphrase=passphrase) key = BIP32Key.fromEntropy(seed) account_number = 0 i = 0 print key.ChildKey(44 + BIP32_HARDEN) \ .ChildKey(0 + BIP32_HARDEN) \ .ChildKey(account_number + BIP32_HARDEN) \
Comments
Post a Comment