Skip to content
/ pyhd Public

A simple library for hierarchically deterministic (HD) keys

License

Notifications You must be signed in to change notification settings

juanmera/pyhd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyHD

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.

Usage

BIP32

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()

BIP44

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()

Requirements

About

A simple library for hierarchically deterministic (HD) keys

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages