pub trait ToPublicKey: MiniscriptKey {
    fn to_public_key(&self) -> PublicKey;
    fn to_sha256(hash: &<Self as MiniscriptKey>::Sha256) -> Hash;
    fn to_hash256(hash: &<Self as MiniscriptKey>::Hash256) -> Hash;
    fn to_ripemd160(hash: &<Self as MiniscriptKey>::Ripemd160) -> Hash;
    fn to_hash160(hash: &<Self as MiniscriptKey>::Hash160) -> Hash;

    fn to_x_only_pubkey(&self) -> XOnlyPublicKey { ... }
    fn to_pubkeyhash(&self, sig_type: SigType) -> Hash { ... }
}
Expand description

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

Required Methods

Converts an object to a public key

Converts the generic associated MiniscriptKey::Sha256 to [sha256::Hash]

Converts the generic associated MiniscriptKey::Hash256 to hash256::Hash

Converts the generic associated MiniscriptKey::Ripemd160 to [ripemd160::Hash]

Converts the generic associated MiniscriptKey::Hash160 to [hash160::Hash]

Provided Methods

Convert an object to x-only pubkey

Obtain the public key hash for this MiniscriptKey Expects an argument to specify the signature type. This would determine whether to serialize the key as 32 byte x-only pubkey or regular public key when computing the hash160

Implementations on Foreign Types

Implementors