pub struct ServerHtlcSendVtxoPolicy {
pub user_pubkey: PublicKey,
pub payment_hash: PaymentHash,
pub htlc_expiry: BlockHeight,
}Expand description
Policy enabling outgoing Lightning payments.
This will build a taproot with 3 clauses:
-
The keyspend path allows Alice and Server to collaborate to spend the HTLC. The Server can use this path to revoke the HTLC if payment failed
-
The script-spend path contains one leaf that allows Server to spend the HTLC after the expiry, if it knows the preimage. Server can use this path if Alice tries to spend using her clause.
-
The second leaf allows Alice to spend the HTLC after its expiry and with a delay. Alice must use this path if the server fails to provide the preimage and refuse to revoke the HTLC. It will either force the Server to reveal the preimage (by spending using her clause) or give Alice her money back.
Fields§
§user_pubkey: PublicKey§payment_hash: PaymentHash§htlc_expiry: BlockHeightImplementations§
Source§impl ServerHtlcSendVtxoPolicy
impl ServerHtlcSendVtxoPolicy
Sourcepub fn server_reveals_preimage_clause(
&self,
server_pubkey: PublicKey,
exit_delta: BlockDelta,
) -> HashDelaySignClause
pub fn server_reveals_preimage_clause( &self, server_pubkey: PublicKey, exit_delta: BlockDelta, ) -> HashDelaySignClause
Allows Server to spend the HTLC after the delta, if it knows the preimage. Server can use this path if Alice tries to spend using her clause.
Sourcepub fn user_claim_after_expiry_clause(
&self,
exit_delta: BlockDelta,
) -> DelayedTimelockSignClause
pub fn user_claim_after_expiry_clause( &self, exit_delta: BlockDelta, ) -> DelayedTimelockSignClause
Allows Alice to spend the HTLC after its expiry and with a delay. Alice must use this path if the server fails to provide the preimage and refuse to revoke the HTLC. It will either force the server to reveal the preimage (by spending using its clause) or give Alice her money back.
pub fn clauses( &self, exit_delta: BlockDelta, server_pubkey: PublicKey, ) -> Vec<VtxoClause>
pub fn taproot( &self, server_pubkey: PublicKey, exit_delta: BlockDelta, ) -> TaprootSpendInfo
Trait Implementations§
Source§impl Clone for ServerHtlcSendVtxoPolicy
impl Clone for ServerHtlcSendVtxoPolicy
Source§fn clone(&self) -> ServerHtlcSendVtxoPolicy
fn clone(&self) -> ServerHtlcSendVtxoPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerHtlcSendVtxoPolicy
impl Debug for ServerHtlcSendVtxoPolicy
Source§impl From<ServerHtlcSendVtxoPolicy> for VtxoPolicy
impl From<ServerHtlcSendVtxoPolicy> for VtxoPolicy
Source§fn from(policy: ServerHtlcSendVtxoPolicy) -> Self
fn from(policy: ServerHtlcSendVtxoPolicy) -> Self
Source§impl Hash for ServerHtlcSendVtxoPolicy
impl Hash for ServerHtlcSendVtxoPolicy
Source§impl Ord for ServerHtlcSendVtxoPolicy
impl Ord for ServerHtlcSendVtxoPolicy
Source§fn cmp(&self, other: &ServerHtlcSendVtxoPolicy) -> Ordering
fn cmp(&self, other: &ServerHtlcSendVtxoPolicy) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ServerHtlcSendVtxoPolicy
impl PartialEq for ServerHtlcSendVtxoPolicy
Source§impl PartialOrd for ServerHtlcSendVtxoPolicy
impl PartialOrd for ServerHtlcSendVtxoPolicy
impl Eq for ServerHtlcSendVtxoPolicy
impl StructuralPartialEq for ServerHtlcSendVtxoPolicy
Auto Trait Implementations§
impl Freeze for ServerHtlcSendVtxoPolicy
impl RefUnwindSafe for ServerHtlcSendVtxoPolicy
impl Send for ServerHtlcSendVtxoPolicy
impl Sync for ServerHtlcSendVtxoPolicy
impl Unpin for ServerHtlcSendVtxoPolicy
impl UnwindSafe for ServerHtlcSendVtxoPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.