예제 #1
0
def is_xprv(text):
    if text[0:4] not in ('xpriv'):
        return False
    try:
        deserialize_xkey(text)
        return True
    except:
        return False
예제 #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
예제 #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()
예제 #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
예제 #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')