Skip to main content

TaprootOps

Trait TaprootOps 

Source
pub trait TaprootOps {
    type PubKey;

    // Required methods
    fn parse_group_key(
        &self,
        key: &SerializedKey,
    ) -> Result<Self::PubKey, OpsError>;
    fn parse_internal_key(
        &self,
        key: &SerializedKey,
    ) -> Result<Self::PubKey, OpsError>;
    fn add_tweak(
        &self,
        pubkey: &Self::PubKey,
        tweak: [u8; 32],
    ) -> Result<Self::PubKey, OpsError>;
    fn taproot_output_key(
        &self,
        internal_key: &Self::PubKey,
        tapscript_root: Option<[u8; 32]>,
    ) -> Result<SerializedKey, OpsError>;
}
Expand description

Trait that supplies cryptographic operations needed by verifier core.

Required Associated Types§

Source

type PubKey

Backend-specific public key representation.

Required Methods§

Source

fn parse_group_key(&self, key: &SerializedKey) -> Result<Self::PubKey, OpsError>

Parses a raw group key into the backend representation.

Source

fn parse_internal_key( &self, key: &SerializedKey, ) -> Result<Self::PubKey, OpsError>

Parses an internal key into the backend representation.

Source

fn add_tweak( &self, pubkey: &Self::PubKey, tweak: [u8; 32], ) -> Result<Self::PubKey, OpsError>

Adds a scalar tweak to a public key.

Source

fn taproot_output_key( &self, internal_key: &Self::PubKey, tapscript_root: Option<[u8; 32]>, ) -> Result<SerializedKey, OpsError>

Computes the Taproot output key for an internal key and optional tapscript root.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§