lightning-kmp icon indicating copy to clipboard operation
lightning-kmp copied to clipboard

Detect double-spent dual funded channels

Open t-bast opened this issue 2 years ago • 0 comments

When using dual funding, we cannot simply forget unconfirmed channels after 2016 blocks if we contributed to the funding amount. There are multiple funding transaction candidates, and any of them may (eventually) confirm. The only case where we can forget such an unconfirmed channel is when we have proof that all funding transaction candidates have been double-spent by a transaction that doesn't belong to the funding candidates set.

However, this is very tedious to implement on top of the electrum protocol: we would likely need to subscribe to every input of every funding transaction candidate, aggregate their status and then run non-trivial logic to verify that funding transactions were all correctly double-spent.

This isn't done right now, which means that a double-spent dual funded channel will not be detected and will stay stuck in the WaitForFundingConfirmed state.

t-bast avatar Sep 21 '22 10:09 t-bast