Skip to content

Commit

Permalink
Docs for HTLC spend path enum.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff committed Feb 13, 2024
1 parent 2256f27 commit e9fb8d8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tuxedo-core/src/verifier/htlc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,21 @@ pub struct HashTimeLockContract {
pub refunder_pubkey: Public,
}

///
/// This is the redeemer information needed to spend a `HashTimeLockContract` verifier.
///
/// The `HashTimeLockContract` has two spend paths, and therefore this enum has two variants.
/// The variant selects the spend path and contains the corresponding witness data.
#[derive(Serialize, Deserialize, Encode, Decode, Debug, PartialEq, Eq, Clone)]
pub enum HtlcSpendPath {
///
/// The primary spend path is for the recipient to claim the UTXO by revealing the
/// hash preimage as well as a signature.
Claim {
secret: Vec<u8>,
signature: Signature,
},
///
/// The secondary spend path is for the original owner to refund their money to their private
/// ownership. This path is not enabled until the enough time has elapsed. Once the time has
/// elapsed, only the refunder's signature is required.
Refund { signature: Signature },
}

Expand Down

0 comments on commit e9fb8d8

Please sign in to comment.