跳至主要內容
高級

Channel Jamming 通道堵塞

了解閃電網路的通道堵塞攻擊,這是一個嚴重的可用性問題,以及社群正在研究的各種解決方案。

15 分鐘

什麼是通道堵塞?

通道堵塞(Channel Jamming)是閃電網路面臨的一個嚴重可用性問題。 攻擊者可以通過佔用通道的流動性或 HTLC 槽位,使節點無法正常處理支付, 而且這種攻擊的成本極低——只需要發送一些最終會失敗的支付。

當前狀態: 通道堵塞是閃電網路最重要的未解決問題之一。目前沒有完美的解決方案, 社群正在積極研究和討論各種緩解措施。

攻擊類型

流動性堵塞 (Liquidity Jamming)

攻擊者發送大額支付並故意不完成(不揭示 preimage),佔用通道的流動性直到 HTLC 超時。

槽位堵塞 (Slot Jamming)

攻擊者發送大量小額支付,耗盡通道的 HTLC 槽位(通常限制為 483 個),阻止正常支付。

攻擊機制詳解

Liquidity Jamming Attack:

Attacker controls two nodes A and Z:

A ──> B ──> C ──> D ──> Z
│                       │
└── Attacker controls ──┘

Attack flow:
1. A sends payment to Z (via B-C-D route)
2. HTLC propagates all the way to Z
3. Z intentionally doesn't reveal preimage
4. All intermediate channel liquidity locked
5. Wait for HTLC timeout (hours to days)
6. Attacker loses no funds (payment fails)

Cost analysis:
• Attacker cost: only routing fees (few sats)
• Victim loss: liquidity locked, can't process payments
• Duration: up to HTLC timeout (~2 weeks max)

────────────────────────────────────────────

Slot Jamming Attack:

HTLC slot limit:
• Max 483 pending HTLCs per channel direction
• Required to keep commitment tx under
  Bitcoin's max transaction size limit

Attack flow:
1. Attacker creates 483+ small payments
2. Each payment only 1 sat
3. All HTLC slots filled
4. Normal payments can't go through

Cost: 483 sats x routing fee = few hundred sats

為什麼很難解決?

1. 無法區分攻擊和正常失敗

支付失敗是閃電網路的正常現象(路由問題、離線節點等)。節點無法區分惡意攻擊和正常失敗。

2. 洋蔥路由隱私

中間節點不知道支付的發送者和接收者,無法建立信譽系統或追究責任。

3. 去中心化網路

沒有中央權威可以封鎖攻擊者。任何人都可以匿名加入網路並發起攻擊。

4. 經濟不對稱

攻擊者成本極低(只需路由費),但可以造成大量資金被鎖定。

提議的解決方案

1. 預付費用 (Upfront Fees)

Upfront Fee Mechanism:

Current model (pay only on success):
  Payment success: routing node collects fee
  Payment failure: routing node gets nothing

Upfront fee model:
  When sending: immediately pay small "hold fee"
  Success: normal routing fee
  Failure: routing node keeps hold fee

Advantages:
• Increases attack cost
• Compensates routing nodes for resource use

Disadvantages:
• Increases cost for normal users
• Routing nodes might intentionally delay
• Complex implementation

2. 本地信譽系統

Local Reputation System:

Each node maintains its own reputation database:

Peer     | Success Rate | Reputation
---------|--------------|------------
Node A   | 95%          | Good
Node B   | 30%          | Suspicious
Node C   | 5%           | Bad

Behavior:
• HTLCs from low-rep nodes: limit slots/amount
• HTLCs from high-rep nodes: process normally
• New nodes: gradually build reputation

Challenges:
• Attackers can build reputation first
• Reputation can't be shared (privacy issues)
• May cause network fragmentation

3. Circuit Breaker

Circuit Breaker Plugin (CLN):

Per-peer limit settings:
  max_pending_htlcs_per_peer: 30
  max_htlc_value_per_peer: 100000 sat
  max_pending_duration: 1 hour

When limits reached:
• Reject new HTLCs
• Prioritize small fast payments
• Log suspicious behavior

Limitations:
• Only mitigation, not complete prevention
• May affect normal large payments

4. 信譽憑證 (Reputation Credentials)

Reputation Credentials (research):

Concept:
1. Nodes buy "reputation tokens" (pay via LN)
2. Attach tokens when sending payment
3. Payment failure: tokens destroyed
4. Payment success: tokens can be recovered

Features:
• Purchase cost = attack cost
• Anonymous credentials (privacy protection)
• Transferable

Challenges:
• Increases normal payment complexity
• Token economics design
• Requires widespread adoption

5. 時間鎖降級

Shorten HTLC Timeout:

Current default:
  Max HTLC timeout = 2016 blocks = ~2 weeks

Reduced timeout:
  Max HTLC timeout = 144 blocks = ~1 day

Benefits:
• Attack duration shortened
• Liquidity recovers faster

Problems:
• Long-path payments more likely to timeout
• Reduces tolerance for offline nodes
• Requires faster block monitoring

當前緩解措施

節點層面

  • • 設定 max_htlc_value_in_flight
  • • 限制每個對等的 pending HTLCs
  • • 使用 Circuit Breaker 插件
  • • 監控異常模式

網路層面

  • • 減少默認 HTLC 超時
  • • 增加最小 HTLC 金額
  • • 社群信息共享
  • • 持續研究新方案

研究進展

2022: 堵塞問題被系統性研究

多篇學術論文分析了堵塞攻擊的經濟成本和可行性,引起社群廣泛關注。

2023: 信譽憑證提案

Clara Shikhelman 和 Sergei Tikhomirov 提出基於 Chaumian eCash 的信譽系統。

持續進行: 多種方案並行研究

社群正在評估多種方案的權衡,可能最終採用組合策略。

相關資源

下一步: 了解 非同步支付 如何實現離線接收功能。

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