Example #1
0
 def parse_xpubkey(self, x_pubkey):
     assert is_extended_pubkey(x_pubkey)
     pk = x_pubkey[2:]
     mpk = pk[0:128]
     dd = pk[128:]
     s = []
     while dd:
         n = int(util_coin.rev_hex(dd[0:4]), 16)
         dd = dd[4:]
         s.append(n)
     assert len(s) == 2
     return mpk, s
Example #2
0
 def parse_xpubkey(self, x_pubkey):
     assert is_extended_pubkey(x_pubkey)
     pk = x_pubkey[2:]
     mpk = pk[0:128]
     dd = pk[128:]
     s = []
     while dd:
         n = int(util_coin.rev_hex(dd[0:4]), 16)
         dd = dd[4:]
         s.append(n)
     assert len(s) == 2
     return mpk, s
Example #3
0
 def parse_xpubkey(self, pubkey):
     assert is_extended_pubkey(pubkey)
     pk = pubkey.decode('hex')
     pk = pk[1:]
     xkey = bitcoin.EncodeBase58Check(pk[0:78])
     dd = pk[78:]
     s = []
     while dd:
         n = int(util_coin.rev_hex(dd[0:2].encode('hex')), 16)
         dd = dd[2:]
         s.append(n)
     assert len(s) == 2
     return xkey, s
Example #4
0
 def parse_xpubkey(self, pubkey):
     assert is_extended_pubkey(pubkey)
     pk = pubkey.decode('hex')
     pk = pk[1:]
     xkey = bitcoin.EncodeBase58Check(pk[0:78])
     dd = pk[78:]
     s = []
     while dd:
         n = int(util_coin.rev_hex(dd[0:2].encode('hex')), 16)
         dd = dd[2:]
         s.append(n)
     assert len(s) == 2
     return xkey, s
Example #5
0
def rev_hex(s):
    """Deprecated."""
    return util_coin.rev_hex(s)
Example #6
0
def CKD_pub(cK, c, n):
    if n & BIP32_PRIME:
        raise
    return _CKD_pub(cK, c, util_coin.rev_hex(util_coin.int_to_hex(n, 4)).decode("hex"))
Example #7
0
def CKD_priv(k, c, n):
    is_prime = n & BIP32_PRIME
    return _CKD_priv(k, c, util_coin.rev_hex(util_coin.int_to_hex(n, 4)).decode("hex"), is_prime)