Trait Satisfier

Source
pub trait Satisfier<Pk: ToXOnlyPubkey> {
    // Provided methods
    fn lookup_tap_leaf_script_sig(
        &self,
        _: &Pk,
        _: &TapLeafHash,
    ) -> Option<SchnorrSig> { ... }
    fn lookup_sha256(&self, _: &Pk::Sha256) -> Option<Preimage32> { ... }
    fn check_older(&self, _: Sequence) -> bool { ... }
    fn check_after(&self, _: LockTime) -> bool { ... }
    fn lookup_asm_program(&self, _: Cmr) -> Option<Arc<ConstructNode<Elements>>> { ... }
}
Expand description

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§

Source

fn lookup_tap_leaf_script_sig( &self, _: &Pk, _: &TapLeafHash, ) -> Option<SchnorrSig>

Given a public key, look up a Schnorr signature with that key.

Source

fn lookup_sha256(&self, _: &Pk::Sha256) -> Option<Preimage32>

Given a SHA256 hash, look up its preimage.

Source

fn check_older(&self, _: Sequence) -> bool

Assert that a relative lock time is satisfied.

Source

fn check_after(&self, _: LockTime) -> bool

Assert that an absolute lock time is satisfied.

Source

fn lookup_asm_program(&self, _: Cmr) -> Option<Arc<ConstructNode<Elements>>>

Given a CMR, look up a matching assembly program.

§Successful execution

It is the responsibility of the implementor to ensure that the returned assembly program has sufficient witness data to successfully run on the Bit Machine.

The execution of a program depends on the transaction environment, so implementations should compute witness data based on that.

If the assembly program fails to run for the current transaction environment, then implementations should return None.

Implementations on Foreign Types§

Source§

impl<Pk: ToXOnlyPubkey> Satisfier<Pk> for LockTime

Source§

impl<Pk: ToXOnlyPubkey> Satisfier<Pk> for Sequence

Implementors§