Trait miniscript::miniscript::satisfy::Satisfier
source · [−]pub trait Satisfier<Pk: MiniscriptKey + ToPublicKey> {
fn lookup_sig(&self, _: &Pk) -> Option<BitcoinSig> { ... }
fn lookup_pkh_pk(&self, _: &Pk::Hash) -> Option<Pk> { ... }
fn lookup_pkh_sig(&self, _: &Pk::Hash) -> Option<(PublicKey, BitcoinSig)> { ... }
fn lookup_sha256(&self, _: Hash) -> Option<Preimage32> { ... }
fn lookup_hash256(&self, _: Hash) -> Option<Preimage32> { ... }
fn lookup_ripemd160(&self, _: Hash) -> Option<Preimage32> { ... }
fn lookup_hash160(&self, _: Hash) -> Option<Preimage32> { ... }
fn check_older(&self, _: u32) -> bool { ... }
fn check_after(&self, _: u32) -> 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
fn lookup_sig(&self, _: &Pk) -> Option<BitcoinSig>
fn lookup_sig(&self, _: &Pk) -> Option<BitcoinSig>
Given a public key, look up a signature with that key
fn lookup_pkh_pk(&self, _: &Pk::Hash) -> Option<Pk>
fn lookup_pkh_pk(&self, _: &Pk::Hash) -> Option<Pk>
Given a Pkh
, lookup corresponding Pk
fn lookup_pkh_sig(&self, _: &Pk::Hash) -> Option<(PublicKey, BitcoinSig)>
fn lookup_pkh_sig(&self, _: &Pk::Hash) -> Option<(PublicKey, BitcoinSig)>
Given a keyhash, look up the 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.
fn lookup_sha256(&self, _: Hash) -> Option<Preimage32>
fn lookup_sha256(&self, _: Hash) -> Option<Preimage32>
Given a SHA256 hash, look up its preimage
fn lookup_hash256(&self, _: Hash) -> Option<Preimage32>
fn lookup_hash256(&self, _: Hash) -> Option<Preimage32>
Given a HASH256 hash, look up its preimage
fn lookup_ripemd160(&self, _: Hash) -> Option<Preimage32>
fn lookup_ripemd160(&self, _: Hash) -> Option<Preimage32>
Given a RIPEMD160 hash, look up its preimage
fn lookup_hash160(&self, _: Hash) -> Option<Preimage32>
fn lookup_hash160(&self, _: Hash) -> Option<Preimage32>
Given a HASH160 hash, look up its preimage
fn check_older(&self, _: u32) -> bool
fn check_older(&self, _: u32) -> bool
Assert whether an relative locktime is satisfied
fn check_after(&self, _: u32) -> bool
fn check_after(&self, _: u32) -> bool
Assert whether a absolute locktime is satisfied