Skip to content

Commit a912d64

Browse files
committed
Prevent empty commitment transactions
As suggested by @JssDWt
1 parent 95f7ad1 commit a912d64

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

blip-0030.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,19 @@ When receiving `accept_channel2`:
8383
`accept_channel2`:
8484
* MUST send an `error` and forget the channel
8585

86-
When sending or receiving `update_add_htlc`:
86+
When sending `update_add_htlc`:
8787

8888
* If `zero_reserve` has been negotiated:
8989
* MUST ignore any channel reserve standard requirement
90+
* If the resulting commitment transaction would have no outputs:
91+
* MUST NOT send `update_add_htlc`
92+
93+
When receiving `update_add_htlc`:
94+
95+
* If `zero_reserve` has been negotiated:
96+
* MUST ignore any channel reserve standard requirement
97+
* If the resulting commitment transaction would have no outputs:
98+
* MUST send an `error` and fail the channel
9099

91100
If the channel is not public, both nodes:
92101

@@ -98,6 +107,14 @@ If the channel is not public, both nodes:
98107
The use of zero-reserve is symmetrical: it is either offered to both nodes or
99108
unused.
100109

110+
In theory, the channel could be in a state where the commitment transaction has
111+
no outputs, if all of the channel liquidity is allocated to pending dust HTLCs.
112+
This state wouldn't make sense: all of the channel value would be burned to
113+
miner fees. We make sure we never get into this state. In practice though, this
114+
should never happen since nodes set `max_dust_htlc_exposure_msat` to ensure
115+
that dust HTLCs don't grow unbounded and set `max_htlc_value_in_flight_msat` to
116+
restrict their exposure to pending HTLCs.
117+
101118
### Fraud proofs
102119

103120
If one of the nodes publishes a revoked commitment, the other node can create

0 commit comments

Comments
 (0)