Closed l0rb closed 7 years ago
Looking into it right now
The serialize_key
method is not intended to create regular keys from extended keys. It is defined in the ExtendedKey
abstract class so that child classes have to implement a method which serialises them in the format expected by extended serialisation. serialize_key()
should probably be made private.
What you are trying to achieve is supposed to be done as follows:
ExtendedPrivateKey.decode(rootkey).pub() # this returns the corresponding ExtendedPublicKey
ExtendedPrivateKey.decode(rootkey).pub().key # this returns the corresponding PublicKey
I see. Tanks for the prompt response and clarification!
Made serialize_key()
and serialized_public()
private in 2729f24.
When creating a PrivateKey from the output of serialize_key() on ExtendedPrivateKey the leading zeros that this data has break the pub() function on the PrivateKey. Code example below: