def checkPassphrase(line): passw = "" seed = util.bh2u(keystore.bip39_to_seed(line, passw)) seed = util.bfh(seed) xprv, _xpub = bitcoin.bip32_root(seed, "standard") xprv, _xpub = bitcoin.bip32_private_derivation(xprv, "", "44'") xprv, _xpub = bitcoin.bip32_private_derivation(xprv, "", "0'") xprv, _xpub = bitcoin.bip32_private_derivation(xprv, "", "0'") xprv, _xpub = bitcoin.bip32_private_derivation(xprv, "", "0") xprv2, btc_addr = bip39(seed, xprv, 0) return xprv2, btc_addr
def checkPassphrase(line): passw = "" seed = util.bh2u(keystore.bip39_to_seed(line, passw)) seed = util.bfh(seed) xprv, _xpub = bitcoin.bip32_root(seed, "standard") xprv, _xpub = bitcoin.bip32_private_derivation(xprv, "", "44'") xprv, _xpub = bitcoin.bip32_private_derivation(xprv, "", "0'") xprv, _xpub = bitcoin.bip32_private_derivation(xprv, "", "0'") xprv, _xpub = bitcoin.bip32_private_derivation(xprv, "", "0") for i in range(MAX_ADDR_IDX): deriveAddresses(line, xprv, i)
def add_xprv_from_seed(self, bip32_seed, derivation): xprv, xpub = bip32_root(bip32_seed) xprv, xpub = bip32_private_derivation(xprv, "m/", derivation) self.add_xprv(xprv)
def add_xprv_from_seed(self, bip32_seed, xtype, derivation): xprv, xpub = bip32_root(bip32_seed, xtype) xprv, xpub = bip32_private_derivation(xprv, "m/", derivation) self.add_xprv(xprv)
def xpub_from_seed(seed): # store only master xpub xprv, xpub = bip32_root(Mnemonic.mnemonic_to_seed(seed,'')) return from_xpub(xpub)
def xprv_from_seed(seed): # do not store the seed, only the master xprv xprv, xpub = bip32_root(Mnemonic.mnemonic_to_seed(seed, '')) return from_xprv(xprv)
def add_seed_and_xprv(self, seed, password, passphrase=''): xprv, xpub = bip32_root(self.mnemonic_to_seed(seed, passphrase)) xprv, xpub = bip32_private_derivation(xprv, "m/", self.root_derivation) self.add_seed(seed, password) self.add_master_private_key(xprv, password) self.add_master_public_key(xpub)