Struct lnp::channel::bolt::LocalKeyset
source · pub struct LocalKeyset {
pub funding_pubkey: LocalPubkey,
pub revocation_basepoint: LocalPubkey,
pub payment_basepoint: LocalPubkey,
pub delayed_payment_basepoint: LocalPubkey,
pub htlc_basepoint: LocalPubkey,
pub first_per_commitment_point: LocalPubkey,
pub shutdown_scriptpubkey: Option<PubkeyScript>,
pub static_remotekey: bool,
}
Expand description
Set of keys used by the core of the channel. It does not include HTLC
basepoint which is managed separately by super::Htlc
extension.
Fields§
§funding_pubkey: LocalPubkey
Public key used in the funding outpoint multisig
revocation_basepoint: LocalPubkey
Base point for deriving keys used for penalty spending paths
payment_basepoint: LocalPubkey
Base point for deriving keys in to_remote
delayed_payment_basepoint: LocalPubkey
Base point for deriving keys in to_local
time-locked spending paths
htlc_basepoint: LocalPubkey
Base point for deriving HTLC-related keys
first_per_commitment_point: LocalPubkey
Base point for deriving keys used for penalty spending paths
shutdown_scriptpubkey: Option<PubkeyScript>
Allows the sending node to commit to where funds will go on mutual close, which the remote node should enforce even if a node is compromised later.
static_remotekey: bool
If option_static_remotekey
or option_anchors
is negotiated, the
remotepubkey is simply the remote node’s payment_basepoint, otherwise
it is calculated as above using the remote node’s payment_basepoint.
Implementations§
source§impl LocalKeyset
impl LocalKeyset
sourcepub fn with<C: Signing>(
secp: &Secp256k1<C>,
channel_source: KeySource,
channel_xpriv: ExtendedPrivKey,
shutdown_scriptpubkey: Option<PubkeyScript>
) -> Self
pub fn with<C: Signing>( secp: &Secp256k1<C>, channel_source: KeySource, channel_xpriv: ExtendedPrivKey, shutdown_scriptpubkey: Option<PubkeyScript> ) -> Self
Derives keyset from a channel extended key using LNPBP-46 standard
Trait Implementations§
source§impl Clone for LocalKeyset
impl Clone for LocalKeyset
source§fn clone(&self) -> LocalKeyset
fn clone(&self) -> LocalKeyset
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LocalKeyset
impl Debug for LocalKeyset
source§impl<'de> Deserialize<'de> for LocalKeyset
impl<'de> Deserialize<'de> for LocalKeyset
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Display for LocalKeyset
impl Display for LocalKeyset
source§impl DumbDefault for LocalKeyset
impl DumbDefault for LocalKeyset
source§fn dumb_default() -> Self
fn dumb_default() -> Self
source§impl PartialEq<LocalKeyset> for LocalKeyset
impl PartialEq<LocalKeyset> for LocalKeyset
source§fn eq(&self, other: &LocalKeyset) -> bool
fn eq(&self, other: &LocalKeyset) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for LocalKeyset
impl Serialize for LocalKeyset
source§impl StrictDecode for LocalKeyset
impl StrictDecode for LocalKeyset
source§fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
std::io::Read
instance; must either
construct an instance or return implementation-specific error type.source§fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
StrictDecode::strict_decode
. If there are some data remains in the
buffer once deserialization is completed, fails with
Error::DataNotEntirelyConsumed
. Use io::Cursor
over the buffer and
StrictDecode::strict_decode
to avoid such failures.source§fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
path
and reconstructs object from it. Fails
with Error::DataNotEntirelyConsumed
if file contains remaining
data after the object reconstruction.source§impl StrictEncode for LocalKeyset
impl StrictEncode for LocalKeyset
source§fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
std::io::Write
instance; must return result
with either amount of bytes encoded – or implementation-specific
error type.source§fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
StrictEncode::strict_encode
functionsource§impl ToYamlString for LocalKeyset
impl ToYamlString for LocalKeyset
source§fn to_yaml_string(&self) -> String
fn to_yaml_string(&self) -> String
self
into a YAML-encoded stringimpl Eq for LocalKeyset
impl StructuralEq for LocalKeyset
impl StructuralPartialEq for LocalKeyset
Auto Trait Implementations§
impl RefUnwindSafe for LocalKeyset
impl Send for LocalKeyset
impl Sync for LocalKeyset
impl Unpin for LocalKeyset
impl UnwindSafe for LocalKeyset
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.