Module lightning::ln

source ·
Expand description

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

Modules§

Structs§

  • 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.
  • payment_hash type, use to cross-lock hop
  • payment_preimage type, use to route payment between hop
  • payment_secret type, use to authenticate sender to the receiver and tie MPP HTLCs together

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.