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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl MiniscriptKey for String

§

type Hash = String

source§

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

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.

§

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

§

type Hash = Hash

source§

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

source§

impl MiniscriptKey for XOnlyPublicKey

§

type Hash = Hash

source§

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

source§

fn is_x_only_key(&self) -> bool

Implementors§