bip39_mnemonic_decoder

Module for BIP39 mnemonic decoding. Reference: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki

class Bip39MnemonicDecoder(lang: Optional[Bip39Languages] = None)

Bases: MnemonicDecoderBase

BIP39 mnemonic decoder class. It decodes a mnemonic phrase to bytes.

Decode(mnemonic: Union[str, Mnemonic]) bytes

Decode a mnemonic phrase to bytes (no checksum).

Parameters:

mnemonic (str or Mnemonic object) – Mnemonic

Returns:

Decoded bytes (no checksum)

Return type:

bytes

Raises:
DecodeWithChecksum(mnemonic: Union[str, Mnemonic]) bytes

Decode a mnemonic phrase to bytes (with checksum).

Parameters:

mnemonic (str or Mnemonic object) – Mnemonic

Returns:

Decoded bytes (with checksum)

Return type:

bytes

Raises:
m_lang: Optional[MnemonicLanguages]
m_words_list: Optional[MnemonicWordsList]
m_words_list_finder_cls: Type[MnemonicWordsListFinderBase]