Struct HtlcKey
pub struct HtlcKey(pub PublicKey);Expand description
A derived key built from a HtlcBasepoint and per_commitment_point.
HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC preimage and that only the sender of an HTLC can claim it on-chain after it has timed out. Thus, both channel counterparties’ HTLC keys will appears in each HTLC output’s script.
[See the BOLT specs] https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation for more information on key derivation details.
Tuple Fields§
§0: PublicKeyImplementations§
§impl HtlcKey
impl HtlcKey
pub fn from_basepoint<T>(
secp_ctx: &Secp256k1<T>,
countersignatory_basepoint: &HtlcBasepoint,
per_commitment_point: &PublicKey,
) -> HtlcKeywhere
T: Signing,
pub fn from_basepoint<T>(
secp_ctx: &Secp256k1<T>,
countersignatory_basepoint: &HtlcBasepoint,
per_commitment_point: &PublicKey,
) -> HtlcKeywhere
T: Signing,
Derive a public htlcpubkey using one node’s per_commitment_point and its countersignatory’s basepoint
pub fn from_secret_key<T>(secp_ctx: &Secp256k1<T>, sk: &SecretKey) -> HtlcKeywhere
T: Signing,
pub fn from_secret_key<T>(secp_ctx: &Secp256k1<T>, sk: &SecretKey) -> HtlcKeywhere
T: Signing,
Build a htlcpubkey directly from an already-derived private key
pub fn to_public_key(&self) -> PublicKey
pub fn to_public_key(&self) -> PublicKey
Get inner Public Key
Trait Implementations§
§impl Writeable for HtlcKey
impl Writeable for HtlcKey
impl Copy for HtlcKey
impl Eq for HtlcKey
impl StructuralPartialEq for HtlcKey
Auto Trait Implementations§
impl Freeze for HtlcKey
impl RefUnwindSafe for HtlcKey
impl Send for HtlcKey
impl Sync for HtlcKey
impl Unpin for HtlcKey
impl UnwindSafe for HtlcKey
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request