2024-01-15 13:35:14 -08:00
{
"$schema" : "../rpc-schema-draft.json" ,
"type" : "object" ,
"additionalProperties" : false ,
"added" : "v23.08" ,
"rpc" : "splice_update" ,
"title" : "Command to initiate a channel to a peer" ,
"warning" : "experimental-splicing only" ,
"description" : [
"`splice_update` is a low level RPC command which updates the active channel splice associated with `channel_id`." ,
"" ,
"`splice_update` must be called repeatidly until the result `commitments_secured` is `true`. Each time `splice_update` is called, it will return a new PSBT that may have changes. In the simplest case, you take the returned `psbt` and pass it back into `splice_update` for the incoming `psbt` field." ,
"" ,
"For more complex use cases, you may modify the `psbt` both before calling `splice_update` and inbetween subsequent calls until `commitments_secured` is `true`. After which point you can no long make modifications to the PSBT (beyond signing, which comes later with `splice_signed`)." ,
"" ,
"Each `splice_update` result may include changes to the PSBT specified by your channel peer. You can review these changes between calls to `splice_update` to perform additional validation or strategy adjustment." ,
"" ,
"Typically, `splice_update` will return `commitments_secured` true after one call but you should assume it will need multiple calls."
] ,
"request" : {
"required" : [
"channel_id" ,
"psbt"
] ,
"properties" : {
"channel_id" : {
"type" : "hash" ,
"description" : [
"The channel id of the channel to be spliced."
]
} ,
"psbt" : {
"type" : "string" ,
"description" : [
"The base 64 encoded PSBT returned from `splice_init` with any changes added by the user."
]
}
}
} ,
"response" : {
"required" : [
"psbt" ,
"commitments_secured"
] ,
"properties" : {
"psbt" : {
"type" : "string" ,
"description" : [
"The (incomplete) PSBT of the splice transaction."
]
} ,
"commitments_secured" : {
"type" : "boolean" ,
"description" : [
"Whether or not the commitments were secured."
]
}
}
} ,
2024-06-20 16:06:01 -07:00
"usage" : [
2024-01-15 13:35:14 -08:00
"Here is an example way to call `splice_update`" ,
"" ,
"```shell" ,
"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." ,
"" ,
2024-06-20 16:06:01 -07:00
"Here is 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." ,
"" ,
"1: Get the channel id of the first channel." ,
2024-01-15 13:35:14 -08:00
"" ,
"```shell" ,
2024-06-20 16:06:01 -07:00
"CHANNEL_ID=$(echo $(lightning-cli listpeerchannels) | jq -r \".channels[0].channel_id\")" ,
"```" ,
"2: Get the PSBT from fundpsbt." ,
2024-01-15 13:35:14 -08:00
"" ,
2024-06-20 16:06:01 -07:00
"```shell" ,
"INITIALPSBT=$(echo $(lightning-cli fundpsbt -k satoshi=100000sat feerate=urgent startweight=800 excess_as_change=true) | jq -r \".psbt\")" ,
"```" ,
"3: Initiate the splice by passing channel id and initialpsbt received from above steps." ,
2024-01-15 13:35:14 -08:00
"" ,
2024-06-20 16:06:01 -07:00
"```shell" ,
"PSBT_SPLICE_INIT=$(echo $(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT) | jq -r \".psbt\")" ,
"```" ,
"4: Update PSBTs with the splice_update command." ,
2024-01-15 13:35:14 -08:00
"" ,
2024-06-20 16:06:01 -07:00
"```shell" ,
2024-01-15 13:35:14 -08:00
"RESULT={\"commitments_secured\":false}" ,
"while [[ $(echo $RESULT | jq -r \".commitments_secured\") == \"false\" ]]" ,
"do" ,
2024-06-20 16:06:01 -07:00
" PSBT_SPLICE_UPDATE=$(echo $(lightning-cli splice_update $CHANNEL_ID $PSBT_SPLICE_INIT) | jq -r \".psbt\")" ,
" echo $PSBT_SPLICE_UPDATE" ,
2024-01-15 13:35:14 -08:00
"done" ,
2024-06-20 16:06:01 -07:00
"```" ,
"5: Sign the updated PSBT." ,
2024-01-15 13:35:14 -08:00
"" ,
2024-06-20 16:06:01 -07:00
"```shell" ,
"SIGNPSBT=$(echo $(lightning-cli signpsbt -k psbt=\"$PSBT_SPLICE_UPDATE\") | jq -r \".signed_psbt\")" ,
"```" ,
"6: Finally, call splice_signed with channel id and signed PSBT parameters." ,
2024-01-15 13:35:14 -08:00
"" ,
2024-06-20 16:06:01 -07:00
"```shell" ,
"lightning-cli splice_signed $CHANNEL_ID $SIGNPSBT" ,
2024-01-15 13:35:14 -08:00
"```"
] ,
2024-06-20 14:57:02 -07:00
"author" : [
"Dusty <<@dusty_daemon>> is mainly responsible."
] ,
"see_also" : [
"lightning-splice_init(7)" ,
"lightning-splice_signed(7)"
] ,
"resources" : [
"Main web site: <https://github.com/ElementsProject/lightning>"
] ,
"examples" : [
2024-01-15 13:35:14 -08:00
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:splice_update#1" ,
"method" : "splice_update" ,
"params" : {
"channel_id" : "5677721c35a424a23d6dcc7c909036e505ae68650e09d59733b4b7e73003a4dc" ,
"psbt" : "cHNidP8BAgQCAAAAAQMEbAAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQD2AgAAAAABAYulMzSBYSogKOBxk3Kg+HN0Hl81kGsQVuw2mwoetN33AQAAAAD9////AkBCDwAAAAAAIgAgW4zTuRTPZ83Y+mJzyTA1PdNkdnNPvZYhAsLfU7kIgM0BLw8AAAAAACJRIGP/7k6n1R5srfkIbihqJSeSKqoluMU66/MvoyoKYn9aAkcwRAIgFlrmLyNU919XilsjNJ5sxvlE36XmUmRAoDD36K8BZ+cCIE2F6HPv3XjcNsU6hOOY9hUSuVjQUuVWqiNf3Bq3RopeASED10VEXJNiZl8i4NlunnZvJz8yYN6jnIp2v6Bd0mhN3M8YAAAAAQErQEIPAAAAAAAiACBbjNO5FM9nzdj6YnPJMDU902R2c0+9liECwt9TuQiAzQEFR1IhAjJCZt6EA7OrFXoJ8feE1YevYYMcmYwVG8whu3TCsjFLIQLjvTgAmGbJ2o7EqpnMTqnGwN1G3xXGHvDOHycSkXFOV1KuAQ4gVndyHDWkJKI9bcx8kJA25QWuaGUOCdWXM7S35zADpNwBDwQAAAAAAR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