diff --git a/src/key.rs b/src/key.rs index 8c0f0a0..09a4e49 100644 --- a/src/key.rs +++ b/src/key.rs @@ -650,6 +650,12 @@ impl KeyPair { Ok(()) } } + + /// Gets the [XOnlyPublicKey] for this [KeyPair]. + #[inline] + pub fn public_key(&self) -> XOnlyPublicKey { + XOnlyPublicKey::from_keypair(self) + } } impl From for SecretKey {