Exemple #1
0
def is_xprv(text):
    if text[0:4] not in ('xpriv'):
        return False
    try:
        deserialize_xkey(text)
        return True
    except:
        return False
Exemple #2
0
def is_xpub(text):
    if text[0:4] not in ('xpub', 'xq5h'):
        return False
    try:
        deserialize_xkey(text)
        return True
    except:
        return False
Exemple #3
0
 def check_password(self, password):
     xprv = pw_decode(self.xprv, password)
     if deserialize_xkey(xprv)[3] != deserialize_xkey(self.xpub)[3]:
         raise InvalidPassword()
Exemple #4
0
 def get_private_key(self, sequence, password):
     xprv = self.get_master_private_key(password)
     _, _, _, c, k = deserialize_xkey(xprv)
     pk = bip32_private_key(sequence, k, c)
     return pk
Exemple #5
0
 def get_pubkey_from_xpub(self, xpub, sequence):
     _, _, _, c, cK = deserialize_xkey(xpub)
     for i in sequence:
         cK, c = CKD_pub(cK, c, i)
     return cK.encode('hex')