Trait miniscript::miniscript::satisfy::Satisfier
source · pub trait Satisfier<Pk: MiniscriptKey + ToPublicKey> {
Show 14 methods
// Provided methods
fn lookup_ecdsa_sig(&self, _: &Pk) -> Option<Signature> { ... }
fn lookup_tap_key_spend_sig(&self) -> Option<Signature> { ... }
fn lookup_tap_leaf_script_sig(
&self,
_: &Pk,
_: &TapLeafHash
) -> Option<Signature> { ... }
fn lookup_tap_control_block_map(
&self
) -> Option<&BTreeMap<ControlBlock, (ScriptBuf, LeafVersion)>> { ... }
fn lookup_raw_pkh_pk(&self, _: &Hash) -> Option<PublicKey> { ... }
fn lookup_raw_pkh_x_only_pk(&self, _: &Hash) -> Option<XOnlyPublicKey> { ... }
fn lookup_raw_pkh_ecdsa_sig(
&self,
_: &Hash
) -> Option<(PublicKey, Signature)> { ... }
fn lookup_raw_pkh_tap_leaf_script_sig(
&self,
_: &(Hash, TapLeafHash)
) -> Option<(XOnlyPublicKey, Signature)> { ... }
fn lookup_sha256(&self, _: &Pk::Sha256) -> Option<Preimage32> { ... }
fn lookup_hash256(&self, _: &Pk::Hash256) -> Option<Preimage32> { ... }
fn lookup_ripemd160(&self, _: &Pk::Ripemd160) -> Option<Preimage32> { ... }
fn lookup_hash160(&self, _: &Pk::Hash160) -> Option<Preimage32> { ... }
fn check_older(&self, _: LockTime) -> bool { ... }
fn check_after(&self, _: LockTime) -> bool { ... }
}
Expand description
Trait describing a lookup table for signatures, hash preimages, etc.
Every method has a default implementation that simply returns None
on every query. Users are expected to override the methods that they
have data for.
Provided Methods§
sourcefn lookup_ecdsa_sig(&self, _: &Pk) -> Option<Signature>
fn lookup_ecdsa_sig(&self, _: &Pk) -> Option<Signature>
Given a public key, look up an ECDSA signature with that key
sourcefn lookup_tap_key_spend_sig(&self) -> Option<Signature>
fn lookup_tap_key_spend_sig(&self) -> Option<Signature>
Lookup the tap key spend sig
sourcefn lookup_tap_leaf_script_sig(
&self,
_: &Pk,
_: &TapLeafHash
) -> Option<Signature>
fn lookup_tap_leaf_script_sig( &self, _: &Pk, _: &TapLeafHash ) -> Option<Signature>
Given a public key and a associated leaf hash, look up an schnorr signature with that key
sourcefn lookup_tap_control_block_map(
&self
) -> Option<&BTreeMap<ControlBlock, (ScriptBuf, LeafVersion)>>
fn lookup_tap_control_block_map( &self ) -> Option<&BTreeMap<ControlBlock, (ScriptBuf, LeafVersion)>>
Obtain a reference to the control block for a ver and script
sourcefn lookup_raw_pkh_pk(&self, _: &Hash) -> Option<PublicKey>
fn lookup_raw_pkh_pk(&self, _: &Hash) -> Option<PublicKey>
Given a raw Pkh
, lookup corresponding bitcoin::PublicKey
sourcefn lookup_raw_pkh_x_only_pk(&self, _: &Hash) -> Option<XOnlyPublicKey>
fn lookup_raw_pkh_x_only_pk(&self, _: &Hash) -> Option<XOnlyPublicKey>
Given a raw Pkh
, lookup corresponding bitcoin::secp256k1::XOnlyPublicKey
sourcefn lookup_raw_pkh_ecdsa_sig(&self, _: &Hash) -> Option<(PublicKey, Signature)>
fn lookup_raw_pkh_ecdsa_sig(&self, _: &Hash) -> Option<(PublicKey, Signature)>
Given a keyhash, look up the EC signature and the associated key Even if signatures for public key Hashes are not available, the users can use this map to provide pkh -> pk mapping which can be useful for dissatisfying pkh.
sourcefn lookup_raw_pkh_tap_leaf_script_sig(
&self,
_: &(Hash, TapLeafHash)
) -> Option<(XOnlyPublicKey, Signature)>
fn lookup_raw_pkh_tap_leaf_script_sig( &self, _: &(Hash, TapLeafHash) ) -> Option<(XOnlyPublicKey, Signature)>
Given a keyhash, look up the schnorr signature and the associated key Even if signatures for public key Hashes are not available, the users can use this map to provide pkh -> pk mapping which can be useful for dissatisfying pkh.
sourcefn lookup_sha256(&self, _: &Pk::Sha256) -> Option<Preimage32>
fn lookup_sha256(&self, _: &Pk::Sha256) -> Option<Preimage32>
Given a SHA256 hash, look up its preimage
sourcefn lookup_hash256(&self, _: &Pk::Hash256) -> Option<Preimage32>
fn lookup_hash256(&self, _: &Pk::Hash256) -> Option<Preimage32>
Given a HASH256 hash, look up its preimage
sourcefn lookup_ripemd160(&self, _: &Pk::Ripemd160) -> Option<Preimage32>
fn lookup_ripemd160(&self, _: &Pk::Ripemd160) -> Option<Preimage32>
Given a RIPEMD160 hash, look up its preimage
sourcefn lookup_hash160(&self, _: &Pk::Hash160) -> Option<Preimage32>
fn lookup_hash160(&self, _: &Pk::Hash160) -> Option<Preimage32>
Given a HASH160 hash, look up its preimage
sourcefn check_older(&self, _: LockTime) -> bool
fn check_older(&self, _: LockTime) -> bool
Assert whether an relative locktime is satisfied
NOTE: If a descriptor mixes time-based and height-based timelocks, the implementation of this method MUST only allow timelocks of either unit, but not both. Allowing both could cause miniscript to construct an invalid witness.
sourcefn check_after(&self, _: LockTime) -> bool
fn check_after(&self, _: LockTime) -> bool
Assert whether a absolute locktime is satisfied
NOTE: If a descriptor mixes time-based and height-based timelocks, the implementation of this method MUST only allow timelocks of either unit, but not both. Allowing both could cause miniscript to construct an invalid witness.