Generate public keys from Extended Public Key in python

I’d like to get a regular public key from an extended public key in Python. Actually I want to get the same result over here In the Extended Public Key Children section. I know I need this structure:

child_public_key = parent_public_key + point(lefthand_hash_output)

I used this to get the left hand hash:

         0x00 not sure if I need this                                         Index
         --                                                                  --------             

h = chain_code.encode("utf-8"),pub_key.encode("utf-8"), hashlib.sha512 ).digest()

But now I don’t know how to do this point(lefthand_hash_output).

I also tried this, but I get an error

seed=b'...' # replaced with the seed
root_key = bip32utils.BIP32Key.fromEntropy(seed)
root_public_hex = root_key.PublicKey().hex()
key=bip32utils.BIP32Key.CKDpub((root_public_hex) ,0)

The sample code could be very useful. Thanks in advance!

Source link

Related Posts