pub struct Assets {
pub keys: BTreeSet<(KeySource, CanSign)>,
pub sha256_preimages: BTreeSet<Hash>,
pub hash256_preimages: BTreeSet<Hash>,
pub ripemd160_preimages: BTreeSet<Hash>,
pub hash160_preimages: BTreeSet<Hash>,
pub absolute_timelock: Option<LockTime>,
pub relative_timelock: Option<LockTime>,
}Expand description
The Assets we can use to satisfy a particular spending path
Fields§
§keys: BTreeSet<(KeySource, CanSign)>Keys the user can sign for, and how. A pair (fingerprint, derivation_path) is
provided, meaning that the user can sign using the key with fingerprint,
derived with either derivation_path or a derivation path that extends derivation_path
by exactly one child number. For example, if the derivation path m/0/1 is provided, the
user can sign with either m/0/1 or m/0/1/*.
sha256_preimages: BTreeSet<Hash>Set of available sha256 preimages
hash256_preimages: BTreeSet<Hash>Set of available hash256 preimages
ripemd160_preimages: BTreeSet<Hash>Set of available ripemd160 preimages
hash160_preimages: BTreeSet<Hash>Set of available hash160 preimages
absolute_timelock: Option<LockTime>Maximum absolute timelock allowed
relative_timelock: Option<LockTime>Maximum relative timelock allowed
Implementations§
Trait Implementations§
Source§impl AssetProvider<DefiniteDescriptorKey> for Assets
impl AssetProvider<DefiniteDescriptorKey> for Assets
Source§fn provider_lookup_ecdsa_sig(&self, pk: &DefiniteDescriptorKey) -> bool
fn provider_lookup_ecdsa_sig(&self, pk: &DefiniteDescriptorKey) -> bool
Given a public key, look up an ECDSA signature with that key, return whether we found it
Source§fn provider_lookup_tap_key_spend_sig(
&self,
pk: &DefiniteDescriptorKey,
) -> Option<usize>
fn provider_lookup_tap_key_spend_sig( &self, pk: &DefiniteDescriptorKey, ) -> Option<usize>
Lookup the tap key spend sig and return its size
Source§fn provider_lookup_tap_leaf_script_sig(
&self,
pk: &DefiniteDescriptorKey,
tap_leaf_hash: &TapLeafHash,
) -> Option<usize>
fn provider_lookup_tap_leaf_script_sig( &self, pk: &DefiniteDescriptorKey, tap_leaf_hash: &TapLeafHash, ) -> Option<usize>
Given a public key and a associated leaf hash, look up a schnorr signature with that key
and return its size
Source§fn provider_lookup_sha256(&self, hash: &Hash) -> bool
fn provider_lookup_sha256(&self, hash: &Hash) -> bool
Given a SHA256 hash, look up its preimage, return whether we found it
Source§fn provider_lookup_hash256(&self, hash: &Hash) -> bool
fn provider_lookup_hash256(&self, hash: &Hash) -> bool
Given a HASH256 hash, look up its preimage, return whether we found it
Source§fn provider_lookup_ripemd160(&self, hash: &Hash) -> bool
fn provider_lookup_ripemd160(&self, hash: &Hash) -> bool
Given a RIPEMD160 hash, look up its preimage, return whether we found it
Source§fn provider_lookup_hash160(&self, hash: &Hash) -> bool
fn provider_lookup_hash160(&self, hash: &Hash) -> bool
Given a HASH160 hash, look up its preimage, return whether we found it
Source§fn check_older(&self, s: LockTime) -> bool
fn check_older(&self, s: LockTime) -> bool
Assert whether a relative locktime is satisfied
Source§fn check_after(&self, l: LockTime) -> bool
fn check_after(&self, l: LockTime) -> bool
Assert whether an absolute locktime is satisfied
Source§fn provider_lookup_tap_control_block_map(
&self,
) -> Option<&BTreeMap<ControlBlock, (ScriptBuf, LeafVersion)>>
fn provider_lookup_tap_control_block_map( &self, ) -> Option<&BTreeMap<ControlBlock, (ScriptBuf, LeafVersion)>>
Obtain a reference to the control block for a ver and script
Source§fn provider_lookup_raw_pkh_pk(&self, _: &Hash) -> Option<PublicKey>
fn provider_lookup_raw_pkh_pk(&self, _: &Hash) -> Option<PublicKey>
Given a raw
Pkh, lookup corresponding bitcoin::PublicKeySource§fn provider_lookup_raw_pkh_x_only_pk(&self, _: &Hash) -> Option<XOnlyPublicKey>
fn provider_lookup_raw_pkh_x_only_pk(&self, _: &Hash) -> Option<XOnlyPublicKey>
Given a raw
Pkh, lookup corresponding [bitcoin::secp256k1::XOnlyPublicKey]Source§fn provider_lookup_raw_pkh_ecdsa_sig(&self, _: &Hash) -> Option<PublicKey>
fn provider_lookup_raw_pkh_ecdsa_sig(&self, _: &Hash) -> Option<PublicKey>
Given a keyhash, look up the EC signature and the associated key.
Returns the key if a signature is found.
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.
Source§fn provider_lookup_raw_pkh_tap_leaf_script_sig(
&self,
_: &(Hash, TapLeafHash),
) -> Option<(XOnlyPublicKey, usize)>
fn provider_lookup_raw_pkh_tap_leaf_script_sig( &self, _: &(Hash, TapLeafHash), ) -> Option<(XOnlyPublicKey, usize)>
Given a keyhash, look up the schnorr signature and the associated key.
Returns the key and sig len if a signature is found.
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.
Source§impl FromIterator<DescriptorPublicKey> for Assets
impl FromIterator<DescriptorPublicKey> for Assets
Source§fn from_iter<I: IntoIterator<Item = DescriptorPublicKey>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = DescriptorPublicKey>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl IntoAssets for Assets
impl IntoAssets for Assets
Source§fn into_assets(self) -> Assets
fn into_assets(self) -> Assets
Convert
self into a Assets structAuto Trait Implementations§
impl Freeze for Assets
impl RefUnwindSafe for Assets
impl Send for Assets
impl Sync for Assets
impl Unpin for Assets
impl UnwindSafe for Assets
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more