Trait miniscript::ToPublicKey
source · pub trait ToPublicKey: MiniscriptKey {
// Required methods
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;
// Provided methods
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§
sourcefn to_public_key(&self) -> PublicKey
fn to_public_key(&self) -> PublicKey
Converts an object to a public key
sourcefn to_sha256(hash: &<Self as MiniscriptKey>::Sha256) -> Hash
fn to_sha256(hash: &<Self as MiniscriptKey>::Sha256) -> Hash
Converts the generic associated MiniscriptKey::Sha256
to sha256::Hash
sourcefn to_hash256(hash: &<Self as MiniscriptKey>::Hash256) -> Hash
fn to_hash256(hash: &<Self as MiniscriptKey>::Hash256) -> Hash
Converts the generic associated MiniscriptKey::Hash256
to hash256::Hash
sourcefn to_ripemd160(hash: &<Self as MiniscriptKey>::Ripemd160) -> Hash
fn to_ripemd160(hash: &<Self as MiniscriptKey>::Ripemd160) -> Hash
Converts the generic associated MiniscriptKey::Ripemd160
to ripemd160::Hash
sourcefn to_hash160(hash: &<Self as MiniscriptKey>::Hash160) -> Hash
fn to_hash160(hash: &<Self as MiniscriptKey>::Hash160) -> Hash
Converts the generic associated MiniscriptKey::Hash160
to hash160::Hash
Provided Methods§
sourcefn to_x_only_pubkey(&self) -> XOnlyPublicKey
fn to_x_only_pubkey(&self) -> XOnlyPublicKey
Convert an object to x-only pubkey
sourcefn to_pubkeyhash(&self, sig_type: SigType) -> Hash
fn to_pubkeyhash(&self, sig_type: SigType) -> Hash
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