本文整理汇总了Python中mnemonic.Mnemonic.mnemonic_to_seed方法的典型用法代码示例。如果您正苦于以下问题:Python Mnemonic.mnemonic_to_seed方法的具体用法?Python Mnemonic.mnemonic_to_seed怎么用?Python Mnemonic.mnemonic_to_seed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mnemonic.Mnemonic
的用法示例。
在下文中一共展示了Mnemonic.mnemonic_to_seed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: from_seed
# 需要导入模块: from mnemonic import Mnemonic [as 别名]
# 或者: from mnemonic.Mnemonic import mnemonic_to_seed [as 别名]
def from_seed(seed, passphrase):
t = seed_type(seed)
if t == 'old':
keystore = Old_KeyStore({})
keystore.add_seed(seed)
elif t in ['standard', 'segwit']:
keystore = BIP32_KeyStore({})
keystore.add_seed(seed)
keystore.passphrase = passphrase
bip32_seed = Mnemonic.mnemonic_to_seed(seed, passphrase)
xtype = 0 if t == 'standard' else 1
keystore.add_xprv_from_seed(bip32_seed, xtype, "m/")
return keystore
示例2: xkeys_from_seed
# 需要导入模块: from mnemonic import Mnemonic [as 别名]
# 或者: from mnemonic.Mnemonic import mnemonic_to_seed [as 别名]
def xkeys_from_seed(seed, passphrase, derivation):
from mnemonic import Mnemonic
xprv, xpub = bip32_root(Mnemonic.mnemonic_to_seed(seed, passphrase), 0)
xprv, xpub = bip32_private_derivation(xprv, "m/", derivation)
return xprv, xpub