Exemplo n.º 1
0
 def _make_node_path(self, xpub, address_n):
     _, depth, fingerprint, child_num, chain_code, key = deserialize_xpub(xpub)
     node = HDNodeType(
         depth=depth,
         fingerprint=int.from_bytes(fingerprint, 'big'),
         child_num=int.from_bytes(child_num, 'big'),
         chain_code=chain_code,
         public_key=key,
     )
     return HDNodePathType(node=node, address_n=address_n)
Exemplo n.º 2
0
 def _make_node_path(self, xpub, address_n):
     bip32node = BIP32Node.from_xkey(xpub)
     node = HDNodeType(
         depth=bip32node.depth,
         fingerprint=int.from_bytes(bip32node.fingerprint, 'big'),
         child_num=int.from_bytes(bip32node.child_number, 'big'),
         chain_code=bip32node.chaincode,
         public_key=bip32node.eckey.get_public_key_bytes(compressed=True),
     )
     return HDNodePathType(node=node, address_n=address_n)
Exemplo n.º 3
0
 def _make_node_path(self, xpub, address_n):
     pubkey = bip32_key_from_string(xpub)
     derivation = pubkey.derivation()
     node = HDNodeType(
         depth=derivation.depth,
         fingerprint=be_bytes_to_int(pubkey.fingerprint()),
         child_num=derivation.n,
         chain_code=derivation.chain_code,
         public_key=pubkey.to_bytes(),
     )
     return HDNodePathType(node=node, address_n=address_n)