LIGHTNING-SPLICE_UPDATE(7)

πŸ“¦
version 26.06.9 Β· 2 versions
, in nixpkgs unstable

πŸ’… LIGHTNING-SPLICE_UPDATE(7) β€” the group-chat edition πŸ’…

okay so bestie, you opened up LIGHTNING-SPLICE_UPDATE(7) and you want the tea β˜•. This is the manual page for splice_update, and honestly it's giving "low-level but iconic". Everything you need is right here, no cap. 🫢


✨ NAME ✨

splice_update β€” literally the command to initiate a channel to a peer πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

splice_update channel_id psbt

🌸 DESCRIPTION 🌸

okay so first thing: this command was added in v23.08, so if you're on something ancient, that's a you problem, not a me problem πŸ™ˆ.

splice_update is a low level RPC command which updates the active channel splice associated with channel_id. low level means low level β€” it's not gonna hold your hand, she expects you to know what a PSBT is πŸ’….

The vibe check that matters most: you have to call splice_update repeatedly until the result commitments_secured is true. That's the whole game. Each time you call it, it hands you a new PSBT that may have changes in it. In the simplest case, you literally take the returned psbt and pass it right back into splice_update for the incoming psbt field. iconic loop behavior, honestly πŸŒ€.

For the more complex, main-character use cases: you're allowed to modify the PSBT both before calling splice_update and in between subsequent calls, all the way until commitments_secured is true. But the second it's true? You can no longer make modifications to the PSBT (beyond signing, which comes later with splice_signed). so don't get cute after the finish line 🚫.

Each splice_update result may include changes to the PSBT specified by your channel peer. you can review these changes between calls to do additional validation or strategy adjustment. yes, that means you're allowed to be nosy. peek at what your peer changed, bestie πŸ‘€.

Typically, splice_update will return commitments_secured as true after one call β€” but you should assume it will need multiple calls. trust issues are valid. πŸ”₯

  • channel_id (hash) β€” the channel id of the channel to be spliced.
  • psbt (string) β€” the base 64 encoded PSBT returned from splice_init with any changes added by the user. yes, base 64, write that down πŸ“.

πŸŽ€ RETURN VALUE πŸŽ€

On success, an object is returned, containing:

  • psbt (string) β€” the (incomplete) PSBT of the splice transaction. incomplete!! she's a work in progress πŸ’…
  • commitments_secured (boolean) β€” whether or not the commitments were secured.
  • signatures_secured (boolean) β€” whether or not the peer sent us their signatures for this splice (added v24.11). πŸŽ€

πŸ‘‘ AUTHOR πŸ‘‘

Dusty @dusty_daemon is mainly responsible. give credit where credit is due, periodt πŸ‘‘.

πŸ¦‹ SEE ALSO πŸ¦‹

lightning-splice_init(7), lightning-splice_signed(7) β€” read these too, bestie, they're the rest of the saga 🫢

🌈 RESOURCES 🌈

Main web site: https://github.com/ElementsProject/lightning

πŸ“ USAGE πŸ“

here's an example way to call splice_update. this is the classic "keep calling until it's done" loop πŸŒ€:

RESULT={"commitments_secured":false}
while [[ $(echo $RESULT | jq -r ".commitments_secured") == "false" ]]
do
  RESULT=$(lightning-cli splice_update $CHANNEL_ID $PSBT)
  PSBT=$(echo $RESULT | jq -r ".psbt")
  echo $RESULT
done

Before each call to splice_update you have the opportunity to make additional changes. that's your moment, your window, your era ✨.

And here's an example set of splice commands that will splice in 100,000 sats to the first channel that comes out of listpeerchannels. the example assumes you already have at least one confirmed channel (sorry, can't manifest one for you 😭).

  1. Get the channel id of the first channel.
CHANNEL_ID=$(echo $(lightning-cli listpeerchannels) | jq -r ".channels[0].channel_id")
  1. Get the PSBT from fundpsbt.
INITIALPSBT=$(echo $(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true) | jq -r ".psbt")
  1. Initiate the splice by passing channel id and initialpsbt received from above steps.
PSBT_SPLICE_INIT=$(echo $(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT) | jq -r ".psbt")
  1. Update PSBTs with the splice_update command.
RESULT={"commitments_secured":false}
while [[ $(echo $RESULT | jq -r ".commitments_secured") == "false" ]]
do
  PSBT_SPLICE_UPDATE=$(echo $(lightning-cli splice_update $CHANNEL_ID $PSBT_SPLICE_INIT) | jq -r ".psbt")
  echo $PSBT_SPLICE_UPDATE
done
  1. Sign the updated PSBT.
SIGNPSBT=$(echo $(lightning-cli signpsbt -k psbt="$PSBT_SPLICE_UPDATE") | jq -r ".signed_psbt")
  1. Finally, call splice_signed with channel id and signed PSBT parameters.
$ lightning-cli splice_signed $CHANNEL_ID $SIGNPSBT

🧚 EXAMPLES 🧚

Example 1 🌟

Request:

$ lightning-cli splice_update -k "channel_id"="channelid0780000780000780000780000780000780000780000780000780000" "psbt"="cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000"
{
  "id": "example:splice_update#1",
  "method": "splice_update",
  "params": {
    "channel_id": "channelid0780000780000780000780000780000780000780000780000780000",
    "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000"
  }
}

Response:

{
  "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200",
  "commitments_secured": true,
  "signatures_secured": true
}

Example 2 🌟

Request:

$ lightning-cli splice_update "channelid0780000780000780000780000780000780000780000780000780000" "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000"
{
  "id": "example:splice_update#2",
  "method": "splice_update",
  "params": [
    "channelid0780000780000780000780000780000780000780000780000780000",
    "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000"
  ]
}

Response:

{
  "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000",
  "commitments_secured": true,
  "signatures_secured": true
}

and that's the whole page, bestie πŸŽ€ go forth and splice something iconic. this little love letter came to you from Core Lightning v26.06.9 β€” mwah πŸ’œπŸ§šβœ¨

πŸ“¦ where this page comes from