Repository navigation
Milestone 4: Co-op Channel Closes #98
Description
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
-
init - (
ping,pong) -
open_channel -
accept_channel -
funding_created -
funding_signed -
channel_ready -
shutdown -
closing_complete(smite: addclosing_completecodec #105) -
closing_sig(smite: addclosing_sigcodec #109)
Operations
For funding flow:
-
BuildOpenChannel -
SendOpenChannel -
RecvAcceptChannel -
CreateFundingTransaction -
BuildFundingCreated(smite-ir: implementBuildFundingCreatedandSendFundingCreatedoperation #120) -
SendFundingCreated(smite-ir: implementBuildFundingCreatedandSendFundingCreatedoperation #120) -
RecvFundingSigned -
SendChannelReady -
RecvChannelReady
For closing flow:
-
SendShutdown(smite-ir: add SendShutdown operation #162) -
RecvShutdown(smite-ir: add RecvShutdown operation #163) -
CreateClosingTransaction -
BuildClosingComplete -
SendClosingComplete -
RecvClosingSig -
BroadcastTransaction -
MineBlocks
Generator
-
ChannelCloseGenerator:
emits instructions for channel close flow with:
CreateClosingTransactionBuildClosingCompleteSendClosingCompleteRecvClosingSig
assumes option_simple_close was negotiated
Activity
morehouse commentedon Jun 4, 2026
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.
ekzyis commentedon Jun 10, 2026
I updated the description now.
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.NishantBansal2003 commentedon Oct 6, 2026
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: