ElementsProject / ElementsProject/lightning
Failure to reject `dust_limit_satoshis` below 354 sat
- Dominant language
- C
- Stars
- 3.1k
- Forks
- 1k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 13
Description
BOLT 2 [requires](https://github.com/lightning/bolts/blob/35e79db504560b9d3494a0ed07bf1e8379c3663a/02-peer-protocol.md?plain=1#L870) the receiver of `open_channel` to fail the channel when `dust_limit_satoshis < 354`. CLN has no such bounds check on the peer's dust limit, and a peer can open a channel with a dust limit as low as 1 sat.
### Impact
Both `openingd` and `dualopend` are affected. The immediate effect is that the peer's commitment transactions can end up being non-standard (containing dust outputs) and will be rejected from the mempool. This is very bad for the peer but only becomes an issue for CLN if it needs the peer to force close for some reason (e.g., data loss recovery). Other than that, this is purely a spec-compliance issue.
### Discovery
This bug was found while fuzzing the v1 funding protocol with [smite](https://github.com/lnfuzz/smite).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how the peer's dust_limit_satoshis is handled in openingd and dualopend during the v1 funding protocol. Compare the handling with the BOLT 2 requirement linked in the issue, and use the existing protocol coverage or fuzzing setup to verify the behavior. Done means a peer value below 354 sat is rejected in both affected paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100