pub struct HarkLeafVtxoPolicy {
pub user_pubkey: PublicKey,
pub unlock_hash: UnlockHash,
}Expand description
Policy for hArk leaf outputs (intermediate outputs spent by leaf txs).
These are the outputs that feed into the final leaf transactions in a signed VTXO tree. They are locked by:
- An expiry clause allowing the server to sweep after expiry
- An unlock clause requiring a preimage and a signature from user+server
The internal key is set to the MuSig of user’s VTXO key + server pubkey.
Fields§
§user_pubkey: PublicKey§unlock_hash: UnlockHashImplementations§
Source§impl HarkLeafVtxoPolicy
impl HarkLeafVtxoPolicy
Sourcepub fn expiry_clause(
&self,
expiry_height: BlockHeight,
server_pubkey: PublicKey,
) -> TimelockSignClause
pub fn expiry_clause( &self, expiry_height: BlockHeight, server_pubkey: PublicKey, ) -> TimelockSignClause
Creates the expiry clause allowing the server to sweep after expiry.
Sourcepub fn unlock_clause(&self, server_pubkey: PublicKey) -> HashSignClause
pub fn unlock_clause(&self, server_pubkey: PublicKey) -> HashSignClause
Creates the unlock clause requiring a preimage and aggregate signature.
Sourcepub fn clauses(
&self,
expiry_height: BlockHeight,
server_pubkey: PublicKey,
) -> Vec<VtxoClause>
pub fn clauses( &self, expiry_height: BlockHeight, server_pubkey: PublicKey, ) -> Vec<VtxoClause>
Returns the clauses for this policy.
Sourcepub fn taproot(
&self,
server_pubkey: PublicKey,
expiry_height: BlockHeight,
) -> TaprootSpendInfo
pub fn taproot( &self, server_pubkey: PublicKey, expiry_height: BlockHeight, ) -> TaprootSpendInfo
Build the taproot spend info for this policy.
Trait Implementations§
Source§impl Clone for HarkLeafVtxoPolicy
impl Clone for HarkLeafVtxoPolicy
Source§fn clone(&self) -> HarkLeafVtxoPolicy
fn clone(&self) -> HarkLeafVtxoPolicy
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 HarkLeafVtxoPolicy
impl Debug for HarkLeafVtxoPolicy
Source§impl From<HarkLeafVtxoPolicy> for ServerVtxoPolicy
impl From<HarkLeafVtxoPolicy> for ServerVtxoPolicy
Source§fn from(p: HarkLeafVtxoPolicy) -> Self
fn from(p: HarkLeafVtxoPolicy) -> Self
Converts to this type from the input type.
Source§impl Hash for HarkLeafVtxoPolicy
impl Hash for HarkLeafVtxoPolicy
Source§impl Ord for HarkLeafVtxoPolicy
impl Ord for HarkLeafVtxoPolicy
Source§fn cmp(&self, other: &HarkLeafVtxoPolicy) -> Ordering
fn cmp(&self, other: &HarkLeafVtxoPolicy) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for HarkLeafVtxoPolicy
impl PartialEq for HarkLeafVtxoPolicy
Source§impl PartialOrd for HarkLeafVtxoPolicy
impl PartialOrd for HarkLeafVtxoPolicy
impl Eq for HarkLeafVtxoPolicy
impl StructuralPartialEq for HarkLeafVtxoPolicy
Auto Trait Implementations§
impl Freeze for HarkLeafVtxoPolicy
impl RefUnwindSafe for HarkLeafVtxoPolicy
impl Send for HarkLeafVtxoPolicy
impl Sync for HarkLeafVtxoPolicy
impl Unpin for HarkLeafVtxoPolicy
impl UnwindSafe for HarkLeafVtxoPolicy
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
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
Compare self to
key and return true if they are equal.