[][src]Trait miniscript::ToPublicKey

pub trait ToPublicKey<ToPkCtx: Copy>: MiniscriptKey {
    pub fn to_public_key(&self, to_pk_ctx: ToPkCtx) -> PublicKey;
pub fn hash_to_hash160(hash: &Self::Hash, to_pk_ctx: ToPkCtx) -> Hash; pub fn serialized_len(&self, to_pk_ctx: ToPkCtx) -> usize { ... } }

Trait describing public key types which can be converted to bitcoin pubkeys The trait relies on Copy trait because in all practical usecases ToPkCtx should contain references to objects which should be cheap to Copy.

Required methods

pub fn to_public_key(&self, to_pk_ctx: ToPkCtx) -> PublicKey[src]

Converts an object to a public key C represents additional context information that maybe required for deriving a bitcoin::PublicKey from MiniscriptKey You may require secp context for crypto operations or additional information for substituting the wildcard in extended pubkeys

pub fn hash_to_hash160(hash: &Self::Hash, to_pk_ctx: ToPkCtx) -> Hash[src]

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.

Loading content...

Provided methods

pub fn serialized_len(&self, to_pk_ctx: ToPkCtx) -> usize[src]

Computes the size of a public key when serialized in a script, including the length bytes

Loading content...

Implementations on Foreign Types

impl ToPublicKey<NullCtx> for PublicKey[src]

Loading content...

Implementors

impl ToPublicKey<NullCtx> for DummyKey[src]

impl<'secp, C: Verification> ToPublicKey<DescriptorPublicKeyCtx<'secp, C>> for DescriptorPublicKey[src]

Loading content...