Module lightning::util::scid_utils

source ·
Expand description

Utilities for creating and parsing short channel ids.

Enums§

Constants§

  • Maximum block height that can be used in a short_channel_id. This value is based on the 3-bytes available for block height.
  • Maximum transaction index that can be used in a short_channel_id. This value is based on the 3-bytes available for tx index.
  • Maximum vout index that can be used in a short_channel_id. This value is based on the 2-bytes available for the vout index.

Functions§

  • Extracts the block height (most significant 3-bytes) from the short_channel_id
  • Constructs a short_channel_id using the components pieces. Results in an error if the block height, tx index, or vout index overflow the maximum sizes.
  • Extracts the tx index (bytes [2..4]) from the short_channel_id
  • Extracts the vout (bytes [0..2]) from the short_channel_id