def xfp_from_xpub(xpub): # sometime we need to BIP32 fingerprint value: 4 bytes of ripemd(sha256(pubkey)) # UNTESTED kk = bfh(Xpub.get_pubkey_from_xpub(xpub, [])) assert len(kk) == 33 xfp, = unpack('<I', hash_160(kk)[0:4]) return xfp
def get_password_for_storage_encryption(self) -> str: # note: using a different password based on hw device type is highly undesirable! see #5993 derivation = get_derivation_used_for_hw_device_encryption() xpub = self.get_xpub(derivation, "standard") password = Xpub.get_pubkey_from_xpub(xpub, ()).hex() return password