pypergraph.keystore.bip_helpers package

Submodules

pypergraph.keystore.bip_helpers.bip32_helper module

class pypergraph.keystore.bip_helpers.bip32_helper.Bip32Helper[source]

Bases: object

get_master_key_from_mnemonic(phrase: str, path="m/44'/1137'/0'/0")[source]
get_private_key_from_seed(seed: bytes, path="m/44'/1137'/0'/0")[source]

Derive the private key from a seed entropy using derived path.

Parameters:
  • seed – The seed in bytes format.

  • path – The derivation path.

Returns:

The private key as a hexadecimal string.

static get_public_key_from_private_hex(private_key: bytes) str[source]

Derive the public key from a private key using secp256k1.

Parameters:

private_key – The private key in hexadecimal format.

Returns:

The uncompressed public key as a hexadecimal string with 04 prefix.

static get_root_key_from_seed(seed: bytes)[source]

Derive the HD root/master key from a seed entropy in bytes format.

Parameters:

seed – The seed entropy in bytes format.

Returns:

The root/master key.

pypergraph.keystore.bip_helpers.bip32_helper.parse_path(path) Dict[source]

pypergraph.keystore.bip_helpers.bip39_helper module

class pypergraph.keystore.bip_helpers.bip39_helper.Bip39Helper(words: int = 12, language: str = 'english')[source]

Bases: object

Generate 12 or 24 words and derive entropy

LANGUAGES = ('english', 'chinese_simplified', 'chinese_traditional', 'french', 'italian', 'japanese', 'korean', 'spanish', 'turkish', 'czech', 'portuguese')
get_seed_from_mnemonic(phrase: str)[source]
mnemonic() str[source]
Returns:

Dictionary with Mnemonic object, mnemonic phrase, mnemonic seed, mnemonic entropy.

static validate_mnemonic(mnemonic_phrase: str, language: str = 'english')[source]

Module contents