Expand description

High level lightning structs and impls live here.

You probably want to create a ChannelManager, and a P2PGossipSync first. Then, you probably want to pass them both on to a peer_handler::PeerManager and use that to create/manage connections and call get_and_clear_pending_events after each action, handling them appropriately.

When you want to open/close a channel or send a payment, call into your ChannelManager and when you want to learn things about the network topology (eg get a route for sending a payment), call into your P2PGossipSync.

Modules

Various utilities for building scripts and deriving keys related to channels. These are largely of interest for those implementing chain::keysinterface::Sign message signing by hand.

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.

Top level peer message handling and socket handling logic lives here.

Abstractions for scripts used in the Lightning Network.

Wire encoding/decoding for Lightning messages according to BOLT #1, and for custom message through the CustomMessageReader trait.

Structs

payment_hash type, use to cross-lock hop (C-not exported) as we just use [u8; 32] directly

payment_preimage type, use to route payment between hop (C-not exported) as we just use [u8; 32] directly

payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together (C-not exported) as we just use [u8; 32] directly

Constants

LN_MAX_MSG_LENNon-fuzzing

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