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§
Required Methods§
Sourcefn parse_group_key(&self, key: &SerializedKey) -> Result<Self::PubKey, OpsError>
fn parse_group_key(&self, key: &SerializedKey) -> Result<Self::PubKey, OpsError>
Parses a raw group key into the backend representation.
Sourcefn parse_internal_key(
&self,
key: &SerializedKey,
) -> Result<Self::PubKey, OpsError>
fn parse_internal_key( &self, key: &SerializedKey, ) -> Result<Self::PubKey, OpsError>
Parses an internal key into the backend representation.
Sourcefn add_tweak(
&self,
pubkey: &Self::PubKey,
tweak: [u8; 32],
) -> Result<Self::PubKey, OpsError>
fn add_tweak( &self, pubkey: &Self::PubKey, tweak: [u8; 32], ) -> Result<Self::PubKey, OpsError>
Adds a scalar tweak to a public key.
Sourcefn taproot_output_key(
&self,
internal_key: &Self::PubKey,
tapscript_root: Option<[u8; 32]>,
) -> Result<SerializedKey, OpsError>
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".