AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 60 Bitcoin

Count zero-fee-commitments channels in anchor reserve check

Public commit record

What the developer wrote

Authored by Elias Rohrer

83/100 · Strong
Count zero-fee-commitments channels in anchor reserve check

`can_support_additional_anchor_channel` decides whether the wallet has
enough on-chain reserve to back another anchor channel by counting the
node's existing anchor channels. The classification only checked the
`anchors_zero_fee_htlc_tx` feature, so channels negotiated with the
`anchor_zero_fee_commitments` (TRUC / 0FC, option 41) variant — which
require the same on-chain reserve to fund commitment / HTLC fee bumps
on force-close — were silently dropped from the count.

A node enabling `negotiate_anchor_zero_fee_commitments` would therefore
be green-lit to open more anchor channels than its wallet can actually
back, risking unfunded fee bumps and HTLC loss on simultaneous
force-closes.

Treat both feature flags as marking a channel as an anchor channel for
reserve-accounting purposes (factored into a small `is_anchor_channel_type`
helper, used in both the chain-monitor and channel-manager loops), and
add a regression test that opens a single 0FC channel with reserves
sized for exactly one channel and asserts the function refuses to
authorize a second.

Co-Authored-By: HAL 9000
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes an accounting bug in the Lightning Dev Kit. When a node uses a newer type of anchor-backed channel (called TRUC or zero-fee-commitments), the software was not counting that channel when checking whether the wallet still has enough on-chain money set aside for emergency fee bumps. That could let the node open more anchor channels than it can actually afford to close safely, raising the risk of being unable to pay fees to claim funds during a force close. The fix counts both old and new anchor channel types the same way and adds a regression test.

Recommended action

Upgrade to a release containing this commit for any node that enables negotiate_anchor_zero_fee_commitments. Until upgraded, operators should avoid relying on the automated anchor reserve check when opening multiple TRUC/0FC anchor channels and should manually ensure sufficient on-chain reserves.

Security signals we found

01

Reserve-accounting bug for anchor channels

02

Newer channel type (anchor_zero_fee_commitments / TRUC / option 41) omitted from safety check

03

Risk of over-committing on-chain reserves, leading to unfunded fee bumps on force close

04

Regression test added to prevent future omission

Risk score

Why this scored 60/100

Our methodology →
Potential impact 18/30
Exploitability 8/25
Stealth signal 10/15
Affected reach 10/15
Confidence 9/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.