Trait MiniscriptKey

Source
pub trait MiniscriptKey:
    Clone
    + Eq
    + Ord
    + Debug
    + Display
    + Hash {
    type Sha256: Clone + Eq + Ord + Display + Debug + Hash;
    type Hash256: Clone + Eq + Ord + Display + Debug + Hash;
    type Ripemd160: Clone + Eq + Ord + Display + Debug + Hash;
    type Hash160: Clone + Eq + Ord + Display + Debug + Hash;

    // Provided methods
    fn is_uncompressed(&self) -> bool { ... }
    fn is_x_only_key(&self) -> bool { ... }
}
Expand description

Public key trait which can be converted to Hash type

Required Associated Types§

Source

type Sha256: Clone + Eq + Ord + Display + Debug + Hash

The associated sha256::Hash for this MiniscriptKey, used in the hash256 fragment.

Source

type Hash256: Clone + Eq + Ord + Display + Debug + Hash

The associated hash256::Hash for this MiniscriptKey, used in the hash256 fragment.

Source

type Ripemd160: Clone + Eq + Ord + Display + Debug + Hash

The associated [ripedmd160::Hash] for this MiniscriptKey type. used in the ripemd160 fragment

Source

type Hash160: Clone + Eq + Ord + Display + Debug + Hash

The associated hash160::Hash for this MiniscriptKey type. used in the hash160 fragment

Provided Methods§

Source

fn is_uncompressed(&self) -> bool

Returns true if the pubkey is uncompressed. Defaults to false.

Source

fn is_x_only_key(&self) -> bool

Returns true if the pubkey is an x-only pubkey. Defaults to false.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl MiniscriptKey for String

Source§

impl MiniscriptKey for PublicKey

Source§

fn is_uncompressed(&self) -> bool

Returns the compressed-ness of the underlying secp256k1 key.

Source§

type Sha256 = Hash

Source§

type Hash256 = Hash

Source§

type Ripemd160 = Hash

Source§

type Hash160 = Hash

Source§

impl MiniscriptKey for PublicKey

Source§

impl MiniscriptKey for XOnlyPublicKey

Implementors§