Module scid_utils

Expand description

Utilities for creating and parsing short channel ids.

Enums§

ShortChannelIdError
A short_channel_id construction error

Constants§

MAX_SCID_BLOCK
Maximum block height that can be used in a short_channel_id. This value is based on the 3-bytes available for block height.
MAX_SCID_TX_INDEX
Maximum transaction index that can be used in a short_channel_id. This value is based on the 3-bytes available for tx index.
MAX_SCID_VOUT_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§

block_from_scid
Extracts the block height (most significant 3-bytes) from the short_channel_id
scid_from_parts
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.
tx_index_from_scid
Extracts the tx index (bytes [2..4]) from the short_channel_id
vout_from_scid
Extracts the vout (bytes [0..2]) from the short_channel_id