Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement option_simple_close (simpler variant) #2967

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Dec 17, 2024

Implement option_simple_close as defined in the last update to lightning/bolts#1096

Hopefully this is the last time we change the mutual close protocol! And at some point that will let us entirely remove all the code supporting the two previous mutual close protocols (this is why I kept the code as separate as possible instead of trying to fit into the existing NEGOTIATING state).

Note that this is a prerequisite for taproot channels: this protocol allows nodes to safely exchange nonces in shutdown, closing_complete and closing_sig to spend a musig2 channel output.

This forks off #2747 (which we currently keep in case the final version of the spec chosen matches one of its commits).

This feature adds two new messages:

- `closing_complete` sent after exchanging `shutdown`
- `closing_sig` sent in response to `closing_complete`
The spec allows the closer to use an OP_RETURN output if their amount is
too low when using `option_simple_close`.
We introduce a new `NEGOTIATING_SIMPLE` state where we exchange the
`closing_complete` and `closing_sig` messages, and allow RBF-ing previous
transactions and updating our closing script.

We stay in that state until one of the transactions confirms, or a force
close is detected. This is important to ensure we're able to correctly
reconnect and negotiate RBF candidates.

We keep this separate from the previous `NEGOTIATING` state to make it
easier to remove support for the older mutual close protocols once we're
confident the network has been upgraded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant