lightning-channels
БесплатноБез исполняемых скриптовНе проверенLightning channel mechanics: funding tx, commitment tx, anchor outputs, zero-fee commitments (v3/TRUC), to_local / to_remote outputs, dual-funded (v2)…
от claude-dev-suite★ 51 звезда на GitHubОб этом скилле
Lightning Channels
Quick refs: state-machine.md, commitment-tx.md, force-close.md
A Lightning channel is a 2-of-2 multisig output on chain that two parties update off-chain via signed commitment transactions. Each commitment is a fully-signed tx that, if broadcast, settles the channel in one party's favour at the latest committed state.
Channel lifecycle
- Open —
open_channel→accept_channel→ on-chain funding tx →funding_locked(aftermin_depth). - Update — exchange
update_add_htlc/commitment_signed/revoke_and_ackto flow funds. - Close — cooperative (
shutdown+closing_complete/closing_sig, or legacyclosing_signed) or unilateral (broadcast latest commitment).
Funding tx
Two-party 2-of-2 multisig (legacy):
P2WSH(redeem = MULTI 2 <pk_init> <pk_resp> 2 CHECKMULTISIG)
Or Taproot key-aggregated (taproot channels):
P2TR(MuSig2(pk_init, pk_resp))
Funding tx flow:
- Initiator constructs funding tx, sends
funding_createdwith outpoint. - Responder signs initial commitment tx.
- Initiator broadcasts funding tx.
- Both wait
min_depthconfirmations, thenchannel_ready.
Commitment tx (current state)
Each side holds the latest commitment they can broadcast. Outputs:
to_local (this party's balance, with revocation OP_CSV delay)
to_remote (other party's balance)
htlc_offered (one per outgoing HTLC)
htlc_received (one per incoming HTLC)
to_local_anchor (330 sats, `option_anchors` only)
to_remote_anchor (330 sats, `option_anchors` only)
shared_anchor (0-240 sats, `zero_fee_commitments` only)
Asymmetric: each party's commitment has its own to_local (with
revocation key) — the other side has the revocation secret.
Static remote key (BOLT 9 bit 12)
Pre-BOLT static_remotekey: to_remote was rotated each commitment
update, requiring constant pubkey derivation. Post-BOLT:
to_remoteis a fixed pubkey for the lifetime of the channel.- Simplifies on-chain recovery (always know your
to_remotekey).
Anchor outputs — option_anchors (BOLT 9 bits 22/23)
The commitment type in general use as of September 2026 (it is what LND and CLN open; neither source tree references the zero-fee type below):
- Each party has a 330-sat
to_local_anchoroutput spendable immediately by themselves and after 16 blocks by anyone. - Allows CPFP fee bumping by spending the anchor.
- Channel-cost: 660 sats committed to anchors, recovered on close (or claimed by anyone after 16 blocks via the public path).
- Non-anchor outputs are CSV-locked:
to_remoteand both HTLC output types by 1 block,to_localbyto_self_delay— so the anchor is the only output you can CPFP from. Funding the child needs an external on-chain UTXO.
Defeats some pre-anchor pinning attacks but introduced new vulnerabilities (replacement cycling) addressed by TRUC v3.
Zero-fee commitments — zero_fee_commitments (BOLT 9 bits 40/41)
Merged into the BOLT spec on 2026-05-04 (lightning/bolts PR #1228).
This channel type replaces the anchor + update_fee model rather
than tuning it:
- Commitment tx
versionis 3 (TRUC), so commitment + one child form a v3 package under TRUC's topology limits. feerate_per_kwis fixed at0. The base fee of the commitment tx, the HTLC-timeout tx and the HTLC-success tx MUST be 0. Fees come from the CPFP child (commitment) or from added inputs (HTLC txs).update_feeis never sent on such a channel. That removes feerate disagreement, the funder's fee reserve, and the force-closes caused by mempool feerate spikes.- A single
shared_anchoroutput replaces the two keyed anchors: the standard P2A scriptOP_1 <0x4e73>, spendable by anyone with an empty witness. Its amount is the sum of trimmed outputs plus rounded-down msat; below the 240-sat P2A dust limit that is allowed under Bitcoin Core's ephemeral-dust rule precisely because the parent pays no fee, and it may legitimately be 0 sat. Above 240 sats the anchor caps at 240 and the remainder becomes a real mining fee — so "zero fee" is the common case, not an invariant. - The 1-block CSV is scoped to
option_anchors, so hereto_remoteis a plain P2WPKH. You can CPFP a remote commitment by spending your own main-balance or HTLC output — no external wallet UTXO.
Needs a relay path accepting v3/TRUC (standard since Bitcoin Core
v28.0) and ephemeral dust (standard since v29.0). Eclair v0.14.0
(2026-05-21) shipped the final form and bumped its Bitcoin Core
dependency to v30.x for exactly those policies; as of September 2026
zero_fee_commitments does not appear in the LND or CLN source
trees, so assume option_anchors when interoperating with them.
Dual-funded (BOLT 2 v2)
Both parties contribute inputs to the funding tx → can have non-zero balance for both sides at open time.
Messages:
Установить lightning-channels в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobВложенные файлы
FAQ
Что делает скилл lightning-channels?
Lightning channel mechanics: funding tx, commitment tx, anchor outputs, zero-fee commitments (v3/TRUC), to_local / to_remote outputs, dual-funded (v2), zero-conf, wumbo, taproot channels, splicing. Quick refs: state machine, commitment tx structure, force-close flow. USE WHEN: opening/closing channels, debugging force-closes, designing channel UX, evaluating anchor vs static-remote-key tradeoffs.
Как установить скилл lightning-channels?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл lightning-channels запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic