pub trait ToPublicKey: MiniscriptKey {
    // Required methods
    fn to_public_key(&self) -> PublicKey;
    fn hash_to_hash160(hash: &<Self as MiniscriptKey>::Hash) -> Hash;

    // Provided method
    fn to_x_only_pubkey(&self) -> XOnlyPublicKey { ... }
}
Expand description

Trait describing public key types which can be converted to bitcoin pubkeys

Required Methods§

source

fn to_public_key(&self) -> PublicKey

Converts an object to a public key

source

fn hash_to_hash160(hash: &<Self as MiniscriptKey>::Hash) -> Hash

Converts a hashed version of the public key to a hash160 hash.

This method must be consistent with to_public_key, in the sense that calling MiniscriptKey::to_pubkeyhash followed by this function should give the same result as calling to_public_key and hashing the result directly.

Provided Methods§

source

fn to_x_only_pubkey(&self) -> XOnlyPublicKey

Convert an object to x-only pubkey

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ToPublicKey for PublicKey

source§

fn to_public_key(&self) -> PublicKey

source§

fn hash_to_hash160(hash: &Hash) -> Hash

source§

impl ToPublicKey for PublicKey

source§

fn to_public_key(&self) -> PublicKey

source§

fn hash_to_hash160(hash: &Hash) -> Hash

source§

impl ToPublicKey for XOnlyPublicKey

source§

fn to_public_key(&self) -> PublicKey

source§

fn to_x_only_pubkey(&self) -> XOnlyPublicKey

source§

fn hash_to_hash160(hash: &Hash) -> Hash

Implementors§