Module lightning::ln

source ·
Expand description

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

Re-exports§

Modules§

  • 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
  • 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.
  • 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.

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.