2024-01-15 13:35:14 -08:00
{
"$schema" : "../rpc-schema-draft.json" ,
"type" : "object" ,
"added" : "v23.08" ,
"rpc" : "splice_init" ,
"title" : "Command to initiate a channel to a peer" ,
"warning" : "experimental-splicing only" ,
"description" : [
"`splice_init` is a low level RPC command which initiates a channel splice for a given channel specified by `channel_id`."
] ,
"request" : {
"required" : [
"channel_id" ,
"relative_amount"
] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : false ,
2024-01-15 13:35:14 -08:00
"properties" : {
"channel_id" : {
"type" : "hash" ,
"description" : [
"The channel id of the channel to be spliced."
]
} ,
"relative_amount" : {
"type" : "integer" ,
"description" : [
2025-04-19 19:48:45 -04:00
"A positive or negative amount of satoshis to add or subtract from the channel. Note you may need to add a double dash (--) after splice_init if using a negative *relative_amount* so it is not interpretted as a command modifier. For example:" ,
"```shell" ,
"lightning-cli splice_init -- $CHANNEL_ID -100000" ,
"```"
2024-01-15 13:35:14 -08:00
]
} ,
"initialpsbt" : {
"type" : "string" ,
"description" : [
"The (optional) base 64 encoded PSBT to begin with. If not specified, one will be generated automatically."
]
} ,
"feerate_per_kw" : {
"type" : "u32" ,
"description" : [
"The miner fee we promise our peer to pay for our side of the splice transaction. It is calculated by `feerate_per_kw` * our_bytes_in_splice_tx / 1000."
]
} ,
"force_feerate" : {
"type" : "boolean" ,
"description" : [
"By default splices will fail if the fee provided looks too high. This is to protect against accidentally setting your fee higher than intended. Set `force_feerate` to true to skip this saftey check."
]
}
}
} ,
"response" : {
"required" : [
"psbt"
] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : false ,
2024-01-15 13:35:14 -08:00
"properties" : {
"psbt" : {
"type" : "string" ,
"description" : [
"The (incomplete) PSBT of the splice transaction."
]
}
}
} ,
2024-06-20 16:06:01 -07:00
"usage" : [
"Here is an example set of splice commands that will splice in 100,000 sats to the first channel that comes out of `listpeerchannels`." ,
2024-01-15 13:35:14 -08:00
"" ,
2024-06-20 16:06:01 -07:00
"The example assumes you already have at least one confirmed channel." ,
2024-01-15 13:35:14 -08:00
"" ,
2024-06-20 16:06:01 -07:00
"1: Get the channel id of the first channel." ,
2024-01-15 13:35:14 -08:00
"" ,
2024-06-20 16:06:01 -07:00
"```shell" ,
"CHANNEL_ID=$(echo $(lightning-cli listpeerchannels) | jq -r \".channels[0].channel_id\")" ,
2024-01-15 13:35:14 -08:00
"```" ,
2024-06-20 16:06:01 -07:00
"2: Get the PSBT from fundpsbt." ,
2024-01-15 13:35:14 -08:00
"" ,
"```shell" ,
2024-06-20 16:06:01 -07:00
"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 the PSBT with the splice_update command." ,
2024-01-15 13:35:14 -08:00
"" ,
2024-06-20 16:06:01 -07:00
"```shell" ,
"PSBT_SPLICE_UPDATE=$(echo $(lightning-cli splice_update $CHANNEL_ID $PSBT_SPLICE_INIT) | jq -r \".psbt\")" ,
"```" ,
"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" : [
2025-12-17 11:30:56 -08:00
"Dusty [@dusty_daemon](mailto:@dustydaemon) is mainly responsible."
2024-06-20 14:57:02 -07:00
] ,
"see_also" : [
"lightning-splice_signed(7)" ,
"lightning-splice_update(7)"
] ,
"resources" : [
2025-12-17 11:30:56 -08:00
"Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
2024-06-20 14:57:02 -07:00
] ,
"examples" : [
2024-01-15 13:35:14 -08:00
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:splice_init#1" ,
"method" : "splice_init" ,
"params" : {
2024-08-09 22:44:53 -07:00
"channel_id" : "channelid0780000780000780000780000780000780000780000780000780000" ,
2024-03-27 18:45:18 -07:00
"relative_amount" : 100000 ,
2024-08-09 22:44:53 -07:00
"initialpsbt" : "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000"
2024-03-27 18:45:18 -07:00
}
} ,
"response" : {
2024-08-09 22:44:53 -07:00
"psbt" : "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000"
2024-01-15 13:35:14 -08:00
}
} ,
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:splice_init#2" ,
"method" : "splice_init" ,
2024-07-18 00:28:22 -07:00
"params" : [
2024-08-09 22:44:53 -07:00
"channelid0780000780000780000780000780000780000780000780000780000" ,
2024-07-18 00:28:22 -07:00
-105000 ,
2024-08-09 22:44:53 -07:00
"cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000"
2024-07-18 00:28:22 -07:00
]
2024-03-27 18:45:18 -07:00
} ,
"response" : {
2024-08-09 22:44:53 -07:00
"psbt" : "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000"
2024-01-15 13:35:14 -08:00
}
}
]
}