bip32: why can't private ExtendedKey instances convert to `ExtendedPublicKeys` with `TryFrom`?
pezcore opened this issue · comments
pezcore commented
It seems that only public ExtendedKey
instances can be converted to ExtendedPublicKey
instances with TryFrom<ExtendedKey> for ExtendedPublicKey<K>
. Why is that? Shouldn't ExtendedPublicKey::try_from()
compute the public key even when the given ExtendedKey
is private instead of returning Err(Crypto)
, because this conversion is cheap, unambiguous, and convenient for the user?
Tony Arcieri (iqlusion) commented
When the secp256k1
feature is enabled (which it is by default), it could compute the public key from the private key, yes.
PRs accepted to add this, or I will get around to implementing it eventually.