Module ln

Expand description

Implementations of various parts of the Lightning protocol are in this module.

Modules§

chan_utils
Various utilities for building scripts and deriving keys related to channels. These are largely of interest for those implementing the traits on crate::sign by hand.
channelmanager
The top-level channel management and payment tracking stuff lives here.
features
Feature flag definitions for the Lightning protocol according to BOLT #9.
inbound_payment
Utilities to generate inbound payment information in service of invoice creation.
msgs
Wire messages, traits representing wire message handlers, and a few error types live here.
peer_handler
Top level peer message handling and socket handling logic lives here.
script
Abstractions for scripts used in the Lightning Network.
wire
Wire encoding/decoding for Lightning messages according to BOLT #1, and for custom message through the CustomMessageReader trait.

Structs§

ChannelId
A unique 32-byte identifier for a channel. Depending on how the ID is generated, several varieties are distinguished (but all are stored as 32 bytes): v1 and temporary. A v1 channel ID is generated based on funding tx outpoint (txid & index). 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.
PaymentHash
payment_hash type, use to cross-lock hop
PaymentPreimage
payment_preimage type, use to route payment between hop
PaymentSecret
payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together

Constants§

LN_MAX_MSG_LEN
Maximum Lightning message data length according to BOLT-8 and BOLT-1: