diff --git a/src/lib.rs b/src/lib.rs index e0711c609..72bf80d03 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -150,17 +150,6 @@ use crate::prelude::*; /// Trait representing a key which can be converted to a hash type. pub trait MiniscriptKey: Clone + Eq + Ord + fmt::Debug + fmt::Display + hash::Hash { - /// Returns true if the key is serialized uncompressed, defaults to `false`. - fn is_uncompressed(&self) -> bool; - - /// Returns true if the key is an x-only pubkey, defaults to `false`. - fn is_x_only_key(&self) -> bool; - - /// Returns the number of different derivation paths in this key, defaults to `0`. - /// - /// Only >1 for keys in BIP389 multipath descriptors. - fn num_der_paths(&self) -> usize; - /// The type used in the sha256 fragment. type Sha256: Clone + Eq + Ord + fmt::Display + fmt::Debug + hash::Hash; @@ -172,6 +161,17 @@ pub trait MiniscriptKey: Clone + Eq + Ord + fmt::Debug + fmt::Display + hash::Ha /// The type used in the hash160 fragment. type Hash160: Clone + Eq + Ord + fmt::Display + fmt::Debug + hash::Hash; + + /// Returns true if the key is serialized uncompressed, defaults to `false`. + fn is_uncompressed(&self) -> bool; + + /// Returns true if the key is an x-only pubkey, defaults to `false`. + fn is_x_only_key(&self) -> bool; + + /// Returns the number of different derivation paths in this key, defaults to `0`. + /// + /// Only >1 for keys in BIP389 multipath descriptors. + fn num_der_paths(&self) -> usize; } impl MiniscriptKey for bitcoin::secp256k1::PublicKey {