A simple library for hierarchically deterministic (HD) keys that implements BIP32, (partially) BIP39 and BIP44.
The objective is to have address management in a single package.
from hd.bip32 import PrivateKey
mnemonic = b'yellow yellow yellow'
master_key = PrivateKey.from_mnemonic(mnemonic)
wallet_key = master_key.child_path('m/44H/0H')
first_account_key = wallet_key.child(0, True)
first_account_change_key = first_account_key.child(0)
first_address_key = first_account_change_key.child(0)
private_address = first_address_key.encode()
public_address = first_address_key.public().encode()
from hd.bip44 import BitcoinWallet
mnemonic = b'yellow yellow yellow'
wallet = BitcoinWallet.from_mnemonic(mnemonic)
# wallet.set_account(0) # The account 0 is set by default
first_address_key = wallet.address(0)
private_address = first_address_key.encode()
public_address = first_address_key.public().encode()