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 #2747

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

Implement option_simple_close #2747

wants to merge 5 commits into from

Commits on Sep 18, 2024

  1. Configuration menu
    Copy the full SHA
    e85d838 View commit details
    Browse the repository at this point in the history
  2. Add codecs for option_simple_close

    This feature adds two new messages:
    
    - `closing_complete` sent after exchanging `shutdown`
    - `closing_sig` sent in response to `closing_complete`
    t-bast committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    2d63df2 View commit details
    Browse the repository at this point in the history
  3. Add support for OP_RETURN closing scripts

    The spec allows the closer to use an OP_RETURN output if their amount is
    too low when using `option_simple_close`.
    t-bast committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    6fc035c View commit details
    Browse the repository at this point in the history
  4. Implement the option_simple_close protocol

    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.
    t-bast committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    f6391b7 View commit details
    Browse the repository at this point in the history
  5. Add support for setting nLocktime

    We add `nLocktime` to `closing_complete`, to allow the initiator to
    decide what value to use to provide better anonymity and protection
    against fee sniping.
    t-bast committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    7fda599 View commit details
    Browse the repository at this point in the history