diff --git a/src/util/key.rs b/src/util/key.rs index 52f72a10..b295c6a7 100644 --- a/src/util/key.rs +++ b/src/util/key.rs @@ -296,6 +296,12 @@ impl FromStr for PublicKey { } } +impl From for PubkeyHash { + fn from(key: PublicKey) -> PubkeyHash { + key.pubkey_hash() + } +} + /// A Bitcoin ECDSA private key #[derive(Copy, Clone, PartialEq, Eq)] #[cfg_attr(feature = "std", derive(Debug))]