Skip to content

Milestone 4: Co-op Channel Closes #98

Open

Description

@ekzyis

Fuzz scenario

PostChannelReadySetup: We want to fuzz starting with shutdown followed by closing_complete and closing_sig, so we need to have an open, ready channel and option_simple_close must have been negotiated during init exchange. Therefore, the scenario setup would be a modified or extended version of PostInitSetup which includes option_simple_close, opening a channel and waiting for channel_ready:

  Smite                         Target
    |                              |
    |----------- init ------------>|
    |    *option_simple_close*     |
    |<---------- init -------------|
    |    *option_simple_close*     |
    |                              |
    |-------- open_channel ------->|
    |<------ accept_channel -------|
    |------- funding_created ----->|
    |<------ funding_signed -------|
    |                              |
    |  [tx broadcast+mine blocks]  |
    |                              |
    |------- channel_ready ------->|
    |<------ channel_ready --------|
    |                              |
    |---------- ping ------------->|
    |<--------- pong --------------|
    |                              |
    +---------- SNAPSHOT ----------+

During fuzzing, a mutual close is negotiated with a shutdown exchange. Since there are no pending HTLCs, an exchange of closing_complete and closing_sig should immediately follow:

  Smite                         Target
    +---------- SNAPSHOT ----------+
    |                              |
    |---------- shutdown --------->|
    |<--------- shutdown ----------|
    |                              |
    |------ closing_complete ----->|
    |<----- closing_complete ------|
    |                              |
    |--------- closing_sig ------->|
    |<-------- closing_sig --------|

Advanced scenarios could fuzz additional exchanges of closing_complete+closing_sig messages to bump fees etc.

What's needed?

Setup

  • PostChannelReadySetup: see above

Messages

Operations

For funding flow:

For closing flow:

Generator

  • ChannelCloseGenerator:

emits instructions for channel close flow with:

  • CreateClosingTransaction
  • BuildClosingComplete
  • SendClosingComplete
  • RecvClosingSig

assumes option_simple_close was negotiated

References

Activity

  1. morehouse commented on Jun 4, 2026

    @morehouse
    Collaborator

    Sounds good. With @NishantBansal2003's work on the funding flow, we should soon have all the pieces we need to open channels. I think that's the only thing blocking this work now.

  2. ekzyis commented on Jun 10, 2026

    @ekzyis
    ContributorAuthor

    I updated the description now.

    With @NishantBansal2003's work on the funding flow, we should soon have all the pieces we need to open channels

    Yes, not much is needed anymore for PostChannelReadySetup. I will start with it in a draft PR, and review/push any code that's missing for it.

  3. NishantBansal2003 commented on Oct 6, 2026

    @NishantBansal2003
    Member

    I was experimenting with the shutdown flow across all targets and found that LDK and CLN do not support option_simple_close, so we have to implement legacy closing negotiation for them.
    see:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions