ElementsProject / lightning

Core Lightning — Lightning Network implementation focusing on spec compliance and performance
Other
2.85k stars 902 forks source link

Allow 0-conf splices #7002

Open JssDWt opened 9 months ago

JssDWt commented 9 months ago

In the current splicing flow, there is no way to set the minimum required chain confirmations. It would be useful to be able to set the minimum amount of chain confirmations to 0 in the context of an LSP that operates with 0-conf channels.

Typical splicing flow (see comment at splice_init):

RESULT=$(lightning-cli listpeerchannels);
CHANNEL_ID=$(echo $RESULT| jq -r ".channels[0].channel_id");
echo $RESULT;

RESULT=$(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true);
INITIALPSBT=$(echo $RESULT | jq -r ".psbt");
echo $RESULT;

# This could use a mindepth parameter, like fundchannel.
RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT);
PSBT=$(echo $RESULT | jq -r ".psbt");
echo $RESULT;

RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT);
PSBT=$(echo $RESULT | jq -r ".psbt");
echo $RESULT;

RESULT=$(lightning-cli signpsbt -k psbt="$PSBT");
PSBT=$(echo $RESULT | jq -r ".signed_psbt");
echo $RESULT;

lightning-cli splice_signed $CHANNEL_ID $PSBT
JssDWt commented 8 months ago

@ddustin What are your thoughts on adding the mindepth parameter in order to allow for zero conf splices?

ddustin commented 8 months ago

@ddustin What are your thoughts on adding the mindepth parameter in order to allow for zero conf splices?

It's definitely on the radar. There's a lot of discussion around if we can do them safely and, if so, what are the restrictions that make them safe.

JssDWt commented 3 weeks ago

@ddustin What is the state of this discussion?

ddustin commented 1 day ago

I don't believe anyone's working on zero conf splices at the moment

JssDWt commented 1 day ago

I don't believe anyone's working on zero conf splices at the moment

The splicing spec has changed in meantime to allow 0-conf splices. It now uses acceptable depth rather than 6 confirmations

This comment speaks of multiple unconformed splices.

So spec-wise this should be possible now.