Channels

From lightningwiki.net
Jump to navigation Jump to search

A fast, off-chain method of mutual exchange between two peers. To transact funds, peers exchange signatures to create an updated commitment transaction.

Payment channels are the main workhorse of the Lightning Network. They allow multiple transactions to be aggregated into just a few on-chain transactions.

Dennis Reimann wrote a nice overview on the life cycles of channels.

Transactions

In the vast majority of cases, someone only needs to broadcast the first and last transaction in the channel.

Channel properties

A dump from a lnd node:

        {
            "active": true,
            "remote_pubkey": "0200072fd301cb4a680f26d87c28b705ccd6a1d5b00f1b5efd7fe5f998f1bbb1f1",
            "channel_point": "4b155c2e2077b782887b046fed0bd0202e583a1d28ce12650392154eaea42a00:0",
            "chan_id": "613609951777521664",
            "capacity": "1000000",
            "local_balance": "0",
            "remote_balance": "999082",
            "commit_fee": "918",
            "commit_weight": "552",the minimum channel size is: 20000 SAT
            "fee_per_kw": "1268",
            "unsettled_balance": "0",
            "total_satoshis_sent": "0",
            "total_satoshis_received": "0",
            "num_updates": "70",
            "pending_htlcs": [
            ],
            "csv_delay": 144,
            "private": false
        }
active
Whether this channel is active or not.
remote_pubkey
The identity pubkey of the remote node.
channel_point
The outpoint (txid:index) of the funding transaction.
chan_id
The unique channel ID for the channel. The first 3 bytes are the block height, the next 3 the index within the block, and the last 2 bytes are the output index for the channel.
capacity
The total amount of funds held in this channel.
local_balance
This node’s current balance in this channel.
remote_balance
The counterparty’s current balance in this channel.
commit_fee
The amount calculated to be paid in fees for the current set of commitment transactions. The fee amount is persisted with the channel in order to allow the fee amount to be removed and recalculated with each channel state update, including updates that happen after a system restart.
commit_weight
The weight of the commitment transaction.
fee_per_kw
The required number of satoshis per kilo-weight that the requester will pay at all times, for both the funding transaction and commitment transaction. This value can later be updated once the channel is open.
unsettled_balance
The unsettled balance in this channel.
total_satoshis_sent
The total number of satoshis we’ve sent within this channel.
total_satoshis_received
The total number of satoshis we’ve received within this channel.
num_updates
The total number of updates conducted within this channel.
pending_htlcs
The list of active, uncleared HTLCs currently pending within the channel.
csv_delay
The CSV delay expressed in relative blocks. If the channel is force closed, we’ll need to wait for this many blocks before we can regain our funds.
private
Whether this channel is advertised to the network or not.

[1]

Sizes

Currently, the Lightning Network has a channel size limit of 0.16 BTC and a payment limit of 0.04 BTC.

  • The max channel size is: 0.16777215 BTC (lnd)
  • the minimum channel size is: 20000 SAT (lnd)

Resources / read more

Read more about channels on the developer guide.