LN on watch-only wallet: UX problems if I don't broadcast the funding transaction
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.6k
- Forks
- 3.5k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 61
Description
Hi, while playing around lightning on testnet, I ran into the following issue: In a watch-only wallet, I was about to open a channel. But at the point where I should have switched to the normal HD-wallet to sign and broadcast the opening transaction, I wanted to change something, say spend a different amount. Since I had not touched my private keys yet, I was under the (maybe misguided?) impression that it's not too late for that yet. But trying to "cancel" the channel leads to unexpected behavior:
- Trying to close the channel will show the message "Please wait..." indefinitely.
- Trying to force-close the the channel gives a technical error message.
- I could remove the funding transaction from the history tab, but the channel was still shown. Moreover, the amount was then added to both on-chain and off-chain balances, as if I had doubled my money ;-)
I would suggest the following modifications for a more consistent UX:
- Do not allow closing or force-closing the channel before it is actually opened (at least the funding tx is broadcast)
- If the user removes the funding tx, substract the amount from the off-chain balance. Maybe put the channel into a kind of "cancelled" state? I guess it's not a good idea to delete the channel completely, since the user might already have saved the funding tx and accidentally broadcasts it later.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the watch-only wallet flow described in the issue: begin opening a channel, do not broadcast the funding transaction, then try closing or force-closing it and remove the funding transaction from history. Trace the channel state and balance updates involved. Done means the pre-broadcast channel cannot be closed incorrectly, removal does not double-count funds, and the resulting state is consistent with the proposed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- payments
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100