跳至主要內容
入門

Channel Capacity 通道容量

了解閃電網路通道容量的概念、限制因素,以及如何規劃通道大小。

8 分鐘

什麼是通道容量?

通道容量是指閃電通道中鎖定的比特幣總量。它決定了通道能夠處理的 最大支付金額,是通道的基本屬性之一。

鏈上資金: 通道容量由開設時鎖定在 2-of-2 多簽中的比特幣決定。 這些資金在通道開啟期間無法在鏈上使用。

容量分配

Channel Capacity Structure:

Capacity Allocation Example (1,000,000 sats channel):

+----------------------------+----------------------------+
|      Local Balance         |      Remote Balance        |
|      600,000 sats          |      400,000 sats          |
|      (Outbound capacity)   |      (Inbound capacity)    |
+----------------------------+----------------------------+

Total capacity: 1,000,000 sats

You can send: Up to 600,000 sats (minus reserve and fees)
You can receive: Up to 400,000 sats (minus reserve)

Capacity is Fixed, Balance is Dynamic:

After sending 200,000 sats:

+----------------------------+----------------------------+
|      Local Balance         |      Remote Balance        |
|      400,000 sats          |      600,000 sats          |
|   (Outbound decreased)     |   (Inbound increased)      |
+----------------------------+----------------------------+

Total capacity still 1,000,000 sats

容量限制

Channel Capacity Limits:

Default Limits:

Minimum capacity: ~20,000 sats
  Reason: Too small channels are impractical (fees may exceed capacity)

Standard maximum: 16,777,215 sats (~0.168 BTC)
  Reason: Original protocol limit (2^24 - 1 satoshis)

Wumbo maximum: ~10 BTC (implementation dependent)
  Requires: option_support_large_channel feature bit

Practical Limiting Factors:

1. Available funds
   How much BTC you can lock up

2. On-chain fees
   Opening and closing channels require miner fees

3. Reserve requirements
   Both parties must maintain minimum balance

4. Peer node limits
   Counterparty may have different limits set

5. Risk considerations
   Larger channels mean greater risk exposure

容量規劃

Choosing Appropriate Channel Capacity:

By Use Case:

Personal daily use:
  • Recommended capacity: 100,000 - 500,000 sats
  • Number of channels: 2-5
  • Consideration: Cover daily small payments

Small merchant:
  • Recommended capacity: 500,000 - 2,000,000 sats
  • Number of channels: 3-10
  • Consideration: Sufficient inbound capacity to receive payments

Routing node:
  • Recommended capacity: 2,000,000 - 16,777,215 sats
  • Number of channels: 10-100+
  • Consideration: Large routing, bidirectional liquidity

Large enterprise:
  • Recommended capacity: Use Wumbo channels
  • Consideration: Professional node operation, multiple backups
  • Requires: Wumbo-supporting counterparty

Capacity Efficiency Considerations:

On-chain cost ratio:

Opening 100,000 sats channel, fee 2,000 sats = 2% cost
Opening 1,000,000 sats channel, fee 2,000 sats = 0.2% cost

-> Larger channels are more fee-efficient

有效容量

Factors Affecting Effective Capacity:

Channel Reserve:

Minimum balance each party must maintain (prevents cheating incentive)

Calculation: reserve = max(dust_limit, capacity * 1%)

Example: 1,000,000 sats channel
  • Reserve: 10,000 sats per party
  • Effective available: 980,000 sats

HTLC-Related Limits:

Concurrent HTLCs:
  • Quantity limit: Usually 483
  • Amount limit: Usually 99% of capacity

Minimum HTLC amount:
  Payments below this cannot be sent

Dust limit:
  Outputs below this won't be created

Commitment Transaction Fees:

Before Anchor Outputs:
  • Fees paid from channel funds
  • Reduces effective capacity

After Anchor Outputs:
  • Fees can be supplemented via CPFP
  • Smaller impact on effective capacity

Splicing

未來技術允許動態調整通道容量, 無需關閉並重新開設通道。

MPP 克服限制

多路徑支付可以跨多個通道拆分, 有效突破單一通道容量限制。

查看容量

Viewing Channel Capacity Commands:

LND:

# List all channels with capacity
lncli listchannels

# View specific channel
lncli getchaninfo <channel_id>

# View total capacity
lncli getinfo | jq '.num_active_channels, .num_peers'

Core Lightning:

# List channels
lightning-cli listpeerchannels

# View funds status
lightning-cli listfunds

Output Fields:
  • capacity: Total capacity
  • local_balance: Local balance (outbound)
  • remote_balance: Remote balance (inbound)
  • commit_fee: Commitment transaction fee
  • unsettled_balance: Pending HTLC balance

容量 ≠ 流動性: 大容量通道如果餘額完全在一側,可能無法發送或接收支付。 平衡的流動性比純粹的大容量更重要。

相關資源

下一步: 了解 流動性管理 如何優化通道使用效率。

已複製連結
已複製到剪貼簿