高級
Simple Taproot Channels 簡單 Taproot 通道
深入了解 Simple Taproot Channels 的技術實現,包括 MuSig2 簽名、Taproot 輸出結構和向後兼容性。
15 分鐘
什麼是 Simple Taproot Channels?
Simple Taproot Channels (STC) 是閃電網路向 Taproot 過渡的第一階段。 它保持現有通道結構,同時引入 MuSig2 和 Taproot 的優勢。
LND 0.17+: Simple Taproot Channels 已在 LND 0.17 中實驗性支援。 這是邁向完整 Taproot 閃電網路的重要一步。
與傳統通道的比較
Traditional Channels vs Simple Taproot Channels: Traditional P2WSH Channel: Funding Output: OP_2 <pubkeyA> <pubkeyB> OP_2 OP_CHECKMULTISIG Characteristics: • 2-of-2 multisig clearly visible • Script exposed on-chain • Obviously a Lightning channel Simple Taproot Channel: Funding Output: OP_1 <aggregated_pubkey> Internal Structure: • Internal Key: MuSig2(pubkeyA, pubkeyB) • Taproot Tree: (empty for keypath spend) Characteristics: • Looks like ordinary single-sig output • No script exposure on cooperative close • Significantly improved on-chain privacy
Funding 輸出結構
Simple Taproot Funding Output: Key Aggregation: 1. Both parties exchange public keys Alice: pubkey_a Bob: pubkey_b 2. MuSig2 key aggregation aggregate_key = MuSig2_KeyAgg(pubkey_a, pubkey_b) 3. Build Taproot output internal_key = aggregate_key merkle_root = (empty) output_key = internal_key + H(internal_key || merkle_root)*G 4. Funding output scriptPubKey: OP_1 <output_key> This is a standard P2TR output Why Use Empty Taproot Tree? Simple Taproot = keypath spend only Advantages: • Cooperative close looks completely ordinary • No script exposure • Minimal on-chain footprint Disadvantages: • Non-cooperative case still reveals commitment tx structure • Less flexible than full Taproot channels
承諾交易結構
Simple Taproot Commitment Transaction:
Input Signing Method:
Traditional: Two separate ECDSA signatures
Simple Taproot:
• MuSig2 aggregated signature
• Single Schnorr signature
• 64 bytes (vs traditional ~144 bytes)
Commitment Transaction Outputs (similar structure):
to_local Output (using P2TR):
Internal Key: revocation_pubkey
Script Path (leaf):
<local_delayedpubkey>
OP_CHECKSIG
<to_self_delay>
OP_CHECKSEQUENCEVERIFY
OP_DROP
to_remote Output (using P2TR):
Simple P2TR output
Counterparty can spend directly via keypath
HTLC Output (using P2TR):
Offered HTLC:
Internal Key: revocation_pubkey
Script Leaves:
[0] Success path: <remote_htlcpubkey> CHECKSIG
(with preimage in annex)
[1] Timeout path: <local_htlcpubkey> CHECKSIG
<cltv_expiry> CHECKLOCKTIMEVERIFY
Received HTLC: Similar but paths reversed MuSig2 簽名流程
Commitment Transaction MuSig2 Signing:
Two-Round Protocol:
Alice Bob
| |
| [Round 1: Nonce Exchange] |
| |
|---- nonce_a -------------------------->|
|<--- nonce_b ---------------------------|
| |
| [Compute aggregate nonce] |
| R = R_a + R_b |
| |
| [Round 2: Partial Signature] |
| |
|---- partial_sig_a -------------------->|
|<--- partial_sig_b ---------------------|
| |
| [Combine signatures] |
| sig = partial_sig_a + partial_sig_b |
Difference from Traditional Signing:
Traditional 2-of-2:
• Alice signs -> sig_a
• Bob signs -> sig_b
• Witness: <sig_a> <sig_b> <script>
MuSig2:
• Alice partial_sig -> s_a
• Bob partial_sig -> s_b
• Aggregate -> sig = (R, s_a + s_b)
• Witness: <sig> (single signature)
Savings: ~80 bytes per commitment tx 通道生命週期
Simple Taproot Channel Lifecycle:
Opening:
1. open_channel2 message
• channel_type = option_taproot
• funding_pubkey (for MuSig2)
2. accept_channel2 message
• funding_pubkey
3. MuSig2 key aggregation
• Compute aggregate public key
4. tx_add_input / tx_add_output
• Dual-funded (if used)
5. commitment_signed (using MuSig2 nonces)
• Exchange nonces
• Exchange partial signatures
6. tx_signatures
• Funding transaction signatures
Operation:
Updating commitment transaction:
1. update_add_htlc / update_fulfill_htlc / ...
2. commitment_signed
• Contains MuSig2 nonce
• Contains partial signature
3. revoke_and_ack
• Reveal previous state's revocation key
• Send new nonce (for next round)
Note: Requires additional nonce state management
Closing:
Cooperative close (ideal case):
• shutdown message
• closing_signed (using MuSig2)
• On-chain shows only P2TR -> P2TR/P2WPKH
Looks like ordinary single-sig transaction!
Non-cooperative close:
• Broadcast commitment transaction
• Reveals Taproot script path
• Still smaller than traditional channels Gossip 與隱私
Taproot Channel Gossip: channel_announcement Changes: Traditional: • bitcoin_key_1, bitcoin_key_2 • Signature proves ownership of funding output Taproot: • Need to prove ownership of aggregate key • Uses MuSig2 signature • New message format (pending standardization) Chain Analysis Resistance: On cooperative close: • Input: P2TR (looks like single-sig) • Output: P2TR/P2WPKH • Cannot determine from chain that it's a Lightning channel Even for public channels: • Gossip participation is optional • Private channels completely hidden • Channel capacity no longer easily trackable
優點
隱私提升、費用降低、向後兼容。 是 Taproot 閃電的第一步。
限制
非合作關閉仍揭露腳本。 完整 PTLCs 需要更多工作。
實驗性功能: Simple Taproot Channels 仍在開發中。 生產環境使用前請確認節點版本和對等節點支援。
相關資源
下一步: 了解 MuSig2 如何實現安全的多方簽名。
已複製連結