pub struct HashDelaySignClause {
pub pubkey: PublicKey,
pub hash: Hash,
pub block_delta: BlockDelta,
}Expand description
A clause that allows to sign and spend the UTXO after a relative timelock, if preimage matching the hash is provided.
Fields§
§pubkey: PublicKey§hash: Hash§block_delta: BlockDeltaImplementations§
Source§impl HashDelaySignClause
impl HashDelaySignClause
Sourcepub fn extract_preimage_from_witness(
witness: &Witness,
payment_hash: PaymentHash,
) -> Option<Preimage>
pub fn extract_preimage_from_witness( witness: &Witness, payment_hash: PaymentHash, ) -> Option<Preimage>
Try to extract the preimage from a witness that spends this clause.
Witness layout: [signature, preimage, tapscript, control_block].
Returns the preimage if it is 32 bytes and hashes to the given payment hash.
Trait Implementations§
Source§impl Clone for HashDelaySignClause
impl Clone for HashDelaySignClause
Source§fn clone(&self) -> HashDelaySignClause
fn clone(&self) -> HashDelaySignClause
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HashDelaySignClause
impl Debug for HashDelaySignClause
Source§impl Into<VtxoClause> for HashDelaySignClause
impl Into<VtxoClause> for HashDelaySignClause
Source§fn into(self) -> VtxoClause
fn into(self) -> VtxoClause
Converts this type into the (usually inferred) input type.
Source§impl TapScriptClause for HashDelaySignClause
impl TapScriptClause for HashDelaySignClause
Source§type WitnessData = (Signature, [u8; 32])
type WitnessData = (Signature, [u8; 32])
The type of witness data required to sign the clause.
Source§fn witness(
&self,
data: &Self::WitnessData,
control_block: &ControlBlock,
) -> Witness
fn witness( &self, data: &Self::WitnessData, control_block: &ControlBlock, ) -> Witness
Constructs the witness for the clause.
Source§fn witness_size<G, P: Policy>(&self, vtxo: &Vtxo<G, P>) -> usize
fn witness_size<G, P: Policy>(&self, vtxo: &Vtxo<G, P>) -> usize
Computes the total witness size in bytes for spending via this clause.
Source§fn control_block<G, P: Policy>(&self, vtxo: &Vtxo<G, P>) -> ControlBlock
fn control_block<G, P: Policy>(&self, vtxo: &Vtxo<G, P>) -> ControlBlock
Construct the taproot control block for spending the VTXO using this clause
Auto Trait Implementations§
impl Freeze for HashDelaySignClause
impl RefUnwindSafe for HashDelaySignClause
impl Send for HashDelaySignClause
impl Sync for HashDelaySignClause
impl Unpin for HashDelaySignClause
impl UnsafeUnpin for HashDelaySignClause
impl UnwindSafe for HashDelaySignClause
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