Module ln
Expand description
Implementations of various parts of the Lightning protocol are in this module.
Note that the re-exports of PaymentHash
, PaymentPreimage
, and PaymentSecret
here
are deprecated and will be removed in a future version. Instead, use them via
lightning::types::payment
.
Modules§
- Convenient utilities for paying Lightning invoices.
- Various utilities for building scripts related to channels. These are largely of interest for those implementing the traits on
crate::sign
by hand. - Keys used to generate commitment transactions. See: https://github.com/lightning/bolts/blob/master/03-transactions.md#keys
- Information about the state of a channel.
- The top-level channel management and payment tracking stuff lives here.
- Feature flag definitions for the Lightning protocol according to BOLT #9.
- Utilities to generate inbound payment information in service of invoice creation.
- Convenient utilities to create an invoice.
- Wire messages, traits representing wire message handlers, and a few error types live here.
- Utilities to decode payment onions and do contextless validation of incoming payments.
- Top level peer message handling and socket handling logic lives here.
- Abstractions for scripts used in the Lightning Network.
- Various wrapper types (most around 32-byte arrays) for use in lightning.
- Wire encoding/decoding for Lightning messages according to BOLT #1, and for custom message through the
CustomMessageReader
trait.
Structs§
- 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. - The payment preimage is the “secret key” which is used to claim the funds of an HTLC on-chain or in a lightning channel.
- 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.
Constants§
Functions§
- Build a payment onion, returning the first hop msat and cltv values as well.
cur_block_height
should be set to the best known block height + 1.