Channels

From claude-dev-suite/claude-dev-suite · View interactive version

Channels is an AI agent skill from the GitHub repository claude-dev-suite/claude-dev-suite. 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 channe

How to use this skill

Skill file

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

  1. Open — open_channel → accept_channel → on-chain funding tx

→ funding_locked (after min_depth).

  1. Update — exchange update_add_htlc / commitment_signed /

revoke_and_ack to flow funds.

  1. Close — cooperative (shutdown + closing_complete /

closing_sig, or legacy closing_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:

outpoint.

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:

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):

immediately by themselves and after 16 blocks by anyone.

(or claimed by anyone after 16 blocks via the public path).

types by 1 block, to_local by to_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:

form a v3 package under TRUC's topology limits.

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).

disagreement, the funder's fee reserve, and the force-closes caused

by mempool feerate spikes.

the standard P2A script OP_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.

is 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:

Use case: liquidity-providing services, side-by-side funding.

Zero-conf channels (BOLT 9 bits 50/51)

Both parties agree to treat the channel as "open" before the funding

tx confirms. Uses scid_alias (BOLT 9 bits 46/47) to give the channel a

short channel ID before any block confirmation.

Use case: LSPs (JIT channel open during a payment).

Risk: if the funder doesn't publish the funding tx (or mempool drops

it), receiver loses HTLCs that flowed through.

Wumbo (BOLT 9 bit 18)

Channels > 0.16777216 BTC (the legacy max from option_support_large_channel).

With wumbo, channels can be arbitrarily large (network-defined limits

remain).

Taproot channels — `option_simple_taproot` (bits 80/81)

"Simple Taproot Channels":

smaller witness in cooperative case.

Fully cooperative spend = 1 input, 1 sig, key-path spend.

The bits live in the extension BOLT bolt-simple-taproot.md (merged

into lightning/bolts on 2026-05-04), not in BOLT 9 — 09-features.md

has no taproot row, and bits 56/57 are the proposed trampoline pair

(lightning/bolts#836, still open as of September 2026). The staging

pair option_simple_taproot_staging (180/181) is the pre-finalization

variant older deployments still speak.

open_channel for this type MUST NOT set announce_channel, so every

taproot channel is private until the taproot gossip extension lands

(lightning/bolts#1059, still an open draft as of September 2026).

Splicing — `option_splice` (BOLT 9 bits 62/63)

Merged into BOLT 2 on 2026-03-23 (lightning/bolts PR #1160).

Modify channel capacity without closing/reopening:

Atomic: previous channel state continues with new funding output. The

channel must be quiescent (stfu, option_quiesce bits 34/35) before

splice_init, and only the quiescence initiator may send it.

Implementation status as of September 2026: CLN has splicing enabled

by default since v26.04 (2026-04-20), with splicein / spliceout

RPCs; LDK has supported it since rust-lightning 0.2 (2025-12-02), with

the production feature bit settled in 0.2.2 (2026-02-06); LND has no

splice RPC as of v0.21.3-beta (2026-09-02) — lnrpc/lightning.proto

on master carries no splice message and lnd#8245 is still open.

Closing

Cooperative — `option_simple_close` (BOLT 9 bits 60/61)

shutdown exchange with each side's scriptpubkey. Then each side

independently sends closing_complete (type 40) and gets back

closing_sig (type 41). No fee haggling: the closer picks

fee_satoshis, subtracts it from its own output, and the closee

just signs. Both directions run, so up to two signed close txs exist

and either can be broadcast. Sending a fresh closing_complete

overrides the previous one — that is how a coop close is RBF'd.

Final tx broadcast — single tx, no CSV delay, no anchors needed.

Cooperative — legacy `closing_signed`

Only when option_simple_close is NOT negotiated. Iterative fee

negotiation: each side proposes fee_satoshis in closing_signed

until the two converge. BOLT 2 files this under "Legacy Closing

Negotiation" as of the option_simple_close merge (2025-02-12).

Unilateral (force-close)

One party broadcasts their latest commitment. Counterparty must:

key within to_self_delay to claim entire channel.

Common bugs

lose anchor sats.

fees + delay.

steals channel.

fee-bumping impossible, commitment stuck at low rate. Not a problem

on zero_fee_commitments channels, where your own unencumbered

channel outputs can fund the child.

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.