lightning-splice_signed

lightning-splice_signed -- Command to initiate a channel to a peer

SYNOPSIS

(WARNING: experimental-splicing only)

splice_signed channel_id psbt [sign_first]

DESCRIPTION

Command added in v23.08.

splice_signed is a low level RPC command which finishes the active channel splice associated with channel_id.

The psbt must have all signatures attached to all inputs that you have added to it or it will fail.

  • channel_id (hash): The channel id of the channel to be spliced.
  • psbt (string): The final version of the psbt to complete the splice with.
  • sign_first (boolean, optional): A flag that makes our node offer the final splice signature first (defaults to false). When false, the node will calculate who should sign first based off who is adding inputting the least sats to the splice as per spec.

EXAMPLE USAGE

In this example we funded the psbt from our lightning node, so we can use the lightning node to sign for its funds.

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

lightning-cli splice_signed $CHANNEL_ID $PSBT

Here is a full 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.

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

RESULT=$(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT)
PSBT=$(echo $RESULT | jq -r ".psbt")
echo $RESULT

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

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

lightning-cli splice_signed $CHANNEL_ID $PSBT

RETURN VALUE

On success, an object is returned, containing:

  • tx (hex): The hex representation of the final transaction that is published.
  • txid (txid): The txid is of the final transaction.

JSON EXAMPLE

Example 1:

Request:

{
  "id": "example:splice_signed#1",
  "method": "splice_signed",
  "params": {
    "channel_id": "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc",
    "psbt": "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEOIFZ3chw1pCSiPW3MfJCQNuUFrmhlDgnVlzO0t+cwA6TcAQ8EAAAAAAEQBAAAAAAM/AlsaWdodG5pbmcBCCvyYqqdIt0mAAEA9gIAAAAAAQGLpTM0gWEqICjgcZNyoPhzdB5fNZBrEFbsNpsKHrTd9wEAAAAA/f///wJAQg8AAAAAACIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNAS8PAAAAAAAiUSBj/+5Op9UebK35CG4oaiUnkiqqJbjFOuvzL6MqCmJ/WgJHMEQCIBZa5i8jVPdfV4pbIzSebMb5RN+l5lJkQKAw9+ivAWfnAiBNhehz79143DbFOoTjmPYVErlY0FLlVqojX9wat0aKXgEhA9dFRFyTYmZfIuDZbp52byc/MmDeo5yKdr+gXdJoTdzPGAAAAAEBKwEvDwAAAAAAIlEgY//uTqfVHmyt+QhuKGolJ5IqqiW4xTrr8y+jKgpif1oBDiBWd3IcNaQkoj1tzHyQkDblBa5oZQ4J1ZcztLfnMAOk3AEPBAEAAAABEAT9////ARNACI9TcWG+6uC9ElBFN3qhND7amsor/dtBhJ5ujEQAT/80548avrt7d7IJiOAaCNzzYLSXITdL2xjx6mhbBi9hTiEWkUUygSpECk12bHHNORk2lKNArhHgEuW6Gtnvum52ylMJAMLMqxcAAAAADPwJbGlnaHRuaW5nAQg5j4QWOQoUFAABAwhOfA0AAAAAAAEEIlEgeDY1X9yKgtxMsAp3LFVUFR0GOEpN1l6NP2isCFZrhL4hB7nAxoROEqUxyWjlXFUHjsFtm/dr6SkP2H0cynK0g5oXCQDWuWnTBAAAAAz8CWxpZ2h0bmluZwEIxt4P7eqf3+QAAQMI4MgQAAAAAAABBCIAIFuM07kUz2fN2Ppic8kwNT3TZHZzT72WIQLC31O5CIDNDPwJbGlnaHRuaW5nAQji6kH6aOXoAgA="
  }
}

Response:

{
  "tx": "020000000001025677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0000000000000000005677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc0100000000fdffffff024e7c0d00000000002251207836355fdc8a82dc4cb00a772c5554151d06384a4dd65e8d3f68ac08566b84bee0c81000000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cd0400473044022053269f3951a1fc942174ac0dde8462405a86c89b31b444890664ee9735872cff02204cd822c4456c15e90ad342b23e9bb252d383d4e17a8a04818c4919e4fd61efd80147304402205ac0787c79e74ebfa0eaf18964625c53eb672cc4bed2c65303bd9cc192dad6f902206c6c0cded47201dae0020f50a8998555e654d3420c64e801fc668238e3c1cdfa0147522102324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b2102e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5752ae0140088f537161beeae0bd125045377aa1343eda9aca2bfddb41849e6e8c44004fff34e78f1abebb7b77b20988e01a08dcf360b49721374bdb18f1ea685b062f614e6c000000",
  "txid": "f00d5e230b401274c88d3e6205e2c6117028cb9878b7d2bc52b1441f0b589427"
}

AUTHOR

Dusty <@dusty\_daemon> is mainly responsible.

SEE ALSO

lightning-splice_init(7), lightning-splice_update(7)

RESOURCES

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