Struct lightning::ln::channel_keys::PaymentKey
source · pub struct PaymentKey(pub PublicKey);
Expand description
localpubkey is a child key of a payment basepoint, that enables a secure hash-lock for off-chain payments without risk of funds getting stuck or stolen. A payment key is normally shared with a counterparty so that it can generate a commitment transaction’s to_remote ouput, which our node can claim in case the counterparty force closes the channel.
Tuple Fields§
§0: PublicKey
Implementations§
source§impl PaymentKey
impl PaymentKey
sourcepub fn from_basepoint<T: Signing>(
secp_ctx: &Secp256k1<T>,
basepoint: &PaymentBasepoint,
per_commitment_point: &PublicKey
) -> Self
pub fn from_basepoint<T: Signing>( secp_ctx: &Secp256k1<T>, basepoint: &PaymentBasepoint, per_commitment_point: &PublicKey ) -> Self
Generate localpubkey using per_commitment_point
sourcepub fn from_secret_key<T: Signing>(
secp_ctx: &Secp256k1<T>,
sk: &SecretKey
) -> Self
pub fn from_secret_key<T: Signing>( secp_ctx: &Secp256k1<T>, sk: &SecretKey ) -> Self
Generate localpubkey from privkey
sourcepub fn to_public_key(&self) -> PublicKey
pub fn to_public_key(&self) -> PublicKey
Get inner Public Key
Trait Implementations§
source§impl Clone for PaymentKey
impl Clone for PaymentKey
source§fn clone(&self) -> PaymentKey
fn clone(&self) -> PaymentKey
Returns a copy 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 PaymentKey
impl Debug for PaymentKey
source§impl PartialEq for PaymentKey
impl PartialEq for PaymentKey
source§fn eq(&self, other: &PaymentKey) -> bool
fn eq(&self, other: &PaymentKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Readable for PaymentKey
impl Readable for PaymentKey
source§impl Writeable for PaymentKey
impl Writeable for PaymentKey
impl Copy for PaymentKey
impl Eq for PaymentKey
impl StructuralEq for PaymentKey
impl StructuralPartialEq for PaymentKey
Auto Trait Implementations§
impl RefUnwindSafe for PaymentKey
impl Send for PaymentKey
impl Sync for PaymentKey
impl Unpin for PaymentKey
impl UnwindSafe for PaymentKey
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