Similar motivation for the first commit of #372
Add method KeyPair::public_key
Currently to get the XOnlyPublicKey from a KeyPair users must do
XOnlyPublicKey::from_keypair(&kp). While this does the job we can make
the lib more ergonomic by providing a method directly on KeyPair that
calls through to XOnlyPublicKey::from_keypair.
I think we should have more conversion methods
-
KeyPair:
- secret_key() -> SecretKey
- x_only_pub_key() -> XOnlyPublicKey
- pub_key() -> PublicKey See(389abdd#r831616364)
-
SecretKey:
- keypair() -> KeyPair
- x_only_pub_key() -> XOnlyPublicKey
- pub_key() -> PublicKey
-
XonlyPublicKey:
-
PublicKey:
- x_only_pub_key() -> (XonlyPublicKey, Parity)
I would like to call these methods pubkey instead of pub_key, but I think because of #372 (comment) it might be difficult.