pub trait Descriptor<Key> {
// Required methods
fn check_sanity(&self) -> Result<(), DeriveError>;
fn derive_pattern_len(&self) -> Result<usize, DeriveError>;
fn network(&self, regtest: bool) -> Result<Network, DeriveError>;
fn address<C: Verification>(
&self,
secp: &Secp256k1<C>,
pat: impl AsRef<[UnhardenedIndex]>,
regtest: bool,
) -> Result<AddressCompat, DeriveError>;
fn script_pubkey_pretr<C: Verification>(
&self,
secp: &Secp256k1<C>,
pat: impl AsRef<[UnhardenedIndex]>,
) -> Result<Script, DeriveError>;
fn script_pubkey_tr<C: Verification>(
&self,
secp: &Secp256k1<C>,
pat: impl AsRef<[UnhardenedIndex]>,
) -> Result<Script, DeriveError>;
}Expand description
Standard methods which should be supported by descriptors of different sorts.
Required Methods§
Sourcefn check_sanity(&self) -> Result<(), DeriveError>
fn check_sanity(&self) -> Result<(), DeriveError>
Checks sanity of the output descriptor (see DeriveError for the list
of possible inconsistencies).
Sourcefn derive_pattern_len(&self) -> Result<usize, DeriveError>
fn derive_pattern_len(&self) -> Result<usize, DeriveError>
Measures length of the derivation wildcard pattern accross all keys participating descriptor
Sourcefn network(&self, regtest: bool) -> Result<Network, DeriveError>
fn network(&self, regtest: bool) -> Result<Network, DeriveError>
Detects bitcoin network which should be used with the provided descriptor
Sourcefn address<C: Verification>(
&self,
secp: &Secp256k1<C>,
pat: impl AsRef<[UnhardenedIndex]>,
regtest: bool,
) -> Result<AddressCompat, DeriveError>
fn address<C: Verification>( &self, secp: &Secp256k1<C>, pat: impl AsRef<[UnhardenedIndex]>, regtest: bool, ) -> Result<AddressCompat, DeriveError>
Generates address from the descriptor for specific derive pattern
Sourcefn script_pubkey_pretr<C: Verification>(
&self,
secp: &Secp256k1<C>,
pat: impl AsRef<[UnhardenedIndex]>,
) -> Result<Script, DeriveError>
fn script_pubkey_pretr<C: Verification>( &self, secp: &Secp256k1<C>, pat: impl AsRef<[UnhardenedIndex]>, ) -> Result<Script, DeriveError>
Creates scriptPubkey for specific derive pattern in pre-taproot descriptors
Sourcefn script_pubkey_tr<C: Verification>(
&self,
secp: &Secp256k1<C>,
pat: impl AsRef<[UnhardenedIndex]>,
) -> Result<Script, DeriveError>
fn script_pubkey_tr<C: Verification>( &self, secp: &Secp256k1<C>, pat: impl AsRef<[UnhardenedIndex]>, ) -> Result<Script, DeriveError>
Creates scriptPubkey for specific derive pattern in taproot descriptors
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".