As discussed with @rustyrussell, this issue tracks the implementation of the "Simple Close" protocol as defined in the BOLT 2 specifications. The goal is to move away from the legacy iterative fee negotiation (closing_signed) which often stalls due to fee-rate disagreements, and instead adopt the simpler, one-shot negotiation using closing_complete and closing_sig.
Background
The current mutual close negotiation requires both parties to agree on a fee. If fee-rates change rapidly or nodes have different fee-rate sources, they can get stuck in a loop.
The new "Simple Close" protocol (option_simple_close) simplifies this by allowing each peer to create their own version of the closing transaction:
- Symmetric Initiation: Each peer independently sends a
closing_complete message containing their desired fee and their scriptpubkey.
- Independent Transactions: Each peer pays the fee for the transaction they propose.
- Simple Acceptance: Upon receiving
closing_complete, the recipient simply signs that transaction and sends back closing_sig.
- Resolution: This results in two valid, but conflicting, closing transactions. Either can be broadcast and the network will simply confirm whichever one reaches a block first.
- Dust Management: If an output is dust, it must be omitted.
- In high-fee environments where both outputs might be dust, the protocol uses an
OP_RETURN with a 0 value to ensure the transaction remains valid and relayable.
- CPFP over High Fees: The spec notes that nodes should prefer low fees and rely on CPFP (Child Pays For Parent) for urgency, though RBF is supported by re-sending
closing_complete.
- Race Condition Handling: If both nodes update their
closer_scriptpubkey simultaneously, they may receive a signature for an outdated script. We will implement the spec-mandated check: if scripts mismatch, ignore the closing_sig and reconnect to reset.
Technical Details (BOLT 2/3 Compliance)
- Message Flow: Both peers MUST send
closing_complete and receive closing_sig.
- Fee Logic: The peer sending
closing_complete (the "closer") pays the fee.
- Output Omission: A peer can choose to omit their own output (e.g., if it's below dust or they want to donate it to fees) by sending an
OP_RETURN script.
- RBF Support: The transaction
sequence must be set to 0xFFFFFFFD to allow for fee bumping by re-sending closing_complete.
Proposed Implementation Plan
Technical References
As discussed with @rustyrussell, this issue tracks the implementation of the "Simple Close" protocol as defined in the BOLT 2 specifications. The goal is to move away from the legacy iterative fee negotiation (
closing_signed) which often stalls due to fee-rate disagreements, and instead adopt the simpler, one-shot negotiation usingclosing_completeandclosing_sig.Background
The current mutual close negotiation requires both parties to agree on a fee. If fee-rates change rapidly or nodes have different fee-rate sources, they can get stuck in a loop.
The new "Simple Close" protocol (
option_simple_close) simplifies this by allowing each peer to create their own version of the closing transaction:closing_completemessage containing their desired fee and theirscriptpubkey.closing_complete, the recipient simply signs that transaction and sends backclosing_sig.OP_RETURNwith a0value to ensure the transaction remains valid and relayable.closing_complete.closer_scriptpubkeysimultaneously, they may receive a signature for an outdated script. We will implement the spec-mandated check: if scripts mismatch, ignore theclosing_sigand reconnect to reset.Technical Details (BOLT 2/3 Compliance)
closing_completeand receiveclosing_sig.closing_complete(the "closer") pays the fee.OP_RETURNscript.sequencemust be set to0xFFFFFFFDto allow for fee bumping by re-sendingclosing_complete.Proposed Implementation Plan
option_simple_closewas negotiated.closing_complete.closing_sigmatches the most recently sentcloser_scriptpubkey.OP_RETURNfallback for the "all-dust" corner case.developerflag or configuration to forceoption_simple_closein tests.OP_RETURN.closing_completethe last one will prevail.tests/verifying the one-shot close with various fee scenarios.Technical References