Trait MiniscriptKey

Source
pub trait MiniscriptKey:
    Clone
    + Eq
    + Ord
    + Debug
    + Display
    + Hash {
    type Hash: Clone + Eq + Ord + Display + Debug + Hash;

    // Required method
    fn to_pubkeyhash(&self) -> Self::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 Hash: Clone + Eq + Ord + Display + Debug + Hash

The associated Hash type with the publicKey

Required Methods§

Source

fn to_pubkeyhash(&self) -> Self::Hash

Converts an object to PublicHash

Provided Methods§

Source

fn is_uncompressed(&self) -> bool

Check if the publicKey is uncompressed. The default implementation returns false

Source

fn is_x_only_key(&self) -> bool

Check if the publicKey is x-only. The default implementation returns 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

is_uncompressed returns true only for bitcoin::Publickey type if the underlying key is uncompressed.

Source§

type Hash = Hash

Source§

fn to_pubkeyhash(&self) -> Self::Hash

Source§

impl MiniscriptKey for PublicKey

Source§

fn is_uncompressed(&self) -> bool

is_uncompressed always returns false

Source§

type Hash = Hash

Source§

fn to_pubkeyhash(&self) -> Self::Hash

Source§

impl MiniscriptKey for XOnlyPublicKey

Implementors§