跳至主要內容
高級

Async Payments 非同步支付

了解非同步支付如何讓離線用戶也能接收閃電網路支付,解決移動設備的在線要求問題。

12 分鐘

在線要求問題

閃電網路的設計假設雙方在支付時都在線。接收方需要在線來生成發票、揭示 preimage、 更新通道狀態。這對服務器節點沒問題,但對移動設備用戶是個挑戰—— 你不能要求用戶的手機 24/7 在線才能收款。

核心問題: 傳統閃電網路需要接收方在線來完成支付。非同步支付的目標是讓離線用戶也能「收款」, 然後在上線時完成結算。

當前解決方案的局限

Existing Solutions and Their Problems:

1. Custodial Wallets
   + Simple, can receive anytime
   - Funds controlled by third party
   - Privacy risk
   - Counterparty risk

2. LSP Proxy Receiving
   + Funds eventually reach user
   + Better user experience
   - LSP needs to temporarily hold funds
   - Still requires trust
   - LSP may censor payments

3. HODL Invoices
   + Payment can wait
   - Occupies sender's liquidity
   - Increases jamming risk
   - Has time limit

Ideal Solution:
• Receiver can "commit" to receive while offline
• Settle trustlessly when online
• Don't occupy others' liquidity

Async Payments 概念

Async Payment Design Goals:

Flow:
  Sender (Alice)
       |
       | Initiates payment
       v
  LSP / Intermediate Node
       |
       | Holds payment intent, waits for receiver
       | (doesn't hold actual funds)
       v
  Receiver comes online
       |
       v
  Receiver (Bob) - Completes settlement

Key Features:
• No liquidity occupied while receiver offline
• Complete actual HTLC exchange when online
• No need to trust intermediate node with funds

技術方案

1. Trampoline + Async

Trampoline Routing + Async Payments:

Concept:
• Sender delegates payment to Trampoline node
• Trampoline node finds the receiver
• If receiver offline, Trampoline can wait

Flow:
1. Alice creates payment, specifies Bob's static ID
2. Alice sends to Trampoline node T
3. T discovers Bob is offline
4. T saves "payment intent" (not actual funds)
5. Bob comes online, connects to T
6. T routes payment to Bob
7. Bob reveals preimage
8. Payment complete

Advantages:
• No on-chain transaction needed
• Alice's funds not locked when Bob offline
• Based on existing Trampoline proposal

Limitations:
• Requires Trampoline node support
• Still some trust requirement (T might not forward)

2. PTLCs + Async

PTLC-based Async Payments:

Advantages of adaptor signatures:

Traditional HTLC:
• Receiver must be online to generate preimage
• Cannot create "reusable" payment method in advance

PTLC:
• Receiver can publish public point P = p*G in advance
• Sender uses P to create payment
• Receiver unlocks with p when online

Flow:
1. Bob publishes static payment point P (like static address)
2. Alice creates PTLC locked to P
3. Alice sends payment to Bob's LSP
4. LSP holds payment (in PTLC form)
5. Bob comes online, unlocks PTLC with p
6. Payment complete

Challenges:
• Requires widespread PTLC deployment
• Depends on Taproot channels

3. 靜態發票 (Static Invoices)

BOLT 12 Offers for Static Invoices:

Traditional BOLT 11:
• Need to generate new invoice each time
• Invoice has expiry time
• Receiver must be online

BOLT 12 Offers:
  Offer: lno1...
  • Static payment "offer"
  • Reusable
  • No need to be online for each invoice

Flow:
1. Bob creates and publishes Offer
2. Alice uses Offer to request invoice
3. Invoice request via onion routing
4. Bob's node/LSP returns invoice
5. Alice pays

Async scenario:
• When Bob offline, LSP can proxy
• Use Bob's pre-authorized keys
• Or wait for Bob to come online

LSP 輔助非同步

目前最實用的方案依賴 LSP 的輔助:

Phoenix 的方案

  • • ACINQ 節點代理接收
  • • 支付暫存在 LSP
  • • 用戶上線後自動完成
  • • 使用加密的支付數據

Breez 的方案

  • • LSP 持有 HODL invoices
  • • 推送通知喚醒 App
  • • 在線時即時結算
  • • 有超時限制

挑戰與權衡

信任最小化

如何確保中間方不能偷取資金或審查支付?理想方案應該是「持有意圖」而非「持有資金」。

超時處理

如果接收方長時間不上線怎麼辦?需要有明確的超時和退款機制。

通道堵塞

如果使用 HODL invoices,長時間等待會佔用流動性。需要與堵塞防護措施配合。

隱私保護

LSP 會知道誰在接收支付。需要設計機制保護接收方隱私。

未來展望

Async Payments Roadmap:

Near-term (implemented):
• LSP proxy receiving
• HODL invoices
• Push notification wakeup

Mid-term (in development):
• BOLT 12 Offers
• Trampoline routing
• Better LSP standards

Long-term (research):
• PTLC-based async
• Fully trustless solution
• Cross-LSP interoperability

Ideal Goals:
• Receiver can be fully offline
• Don't occupy network liquidity
• Minimize trust requirements
• Protect privacy

實現狀態

Phoenix 部分實現

支援離線接收,使用 ACINQ 節點作為代理,支付會在 App 啟動時完成。

Breez 部分實現

使用 HODL invoices 和推送通知實現離線接收。

BOLT 12 開發中

靜態 Offers 可以改善非同步支付體驗,CLN 已支援,其他實現正在跟進。

相關資源

下一步: 了解 LNURL 協議如何簡化閃電網路的用戶體驗。

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