mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
b327bd30c3
Without this, we have hardly any enforcement. This is why the schema mistake fixed in the previous patches weren't spotted immediately. The hard work was done by: ``` $ for f in lightning-*.json; do grep -v '^ "additionalProperties": false,' $f | bagto $f; done $ for f in lightning-*.json; do sed 's/"properties": {/"additionalProperties": false, "properties": {/' $f | bagto $f; done $ make fmt-schemas ``` Then checking where 'additionalProperties: true' had been turned to false (we deliberately use it in some places where there are if statements in the schema, or occasionally where there can be arbitrary fields). [Including doc/rpc-schema-draft.json update by Shahana] Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
160 lines
8.1 KiB
JSON
160 lines
8.1 KiB
JSON
{
|
|
"$schema": "../rpc-schema-draft.json",
|
|
"type": "object",
|
|
"added": "v23.08",
|
|
"rpc": "splice_signed",
|
|
"title": "Command to initiate a channel to a peer",
|
|
"warning": "experimental-splicing only",
|
|
"description": [
|
|
"`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."
|
|
],
|
|
"request": {
|
|
"required": [
|
|
"channel_id",
|
|
"psbt"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"channel_id": {
|
|
"type": "hash",
|
|
"description": [
|
|
"The channel id of the channel to be spliced."
|
|
]
|
|
},
|
|
"psbt": {
|
|
"type": "string",
|
|
"description": [
|
|
"The final version of the psbt to complete the splice with."
|
|
]
|
|
},
|
|
"sign_first": {
|
|
"type": "boolean",
|
|
"description": [
|
|
"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."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"response": {
|
|
"required": [
|
|
"tx",
|
|
"txid"
|
|
],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"tx": {
|
|
"type": "hex",
|
|
"description": [
|
|
"The hex representation of the final transaction that is published."
|
|
]
|
|
},
|
|
"txid": {
|
|
"type": "txid",
|
|
"description": [
|
|
"The txid is of the final transaction."
|
|
]
|
|
},
|
|
"outnum": {
|
|
"added": "v24.08",
|
|
"type": "u32",
|
|
"description": [
|
|
"The index of the new funding output."
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"usage": [
|
|
"In this example we funded the psbt from our lightning node, so we can use the lightning node to sign for its funds.",
|
|
"",
|
|
"```shell",
|
|
"SIGNPSBT=$(echo $(lightning-cli signpsbt $PSBT_SPLICE_UPDATE) | jq -r \".signed_psbt\")",
|
|
"",
|
|
"lightning-cli splice_signed $CHANNEL_ID $SIGNPSBT",
|
|
"```",
|
|
"",
|
|
"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.",
|
|
"",
|
|
"```shell",
|
|
"CHANNEL_ID=$(echo $(lightning-cli listpeerchannels) | jq -r \".channels[0].channel_id\")",
|
|
"```",
|
|
"2: Get the PSBT from fundpsbt.",
|
|
"",
|
|
"```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.",
|
|
"",
|
|
"```shell",
|
|
"PSBT_SPLICE_INIT=$(echo $(lightning-cli splice_init $CHANNEL_ID 100000 $INITIALPSBT) | jq -r \".psbt\")",
|
|
"```",
|
|
"4: Update PSBTs with the splice_update command.",
|
|
"",
|
|
"```shell",
|
|
"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",
|
|
"```",
|
|
"5: Sign the updated PSBT.",
|
|
"",
|
|
"```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.",
|
|
"",
|
|
"```shell",
|
|
"lightning-cli splice_signed $CHANNEL_ID $SIGNPSBT",
|
|
"```"
|
|
],
|
|
"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>"
|
|
],
|
|
"examples": [
|
|
{
|
|
"request": {
|
|
"id": "example:splice_signed#1",
|
|
"method": "splice_signed",
|
|
"params": {
|
|
"channel_id": "f62126acb4e1a8113eb3ce40ed80e34a49d49b035cb9d36417b1c1333227112c",
|
|
"psbt": "cHNidP8BAgQCAAAAAQMEkgAAAAEEAQIBBQECAQYBAwH7BAIAAAAAAQCJAgAAAAH5+Z9NssTFQhFzAFkPSrEKg0AcgN7uwR9geC5Lqd+SfgAAAAAA/f///wJAQg8AAAAAACIAIJPe3QwmW8qGhXbT7i5Z7ruyDrwpblj37cqT1e6uwImWgWzcCwAAAAAiUSBbtDt/2hcV0N0BQWgloYUiotfssWR1uIeA6Pr8HHPviY0AAAABASuBbNwLAAAAACJRIFu0O3/aFxXQ3QFBaCWhhSKi1+yxZHW4h4Do+vwcc++JAQ4g9iEmrLThqBE+s85A7YDjSknUmwNcudNkF7HBMzInESwBDwQBAAAAARAE/f///wETQKcuGy6h+BqXM6UBaTWpiX1wgQdVDWQdu3poUITFMK4JR7Jjaqy0IsnjfOXmaFZAUIS01Heqa7RbgzHF+5qDI/AhFvTEPeeTGXjlJSGiyNDqLm+lpUC+f31Q3j7YhyeyShxZCQD2T+TUAAAAAAz8CWxpZ2h0bmluZwEImfI55kWjFBwAAQCJAgAAAAH5+Z9NssTFQhFzAFkPSrEKg0AcgN7uwR9geC5Lqd+SfgAAAAAA/f///wJAQg8AAAAAACIAIJPe3QwmW8qGhXbT7i5Z7ruyDrwpblj37cqT1e6uwImWgWzcCwAAAAAiUSBbtDt/2hcV0N0BQWgloYUiotfssWR1uIeA6Pr8HHPviY0AAAABAStAQg8AAAAAACIAIJPe3QwmW8qGhXbT7i5Z7ruyDrwpblj37cqT1e6uwImWAQ4g9iEmrLThqBE+s85A7YDjSknUmwNcudNkF7HBMzInESwBDwQAAAAAARAEAAAAAAz8CWxpZ2h0bmluZwEIo0w+EfrhL4QAAQMIzrnaCwAAAAABBCJRII+O1EYnVX28zEKuAYqcVHSpkShXksTKiRwfWcVmXTRgIQf4l/XsahrhZhlxJbtZN6e213tQQFKbPCTiBwSf3CvcvAkA9Hbq9AUAAAAM/AlsaWdodG5pbmcBCI/PBFM/C09aAAEDCODIEAAAAAAAAQQiACCT3t0MJlvKhoV20+4uWe67sg68KW5Y9+3Kk9XursCJlgz8CWxpZ2h0bmluZwEIreWkThWNrsoA"
|
|
}
|
|
},
|
|
"response": {
|
|
"tx": "02000000000102f62126acb4e1a8113eb3ce40ed80e34a49d49b035cb9d36417b1c1333227112c0100000000fdfffffff62126acb4e1a8113eb3ce40ed80e34a49d49b035cb9d36417b1c1333227112c00000000000000000002ceb9da0b000000002251208f8ed44627557dbccc42ae018a9c5474a991285792c4ca891c1f59c5665d3460e0c810000000000022002093dedd0c265bca868576d3ee2e59eebbb20ebc296e58f7edca93d5eeaec089960140a72e1b2ea1f81a9733a5016935a9897d708107550d641dbb7a685084c530ae0947b2636aacb422c9e37ce5e66856405084b4d477aa6bb45b8331c5fb9a8323f00400473044022024af89f1987cfee986aacf511ed101aa083a8300d4ae4d6b87cd68fef4f722c60220263fd2a4750c7fbb08c433cc0d14e500c714820175454d18b5bef74e01cdc2f9014730440220306e4f6a09653e44f9306c6c47afb58d756d7ba2803f61184db3730ab208a8a302207c40845740e1e791d05957c75eb1b3e62db18fb5ec75039768972dc5efb881710147522102570ec0b6eb545663302183a62eac75d08fdeeb64f31352192065d601c8ca521d210266867c342b8250ab6b4edac6dbae2fde53782b69cd17139949fbd4f208487ff252ae92000000",
|
|
"txid": "f84514e06974b167a47021f31854b497632a35ca414b04c45a34ef7a8115bb95",
|
|
"outnum": 1
|
|
}
|
|
},
|
|
{
|
|
"request": {
|
|
"id": "example:splice_signed#2",
|
|
"method": "splice_signed",
|
|
"params": [
|
|
"f62126acb4e1a8113eb3ce40ed80e34a49d49b035cb9d36417b1c1333227112c",
|
|
"cHNidP8BAgQCAAAAAQMElAAAAAEEAQEBBQECAQYBAwH7BAIAAAAAAQCyAgAAAAL2ISastOGoET6zzkDtgONKSdSbA1y502QXscEzMicRLAEAAAAA/f////YhJqy04agRPrPOQO2A40pJ1JsDXLnTZBexwTMyJxEsAAAAAAAAAAAAAs652gsAAAAAIlEgj47URidVfbzMQq4BipxUdKmRKFeSxMqJHB9ZxWZdNGDgyBAAAAAAACIAIJPe3QwmW8qGhXbT7i5Z7ruyDrwpblj37cqT1e6uwImWkgAAAAEBK+DIEAAAAAAAIgAgk97dDCZbyoaFdtPuLlnuu7IOvCluWPftypPV7q7AiZYBDiCVuxWBeu80WsQES0HKNSpjl7RUGPMhcKRnsXRp4BRF+AEPBAEAAAABEAQAAAAADPwJbGlnaHRuaW5nAQheLXaEp+y8AgABAwi4Lg8AAAAAAAEEIgAgk97dDCZbyoaFdtPuLlnuu7IOvCluWPftypPV7q7AiZYM/AlsaWdodG5pbmcBCBkNULro+QrwAAEDCKCGAQAAAAAAAQQiUSDE0oJBX5qB0Y4IthmhnRFrhlbLG/ST5fVAu/e3oFhM2gz8CWxpZ2h0bmluZwEIuBcidnXj4BAA"
|
|
]
|
|
},
|
|
"response": {
|
|
"tx": "0200000000010195bb15817aef345ac4044b41ca352a6397b45418f32170a467b17469e01445f801000000000000000002b82e0f000000000022002093dedd0c265bca868576d3ee2e59eebbb20ebc296e58f7edca93d5eeaec08996a086010000000000225120c4d282415f9a81d18e08b619a19d116b8656cb1bf493e5f540bbf7b7a0584cda04004730440220259ff7ffc38775f34aed9be01a57b3002b2cba938e8bdf37ee0d529401ca0ae102206f77ba80e128ed5096679a304078efbff423394f2ffeb286e307fc71af06773d0147304402206e715aa27e9f192a787949dd322dd8c41d69dbf0b134099b942f40f3727ecaa80220154ab1a180d2103884ac73307f6f5faa0e384d7d40dcda44a26c17fdd83a89910147522102570ec0b6eb545663302183a62eac75d08fdeeb64f31352192065d601c8ca521d210266867c342b8250ab6b4edac6dbae2fde53782b69cd17139949fbd4f208487ff252ae94000000",
|
|
"txid": "b81ed02d0235b63cb73d1ee840345a696bc7224ba28be590165aa340bc9e37de",
|
|
"outnum": 0
|
|
}
|
|
}
|
|
]
|
|
}
|