X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Ftypes.rs;h=c6fa5986764d4ec717ebc3b7489bf0da343d5724;hb=1d0c6c60c6802126b3b29d6a2aa026c1aa33db02;hp=d3eb20479bf3e32bd72bf8c55ff08d1e23b962f7;hpb=e818c4b13fcfc125dd3f3f1e86b49ddf299a85b4;p=rust-lightning diff --git a/lightning/src/ln/types.rs b/lightning/src/ln/types.rs index d3eb2047..c6fa5986 100644 --- a/lightning/src/ln/types.rs +++ b/lightning/src/ln/types.rs @@ -35,8 +35,6 @@ use core::ops::Deref; /// A _temporary_ ID is generated randomly. /// (Later revocation-point-based _v2_ is a possibility.) /// The variety (context) is not stored, it is relevant only at creation. -/// -/// This is not exported to bindings users as we just use [u8; 32] directly. #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] pub struct ChannelId(pub [u8; 32]); @@ -124,7 +122,8 @@ impl fmt::Display for ChannelId { } -/// payment_hash type, use to cross-lock hop +/// The payment hash is the hash of the [`PaymentPreimage`] which is the value used to lock funds +/// in HTLCs while they transit the lightning network. /// /// This is not exported to bindings users as we just use [u8; 32] directly #[derive(Hash, Copy, Clone, PartialEq, Eq, Debug, Ord, PartialOrd)] @@ -136,7 +135,8 @@ impl core::fmt::Display for PaymentHash { } } -/// payment_preimage type, use to route payment between hop +/// The payment preimage is the "secret key" which is used to claim the funds of an HTLC on-chain +/// or in a lightning channel. /// /// This is not exported to bindings users as we just use [u8; 32] directly #[derive(Hash, Copy, Clone, PartialEq, Eq, Debug, Ord, PartialOrd)] @@ -155,14 +155,14 @@ impl From for PaymentHash { } } -/// payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together +/// The payment secret is used to authenticate the sender of an HTLC to the recipient and tie +/// multi-part HTLCs together into a single payment. /// /// This is not exported to bindings users as we just use [u8; 32] directly #[derive(Hash, Copy, Clone, PartialEq, Eq, Debug, Ord, PartialOrd)] pub struct PaymentSecret(pub [u8; 32]); -use bitcoin::bech32; -use bitcoin::bech32::{Base32Len, FromBase32, ToBase32, WriteBase32, u5}; +use bech32::{Base32Len, FromBase32, ToBase32, WriteBase32, u5}; impl FromBase32 for PaymentSecret { type Err = bech32::Error;