Probing & Privacy 探測與隱私
了解閃電網路的隱私威脅,包括餘額探測、支付關聯和去匿名化攻擊,以及可用的保護措施。
閃電網路隱私概覽
閃電網路提供了比鏈上交易更好的隱私性——支付不記錄在公開區塊鏈上,使用洋蔥路由隱藏路徑。 但它並非完美匿名。節點可以看到經過它們的支付,通道餘額可以被探測, 支付可以被關聯。了解這些威脅對於保護隱私至關重要。
重要提醒: 閃電網路的隱私正在持續改進,但目前它不應被視為匿名系統。 如果你需要強隱私,需要採取額外措施並了解當前的限制。
餘額探測攻擊
Balance Probing:
Attacker wants to know Alice-Bob channel balance distribution
Method: Send intentionally failing payments
Attacker -> ... -> Alice -> Bob -> non-existent destination
Using wrong payment_hash, payment will definitely fail.
But the failure location reveals information!
Probing Process:
1. Send 1 BTC probe payment
-> Fails: TEMPORARY_CHANNEL_FAILURE (Alice->Bob insufficient)
-> Conclusion: Alice's balance < 1 BTC
2. Send 0.5 BTC probe payment
-> Fails: UNKNOWN_PAYMENT_HASH (reached destination, then failed)
-> Conclusion: Alice's balance >= 0.5 BTC
3. Send 0.75 BTC...
-> Continue binary search
4. After ~10 probes
-> Know exact balance to sat level!
Problems:
- Completely free (failed payments have no fee)
- Hard to prevent (looks like normal failures)
- Can be done at scale 支付關聯
Payment Correlation Attack:
HTLCs use same payment_hash across hops:
A -> B -> C -> D
| |
+--------+-- same payment_hash
If attacker controls B and D:
B sees: from A, hash=abc123, amount=100k
D sees: to ?, hash=abc123, amount=99k (minus fees)
Correlation! Same payment.
Knows: A is paying someone after D
Amount: ~100k sats
Worse case: First and last node control
If attacker controls A and D's counterparties:
- Knows exact sender identity
- Knows exact receiver identity
- Knows exact amount
- Complete de-anonymization!
PTLCs Solution:
Use different points instead of same hash:
A -> B: point_AB
B -> C: point_BC (different!)
C -> D: point_CD (different!)
Cannot correlate payments via point 時序分析
Timing Analysis: Attacker can correlate payments via timing: Scenario: Attacker controls nodes near entry and exit Entry time: T0 Intermediate delay: ~100ms (network latency) Exit time: T0 + ~100ms If at T0 there's only one inbound HTLC, and at T0+100ms only one matching outbound HTLC, -> Very likely the same payment Mitigations: - Add random delays (but increases payment time) - Batch HTLC processing (high complexity) - Use Tor for network layer anonymity Path Length Inference: CLTV timelock decrement reveals path position: - Entry node sees large CLTV - Exit node sees small CLTV - Difference / delta = approximate hop count
網路圖分析
通道圖洩露
公開通道在網路圖中可見,洩露:節點連接、通道容量、費率設定、在線時間模式。
資金追蹤
通道開設/關閉交易在鏈上可見。可以追蹤資金來源和流向,關聯不同通道。
節點身份
節點公鑰是永久身份。IP 地址、Tor 地址、別名都可能洩露身份。
餘額歷史
定期探測可以構建通道餘額的歷史變化,推斷支付流向和金額。
隱私保護措施
1. 私有通道
使用 私有通道 避免在網路圖中公開你的通道和連接。
2. Route Blinding
使用 路徑盲化 隱藏接收方的位置,發送方只知道入口節點。
3. Tor 網路
通過 Tor 運行節點,隱藏真實 IP 地址。注意 Tor 也有其限制。
4. 多路徑支付
MPP 將支付分割成多個部分, 增加關聯難度(但相同 payment_hash 仍可關聯)。
5. PTLCs(未來)
PTLCs 消除跨跳的 hash 關聯, 是解決支付關聯問題的根本方案。
探測防禦
Balance Probing Defense Methods: 1. Shadow Routing - Add fake hops after real path - CLTV appears longer - Hard to determine real destination 2. Randomized Errors - Return failure even with sufficient balance - Increases probing uncertainty - But affects normal payment success rate 3. Fee Rate Limiting - Limit frequency of failed payments - Slows down probing - Need to balance normal usage 4. Minimum HTLC Setting - Set higher minimum value - Reduces precise probing ability - But limits small payments 5. Regular Rebalancing - Actively change balance distribution - Probe results quickly outdated - Has cost Reality: Currently no perfect probing defense exists. Best strategy is to accept some balance leakage and use private channels to reduce probeable channels.
發送方 vs 接收方隱私
Privacy Asymmetry: Sender Privacy (better): - Chooses path, controls more info - Can choose which nodes to route through - Receiver doesn't know sender identity (unless in invoice) - Can use Trampoline to reduce exposure Receiver Privacy (worse): - Must provide contact method (invoice/BOLT12) - Route hints leak private channel info - Node ID is prerequisite to receive payments - Sender knows at least the last hop Route Blinding Improves Receiver Privacy: - Hides real node ID - Hides last few hops of path - Sender only knows entry point Best Practices: - Sender: Use multi-hop paths, avoid direct connection - Receiver: Use Route Blinding + private channels - Both: Use Tor, periodically rotate nodes/channels
隱私威脅模型
全局被動對手
可以觀察整個網路流量的對手(如 ISP 或國家級行為者)。 可以進行時序關聯和流量分析。Tor 可以部分緩解。
路由節點對手
控制一個或多個路由節點的對手。可以看到經過的支付、進行探測、嘗試關聯。 多節點攻擊更強大。
交易對手
你的直接通道對手方。完全知道你的支付活動(如果經過他們的通道)。 選擇可信任的對手方很重要。
相關資源
- • 閃電網路隱私研究論文
- • 私有通道
- • Route Blinding
- • PTLCs
下一步: 了解 Channel Jamming 這一拒絕服務攻擊及其緩解措施。