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

Error if the calculated v1 reserve is greater than the channel value

Public commit record

What the developer wrote

Authored by Leo Nash

65/100 · Adequate
Error if the calculated v1 reserve is greater than the channel value

We made the same change to the calculation of the v2 reserve in the
previous commit.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit tightens how Lightning Dev Kit calculates the channel reserve for older-style (v1) channels. The reserve is a portion of channel funds that must stay untouched to guarantee both parties can pay penalties if someone cheats. Previously, a misconfigured or malicious proportion could make the calculated reserve exceed the entire channel value, or a tiny channel/dust limit could produce a nonsensical reserve. Now the code rejects those cases outright and also caps the proportional reserve at 100%. The change is defensive: it prevents opening channels with impossible reserve settings rather than silently accepting them.

Recommended action

Treat this as a hardening fix rather than an active vulnerability. Review the preceding v2 reserve commit for consistency, run the updated test suite, and consider whether any downstream callers or bindings need to handle the new `Result` return type. No immediate incident response is indicated by the diff alone.

Security signals we found

01

Input validation added to channel reserve calculation

02

Proportional reserve capped at 100% to prevent reserve exceeding channel value

03

Error returned instead of silently clamping reserve to channel value

04

Dust limit and minimum reserve sanity checks added

05

Tests added for reserve greater than channel value

Risk score

Why this scored 59/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 7/10
Evidence quality 4/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.