pub struct ServerHtlcRecvVtxoPolicy {
pub user_pubkey: PublicKey,
pub payment_hash: PaymentHash,
pub htlc_expiry_delta: BlockDelta,
pub htlc_expiry: BlockHeight,
}Expand description
Policy enabling incoming Lightning payments.
This will build a taproot with 3 clauses:
-
The keyspend path allows Alice and Server to collaborate to spend the HTLC. This is the expected path to be used. Server should only accept to collaborate if Alice reveals the preimage.
-
The script-spend path contains one leaf that allows Server to spend the HTLC after the expiry, with an exit delta delay. Server can use this path if Alice tries to spend the HTLC using the 3rd path after the HTLC expiry
-
The second leaf allows Alice to spend the HTLC if she knows the preimage, but with a greater exit delta delay than server’s clause. Alice must use this path if she revealed the preimage but Server refused to collaborate.
Fields§
§user_pubkey: PublicKey§payment_hash: PaymentHash§htlc_expiry_delta: BlockDelta§htlc_expiry: BlockHeightImplementations§
Source§impl ServerHtlcRecvVtxoPolicy
impl ServerHtlcRecvVtxoPolicy
Sourcepub fn user_reveals_preimage_clause(
&self,
exit_delta: BlockDelta,
) -> HashDelaySignClause
pub fn user_reveals_preimage_clause( &self, exit_delta: BlockDelta, ) -> HashDelaySignClause
Allows Alice to spend the HTLC if she knows the preimage, but with a greater exit delta delay than server’s clause. Alice must use this path if she revealed the preimage but server refused to cosign claim VTXO.
Sourcepub fn server_claim_after_expiry_clause(
&self,
server_pubkey: PublicKey,
exit_delta: BlockDelta,
) -> DelayedTimelockSignClause
pub fn server_claim_after_expiry_clause( &self, server_pubkey: PublicKey, exit_delta: BlockDelta, ) -> DelayedTimelockSignClause
Allows Server to spend the HTLC after the HTLC expiry, with an exit delta delay. Server can use this path if Alice tries to spend the HTLC using her clause after the HTLC expiry.
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 ServerHtlcRecvVtxoPolicy
impl Clone for ServerHtlcRecvVtxoPolicy
Source§fn clone(&self) -> ServerHtlcRecvVtxoPolicy
fn clone(&self) -> ServerHtlcRecvVtxoPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerHtlcRecvVtxoPolicy
impl Debug for ServerHtlcRecvVtxoPolicy
Source§impl From<ServerHtlcRecvVtxoPolicy> for VtxoPolicy
impl From<ServerHtlcRecvVtxoPolicy> for VtxoPolicy
Source§fn from(policy: ServerHtlcRecvVtxoPolicy) -> Self
fn from(policy: ServerHtlcRecvVtxoPolicy) -> Self
Source§impl Hash for ServerHtlcRecvVtxoPolicy
impl Hash for ServerHtlcRecvVtxoPolicy
Source§impl Ord for ServerHtlcRecvVtxoPolicy
impl Ord for ServerHtlcRecvVtxoPolicy
Source§fn cmp(&self, other: &ServerHtlcRecvVtxoPolicy) -> Ordering
fn cmp(&self, other: &ServerHtlcRecvVtxoPolicy) -> 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 ServerHtlcRecvVtxoPolicy
impl PartialEq for ServerHtlcRecvVtxoPolicy
Source§impl PartialOrd for ServerHtlcRecvVtxoPolicy
impl PartialOrd for ServerHtlcRecvVtxoPolicy
impl Eq for ServerHtlcRecvVtxoPolicy
impl StructuralPartialEq for ServerHtlcRecvVtxoPolicy
Auto Trait Implementations§
impl Freeze for ServerHtlcRecvVtxoPolicy
impl RefUnwindSafe for ServerHtlcRecvVtxoPolicy
impl Send for ServerHtlcRecvVtxoPolicy
impl Sync for ServerHtlcRecvVtxoPolicy
impl Unpin for ServerHtlcRecvVtxoPolicy
impl UnwindSafe for ServerHtlcRecvVtxoPolicy
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.