進階
Liquidity Ads 流動性廣告
了解 Core Lightning 的流動性廣告機制,節點如何在 gossip 網路中公告可購買的流動性。
10 分鐘
什麼是流動性廣告?
流動性廣告(Liquidity Ads)是 BOLT 規範的一部分,允許節點在 gossip 網路中 公告其願意提供的流動性服務。與 Lightning Pool 不同,這是完全去中心化的機制, 不需要中央協調者。Core Lightning 原生支援此功能。
去中心化設計: 流動性廣告通過 node_announcement 傳播,任何節點都可以看到並直接購買, 無需第三方市場。
工作原理
Liquidity Ads Mechanism Seller Announces Liquidity: node_announcement extended fields: will_fund (TLV): • lease_fee_base_sat: base fee (satoshis) • lease_fee_basis: proportional fee (per 10,000) • funding_weight: expected tx weight contribution • channel_fee_max_base_msat: max base routing fee • channel_fee_max_proportional_millionths: max proportional fee • compact_lease: compact encoding of lease terms Buyer Purchase Flow: 1. Buyer discovers seller's liquidity ad (via gossip) 2. Buyer initiates dual-funded channel open 3. Buyer requests seller to contribute funds 4. Seller calculates fee and requests payment 5. Buyer accepts terms 6. Execute interactive tx construction 7. Channel open complete
費用結構
Liquidity Ads Fee Calculation
Lease Fee Formula:
lease_fee = lease_fee_base_sat + (amount * lease_fee_basis / 10000)
Example:
• lease_fee_base_sat: 1000 sats
• lease_fee_basis: 50 (0.5%)
• amount: 1,000,000 sats
• Fee = 1000 + (1,000,000 * 50 / 10000)
= 1000 + 5000 = 6000 sats
Routing Fee Commitment:
Seller commits during lease period:
• Base fee <= channel_fee_max_base_msat
• Proportional fee <= channel_fee_max_proportional_millionths
This ensures buyer gets reasonable routing fees
Prevents seller from setting extremely high fees after opening
Lease Duration:
• Standard lease: 4032 blocks (~4 weeks)
• Other durations negotiable
• Duration encoded via compact_lease 配置流動性廣告
Core Lightning 配置: 啟用流動性廣告(賣方): # lightningd 配置或命令 lightning-cli funderupdate \ -k policy=match \ # 匹配對方金額 policy_mod=100 \ # 匹配 100% min_their_funding=100000 \ # 最小對方資金 max_their_funding=10000000 \ # 最大對方資金 per_channel_min=100000 \ # 每通道最小 per_channel_max=5000000 \ # 每通道最大 reserve_tank=50000 \ # 保留資金 fuzz_percent=0 \ # 模糊百分比 fund_probability=100 \ # 資助概率 lease_fee_base_msat=1000000 \ # 基礎費用(msat) lease_fee_basis=50 \ # 比例費用(0.5%) channel_fee_max_base_msat=1000 \ # 最大路由基礎費 channel_fee_max_proportional_millionths=100 # 最大路由比例費 查看當前設置: lightning-cli funderupdate 購買流動性(買方): # 開通道時請求對方貢獻 lightning-cli fundchannel \ <node_id> \ 1000000sat \ # 我的貢獻 request_amt=500000sat # 請求對方貢獻
與 Dual-Funded 整合
Liquidity Ads + Dual-Funded Channels Message Flow: Buyer Seller | | | [Sees seller's will_fund ad] | | | |---- open_channel2 ---------------->| | (request_funds) | | | |<--- accept_channel2 ---------------| | (will_fund: terms) | | | | [Interactive tx construction] | |<--- tx_add_input ----------------->| |<--- tx_add_output ---------------->| | | | [Signature exchange] | |<--- tx_signatures ---------------->| | | | [Channel opens, lease begins] | Lease Proof: • Seller provides lease signature in channel_ready • Proves commitment to maintain service during lease • Buyer can save as evidence of breach
Pool vs Liquidity Ads
Comparing Two Liquidity Markets Lightning Pool: Pros: • Price discovery mechanism (auction) • Node rating system • Batch execution saves on-chain fees • Sidecar channel support Cons: • Requires central coordinator • Only LND native support • Auction cycle delays Liquidity Ads: Pros: • Fully decentralized • Standard protocol (BOLT spec) • Instant execution • No third-party trust required • Cross-implementation compatible Cons: • No price discovery mechanism • Must evaluate sellers yourself • Adoption still growing
尋找流動性賣家
Gossip 查詢
通過 gossip 協議自動發現公告流動性的節點。 Core Lightning 的 listpeers 可以顯示此資訊。
網路瀏覽器
如 1ML、Amboss 等網站可能會列出提供流動性廣告的節點。
社群資源
Lightning 社群論壇和 Discord 通常有節點運營者分享其流動性服務。
LSP 目錄
一些 LSP 通過流動性廣告提供服務,可以從 LSP 列表中找到。
選擇建議: 評估賣方時考慮:節點 uptime 歷史、連接性、現有通道數量、 社群評價。不要只看價格。
相關資源
下一步: 了解 注資交易 的技術細節。
已複製連結