pub struct VhtlcOptions {
pub sender: XOnlyPublicKey,
pub receiver: XOnlyPublicKey,
pub server: XOnlyPublicKey,
pub preimage_hash: Hash,
pub refund_locktime: u32,
pub unilateral_claim_delay: Sequence,
pub unilateral_refund_delay: Sequence,
pub unilateral_refund_without_receiver_delay: Sequence,
}Expand description
Options for creating a VHTLC (Virtual Hash Time Lock Contract)
This structure contains all the necessary parameters to construct a VHTLC, including the public keys of participants and various timeout values.
Fields§
§sender: XOnlyPublicKey§receiver: XOnlyPublicKey§server: XOnlyPublicKey§preimage_hash: Hash§refund_locktime: u32§unilateral_claim_delay: Sequence§unilateral_refund_delay: Sequence§unilateral_refund_without_receiver_delay: SequenceImplementations§
Source§impl VhtlcOptions
impl VhtlcOptions
pub fn validate(&self) -> Result<(), VhtlcError>
Sourcepub fn claim_script(&self) -> ScriptBuf
pub fn claim_script(&self) -> ScriptBuf
Creates the claim script where receiver reveals the preimage
Requires: preimage hash verification + receiver signature + server signature
Sourcepub fn refund_script(&self) -> ScriptBuf
pub fn refund_script(&self) -> ScriptBuf
Creates the collaborative refund script
Requires: sender + receiver + server signatures
Sourcepub fn refund_without_receiver_script(&self) -> ScriptBuf
pub fn refund_without_receiver_script(&self) -> ScriptBuf
Creates the refund script when receiver is unavailable
Requires: CLTV timeout + sender + server signatures
Sourcepub fn unilateral_claim_script(&self) -> ScriptBuf
pub fn unilateral_claim_script(&self) -> ScriptBuf
Creates the unilateral claim script (no server cooperation needed)
Requires: preimage hash verification + CSV delay + receiver signature
Sourcepub fn unilateral_refund_script(&self) -> ScriptBuf
pub fn unilateral_refund_script(&self) -> ScriptBuf
Creates the unilateral refund script
Requires: CSV delay + sender + receiver signatures
Sourcepub fn unilateral_refund_without_receiver_script(&self) -> ScriptBuf
pub fn unilateral_refund_without_receiver_script(&self) -> ScriptBuf
Creates the unilateral refund script when receiver is unavailable
Requires: CSV delay + sender signature
Trait Implementations§
Source§impl Clone for VhtlcOptions
impl Clone for VhtlcOptions
Source§fn clone(&self) -> VhtlcOptions
fn clone(&self) -> VhtlcOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VhtlcOptions
impl Debug for VhtlcOptions
Source§impl<'de> Deserialize<'de> for VhtlcOptions
impl<'de> Deserialize<'de> for VhtlcOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for VhtlcOptions
impl PartialEq for VhtlcOptions
Source§fn eq(&self, other: &VhtlcOptions) -> bool
fn eq(&self, other: &VhtlcOptions) -> bool
self and other values to be equal, and is used by ==.