{
  "methods": {
    "addgossip.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "addgossip",
      "title": "Command for injecting a gossip message (low-level)",
      "description": [
        "The **addgossip** RPC command injects a hex-encoded gossip message into the gossip daemon. It may return an error if it is malformed, or may update its internal state using the gossip message.",
        "",
        "Note that currently some paths will still silently reject the gossip: it is best effort.",
        "",
        "This is particularly used by plugins which may receive channel_update messages within error replies."
      ],
      "request": {
        "required": [
          "message"
        ],
        "additionalProperties": false,
        "properties": {
          "message": {
            "type": "hex",
            "description": [
              "The raw, hex-encoded, gossip message to add to the local gossip view."
            ]
          }
        }
      },
      "response": {
        "additionalProperties": false,
        "properties": {}
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-pay(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:addgossip#1",
            "method": "addgossip",
            "params": {
              "message": "010078c3314666731e339c0b8434f7824797a084ed7ca3655991a672da068e2c44cb53b57b53a296c133bc879109a8931dc31e6913a4bda3d58559b99b95663e6d52775579447ef5526300e1bb89bc6af8557aa1c3810a91814eafad6d103f43182e17b16644cb38c1d58a8edd094303959a9f1f9d42ff6c32a21f9c118531f512c8679cabaccc6e39dbd95a4dac90e75a258893c3aa3f733d1b8890174d5ddea8003cadffe557773c54d2c07ca1d535c4bf85885f879ae466c16a516e8ffcfec1740e3f5c98ca9ce13f452e867befef5517f306ed6aa5119b79059bcc6f68f329986b665d16de7bc7df64e3537504c91eeabe0e59d3a2b68e4216ead2b0f6e3ef7c000006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f0000670000010000022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d590266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c0351802e3bd38009866c9da8ec4aa99cc4ea9c6c0dd46df15c61ef0ce1f271291714e5702324266de8403b3ab157a09f1f784d587af61831c998c151bcc21bb74c2b2314b"
            }
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:addgossip#2",
            "method": "addgossip",
            "params": {
              "message": "0102420526c8eb62ec6999bbee5f1de4841cab734374ec642b7deeb0259e76220bf82e97a241c907d5ff52019655f7f9a614c285bb35690f3a1a2b928d7b2349a79e06226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f000067000001000065b32a0e010100060000000000000000000000010000000a000000003b023380"
            }
          },
          "response": {}
        }
      ]
    },
    "addpsbtoutput.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.11",
      "rpc": "addpsbtoutput",
      "title": "Command to populate PSBT outputs from the wallet",
      "description": [
        "`addpsbtoutput` is a low-level RPC command which creates or modifies a PSBT by adding a single output of amount *satoshi*.",
        "",
        "This is used to receive funds into the on-chain wallet interactively using PSBTs."
      ],
      "request": {
        "required": [
          "satoshi"
        ],
        "additionalProperties": false,
        "properties": {
          "satoshi": {
            "type": "sat",
            "description": [
              "The satoshi value of the output. It can be a whole number, a whole number ending in *sat*, or a number with 1 to 8 decimal places ending in *btc*."
            ]
          },
          "initialpsbt": {
            "type": "string",
            "description": [
              "Base 64 encoded PSBT to add the output to. If not specified, one will be generated automatically."
            ]
          },
          "locktime": {
            "type": "u32",
            "description": [
              "If not set, it is set to a recent block height (if no initial psbt is specified)."
            ]
          },
          "destination": {
            "type": "string",
            "description": [
              "If it is not set, an internal address is generated."
            ]
          }
        }
      },
      "response": {
        "required": [
          "psbt",
          "estimated_added_weight",
          "outnum"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "Unsigned PSBT which fulfills the parameters given."
            ]
          },
          "estimated_added_weight": {
            "type": "u32",
            "description": [
              "The estimated weight of the added output."
            ]
          },
          "outnum": {
            "type": "u32",
            "description": [
              "The 0-based number where the output was placed."
            ]
          }
        }
      },
      "author": [
        "Dusty [@dusty_daemon](mailto:@dustydaemon) is mainly responsible."
      ],
      "see_also": [
        "lightning-fundpsbt(7)",
        "lightning-utxopsbt(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "description": [
            "Here is a command to make a PSBT with a 1,000,000 sat output that leads to the on-chain wallet:"
          ],
          "request": {
            "id": "example:addpsbtoutput#1",
            "method": "addpsbtoutput",
            "params": {
              "satoshi": 1000000,
              "locktime": 111
            }
          },
          "response": {
            "psbt": "cHNidP8BAgpsbt1001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
            "estimated_added_weight": 172,
            "outnum": 1
          }
        },
        {
          "request": {
            "id": "example:addpsbtoutput#2",
            "method": "addpsbtoutput",
            "params": [
              3333333,
              "cHNidP8BAgpsbt20020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202"
            ]
          },
          "response": {
            "psbt": "cHNidP8BAgpsbt20020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202",
            "estimated_added_weight": 172,
            "outnum": 1
          }
        },
        {
          "request": {
            "id": "example:addpsbtoutput#3",
            "method": "addpsbtoutput",
            "params": {
              "satoshi": 3333333,
              "initialpsbt": "cHNidP8BAgpsbt20020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202",
              "destination": "bcrt1p5201010101010101010101010101010101010101010101010101010101"
            }
          },
          "response": {
            "psbt": "cHNidP8BAgpsbt300303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303",
            "estimated_added_weight": 172,
            "outnum": 1
          }
        }
      ]
    },
    "askrene-age.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-age",
      "title": "Command for expiring information in a layer",
      "added": "v24.11",
      "description": [
        "The **askrene-age** RPC command tells askrene that information added to a layer by *askrene-inform-channel* and *askrene-bias-channel* beyond a certain age is less useful.  It currently completely forgets constraints and biases older than *cutoff*."
      ],
      "request": {
        "required": [
          "layer",
          "cutoff"
        ],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The name of the layer to apply this change to."
            ]
          },
          "cutoff": {
            "type": "u64",
            "description": [
              "The UNIX timestamp: constraints older than this will be forgotten."
            ]
          }
        }
      },
      "response": {
        "required": [
          "layer",
          "num_removed"
        ],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The *layer* parameter provided."
            ]
          },
          "num_removed": {
            "type": "u64",
            "description": [
              "The number of constraints removed from *layer*"
            ]
          }
        }
      },
      "see_also": [
        "lightning-getroutes(7)",
        "lightning-askrene-inform-channel(7)",
        "lightning-askrene-listlayers(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-age#1",
            "method": "askrene-age",
            "params": {
              "layer": "test_layers",
              "cutoff": 1738000000
            }
          },
          "response": {
            "layer": "test_layers",
            "num_removed": 1
          }
        }
      ]
    },
    "askrene-bias-channel.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-bias-channel",
      "title": "Command to apply a manual bias to a channel in a layer",
      "added": "v24.11",
      "description": [
        "The **askrene-bias-channel** RPC command tells askrene to favor or disfavor a channel when considering it for routing."
      ],
      "request": {
        "required": [
          "layer",
          "short_channel_id_dir",
          "bias"
        ],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The name of the layer to apply this bias to."
            ]
          },
          "short_channel_id_dir": {
            "type": "short_channel_id_dir",
            "description": [
              "The short channel id and direction to apply this bias to."
            ]
          },
          "bias": {
            "type": "integer",
            "description": [
              "The bias, positive being good and negative being bad (0 being no bias).  Useful values are +/-1 through +/-10, though -100 through +100 are possible values."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "Description/annotation to display in askrene-listlayers(7)"
            ]
          },
          "relative": {
            "type": "boolean",
            "added": "v25.05",
            "default": false,
            "description": [
              "The bias will be added to the previous value."
            ]
          }
        }
      },
      "response": {
        "required": [
          "biases"
        ],
        "additionalProperties": false,
        "properties": {
          "biases": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "layer",
                "short_channel_id_dir",
                "bias",
                "timestamp"
              ],
              "additionalProperties": false,
              "properties": {
                "layer": {
                  "type": "string",
                  "description": [
                    "The name of the layer this bias applies to."
                  ]
                },
                "short_channel_id_dir": {
                  "type": "short_channel_id_dir",
                  "description": [
                    "The short channel id and direction"
                  ]
                },
                "bias": {
                  "type": "integer",
                  "description": [
                    "The bias (-100 to +100)"
                  ]
                },
                "description": {
                  "type": "string",
                  "description": [
                    "The bias (-100 to +100)"
                  ]
                },
                "timestamp": {
                  "type": "u64",
                  "added": "v25.12",
                  "description": [
                    "The UNIX timestamp when this bias was created."
                  ]
                }
              }
            }
          }
        }
      },
      "see_also": [
        "lightning-askrene-bias-node(7)",
        "lightning-getroutes(7)",
        "lightning-askrene-disable-node(7)",
        "lightning-askrene-create-channel(7)",
        "lightning-askrene-listlayers(7)",
        "lightning-askrene-age(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-bias-channel#1",
            "method": "askrene-bias-channel",
            "params": {
              "layer": "test_layers",
              "short_channel_id_dir": "109x1x1/1",
              "bias": 1
            }
          },
          "response": {
            "biases": [
              {
                "layer": "test_layers",
                "short_channel_id_dir": "109x1x1/1",
                "bias": 1
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:askrene-bias-channel#2",
            "method": "askrene-bias-channel",
            "params": [
              "test_layers",
              "109x1x1/1",
              -5,
              "bigger bias"
            ]
          },
          "response": {
            "biases": [
              {
                "layer": "test_layers",
                "short_channel_id_dir": "109x1x1/1",
                "description": "bigger bias",
                "bias": -5
              }
            ]
          }
        }
      ]
    },
    "askrene-bias-node.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-bias-node",
      "title": "Command to apply a manual bias to a node in a layer",
      "added": "v25.12",
      "description": [
        "The **askrene-bias-node** RPC command tells askrene to favor or disfavor all outgoing or incoming channels of a node when considering them for routing."
      ],
      "request": {
        "required": [
          "layer",
          "node",
          "direction",
          "bias"
        ],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The name of the layer to apply this bias to."
            ]
          },
          "node": {
            "type": "pubkey",
            "description": [
              "The node to which this bias applies.  It does not need to exist."
            ]
          },
          "direction": {
            "type": "string",
            "description": [
              "Either *in* or *out* to specify if the bias applies to incoming or outgoing channels with respect to this node."
            ]
          },
          "bias": {
            "type": "integer",
            "description": [
              "The bias, positive being good and negative being bad (0 being no bias).  Useful values are +/-1 through +/-10, though -100 through +100 are possible values."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "Description/annotation to display in askrene-listlayers(7)"
            ]
          },
          "relative": {
            "type": "boolean",
            "default": false,
            "description": [
              "The bias will be added to the previous value."
            ]
          }
        }
      },
      "response": {
        "required": [
          "node_biases"
        ],
        "additionalProperties": false,
        "properties": {
          "node_biases": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "layer",
                "node",
                "in_bias",
                "out_bias",
                "timestamp"
              ],
              "additionalProperties": false,
              "properties": {
                "layer": {
                  "type": "string",
                  "description": [
                    "The name of the layer this bias applies to."
                  ]
                },
                "node": {
                  "type": "pubkey",
                  "description": [
                    "The id of the biased node."
                  ]
                },
                "in_bias": {
                  "type": "integer",
                  "description": [
                    "The bias (-100 to +100) on incoming channels."
                  ]
                },
                "out_bias": {
                  "type": "integer",
                  "description": [
                    "The bias (-100 to +100) on outgoing channels."
                  ]
                },
                "description": {
                  "type": "string",
                  "description": [
                    "A human readable annotation."
                  ]
                },
                "timestamp": {
                  "type": "u64",
                  "description": [
                    "The UNIX timestamp when this bias was created or last updated."
                  ]
                }
              }
            }
          }
        }
      },
      "see_also": [
        "lightning-askrene-bias-channel(7)",
        "lightning-getroutes(7)",
        "lightning-askrene-disable-node(7)",
        "lightning-askrene-create-channel(7)",
        "lightning-askrene-listlayers(7)",
        "lightning-askrene-age(7)"
      ],
      "author": [
        "Lagrange [lagrang3@protonmail.com](mailto:lagrang3@protonmail.com) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-bias-node#1",
            "method": "askrene-bias-node",
            "params": {
              "layer": "test_layers",
              "node": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "direction": "out",
              "bias": 1
            }
          },
          "response": {
            "node_biases": [
              {
                "layer": "test_layers",
                "node": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "in_bias": 0,
                "out_bias": 1
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:askrene-bias-node#2",
            "method": "askrene-bias-node",
            "params": [
              "test_layers",
              "nodeid030303030303030303030303030303030303030303030303030303030303",
              "out",
              -5,
              "this node is unreliable"
            ]
          },
          "response": {
            "node_biases": [
              {
                "layer": "test_layers",
                "node": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "description": "this is node is unreliable",
                "in_bias": 0,
                "out_bias": -5
              }
            ]
          }
        }
      ]
    },
    "askrene-create-channel.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-create-channel",
      "title": "Command to add a channel to layer",
      "added": "v24.11",
      "description": [
        "The **askrene-create-channel** RPC command tells askrene create a channel in the given layer.  To actually populate the channel use *askrene-update-channel* in each direction."
      ],
      "request": {
        "required": [
          "layer",
          "source",
          "destination",
          "short_channel_id",
          "capacity_msat"
        ],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The name of the layer to apply this change to."
            ]
          },
          "source": {
            "type": "pubkey",
            "description": [
              "The source node id for the channel."
            ]
          },
          "destination": {
            "type": "pubkey",
            "description": [
              "The destination node id for the channel."
            ]
          },
          "short_channel_id": {
            "type": "short_channel_id",
            "description": [
              "The short channel id for the channel.  If a channel with this short channel id already exists in *layer*, the *source*, *destination* and *capacity_msat* must be the same."
            ]
          },
          "capacity_msat": {
            "type": "msat",
            "description": [
              "The capacity (onchain size) of the channel.",
              "NOTE: this is in millisatoshis!"
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "see_also": [
        "lightning-getroutes(7)",
        "lightning-askrene-disable-node(7)",
        "lightning-askrene-update-channel(7)",
        "lightning-askrene-inform-channel(7)",
        "lightning-askrene-listlayers(7)",
        "lightning-askrene-age(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-create-channel#1",
            "method": "askrene-create-channel",
            "params": {
              "layer": "test_layers",
              "source": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "destination": "nodeid010101010101010101010101010101010101010101010101010101010101",
              "short_channel_id": "0x0x1",
              "capacity_msat": "1000000sat"
            }
          },
          "response": {}
        }
      ]
    },
    "askrene-create-layer.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-create-layer",
      "title": "Command to create a new layer",
      "added": "v24.11",
      "description": [
        "The **askrene-create-layer** RPC command tells askrene to create a new, empty layer.  This layer can then be populated with `askrene-create-channel` and `askrene-inform-channel`, and be used in `getroutes`."
      ],
      "request": {
        "required": [
          "layer"
        ],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The name of the layer to create."
            ]
          },
          "persistent": {
            "type": "boolean",
            "default": "False",
            "description": [
              "True if askrene should save and restore this layer.  As a side-effect, create-layer also succeeds if the layer already exists and persistent is true."
            ]
          }
        }
      },
      "response": {
        "required": [
          "layers"
        ],
        "additionalProperties": false,
        "properties": {
          "layers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "layer",
                "persistent",
                "disabled_nodes",
                "created_channels",
                "channel_updates",
                "constraints"
              ],
              "properties": {
                "layer": {
                  "type": "string",
                  "description": [
                    "The name of the layer."
                  ]
                },
                "persistent": {
                  "type": "boolean",
                  "description": [
                    "Whether the layer is saved/restored across restarts."
                  ]
                },
                "disabled_nodes": {
                  "type": "array",
                  "items": {
                    "type": "pubkey",
                    "description": [
                      "The id of the disabled node."
                    ]
                  }
                },
                "disabled_channels": {
                  "type": "array",
                  "items": {
                    "type": "short_channel_id_dir",
                    "description": [
                      "The channel and direction which is disabled."
                    ]
                  }
                },
                "created_channels": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "source",
                      "destination",
                      "short_channel_id",
                      "capacity_msat"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "source": {
                        "type": "pubkey",
                        "description": [
                          "The source node id for the channel."
                        ]
                      },
                      "destination": {
                        "type": "pubkey",
                        "description": [
                          "The destination node id for the channel."
                        ]
                      },
                      "short_channel_id": {
                        "type": "short_channel_id",
                        "description": [
                          "The short channel id for the channel."
                        ]
                      },
                      "capacity_msat": {
                        "type": "msat",
                        "description": [
                          "The capacity (onchain size) of the channel."
                        ]
                      }
                    }
                  }
                },
                "channel_updates": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "short_channel_id_dir"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "htlc_minimum_msat": {
                        "type": "msat",
                        "description": [
                          "The minimum value allowed in this direction."
                        ]
                      },
                      "htlc_maximum_msat": {
                        "type": "msat",
                        "description": [
                          "The maximum value allowed in this direction."
                        ]
                      },
                      "fee_base_msat": {
                        "type": "msat",
                        "description": [
                          "The base fee to apply to use the channel in this direction."
                        ]
                      },
                      "fee_proportional_millionths": {
                        "type": "u32",
                        "description": [
                          "The proportional fee (in parts per million) to apply to use the channel in this direction."
                        ]
                      },
                      "delay": {
                        "type": "u16",
                        "description": [
                          "The CLTV delay required for this direction."
                        ]
                      }
                    }
                  }
                },
                "constraints": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "short_channel_id",
                      "direction"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "short_channel_id": {
                        "type": "short_channel_id",
                        "description": [
                          "The short channel id."
                        ]
                      },
                      "direction": {
                        "type": "u32",
                        "description": [
                          "The direction."
                        ]
                      },
                      "maximum_msat": {
                        "type": "msat",
                        "description": [
                          "The maximum value which this channel could pass.  This or *minimum_msat* will be present, but not both."
                        ]
                      },
                      "minimum_msat": {
                        "type": "msat",
                        "description": [
                          "The minimum value which this channel could pass.  This or *minimum_msat* will be present, but not both."
                        ]
                      }
                    }
                  }
                },
                "biases": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "short_channel_id_dir",
                      "bias",
                      "timestamp"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "short_channel_id_dir": {
                        "type": "short_channel_id_dir",
                        "description": [
                          "The short channel id and direction"
                        ]
                      },
                      "bias": {
                        "type": "integer",
                        "description": [
                          "The bias (-100 to +100)"
                        ]
                      },
                      "description": {
                        "type": "string",
                        "description": [
                          "Description/annotation to display in askrene-listlayers(7)"
                        ]
                      },
                      "timestamp": {
                        "type": "u64",
                        "added": "v25.12",
                        "description": [
                          "The UNIX timestamp when this bias was created."
                        ]
                      }
                    }
                  }
                },
                "node_biases": {
                  "added": "v25.12",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "node",
                      "in_bias",
                      "out_bias",
                      "timestamp"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "node": {
                        "added": "v25.12",
                        "type": "pubkey",
                        "description": [
                          "The id of the biased node."
                        ]
                      },
                      "in_bias": {
                        "added": "v25.12",
                        "type": "integer",
                        "description": [
                          "The bias (-100 to +100) on incoming channels."
                        ]
                      },
                      "out_bias": {
                        "added": "v25.12",
                        "type": "integer",
                        "description": [
                          "The bias (-100 to +100) on outgoing channels."
                        ]
                      },
                      "description": {
                        "added": "v25.12",
                        "type": "string",
                        "description": [
                          "A human readable annotation."
                        ]
                      },
                      "timestamp": {
                        "added": "v25.12",
                        "type": "u64",
                        "description": [
                          "The UNIX timestamp when this bias was created or last updated."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "see_also": [
        "lightning-askrene-remove-layer(7)",
        "lightning-getroutes(7)",
        "lightning-askrene-create-channel(7)",
        "lightning-askrene-inform-channel(7)",
        "lightning-askrene-listlayers(7)",
        "lightning-askrene-age(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-create-layer#1",
            "method": "askrene-create-layer",
            "params": {
              "layer": "test_layers"
            }
          },
          "response": {
            "layers": [
              {
                "layer": "test_layers",
                "persistent": false,
                "disabled_nodes": [],
                "created_channels": [],
                "channel_updates": [],
                "constraints": [],
                "biases": [],
                "node_biases": []
              }
            ]
          }
        }
      ]
    },
    "askrene-disable-node.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-disable-node",
      "title": "Command to disable all channels to/from a node in a layer",
      "added": "v24.11",
      "description": [
        "The **askrene-disable-node** RPC command tells askrene to disable all channels connected to a node whenever the given layer is used.  This is mainly useful to force the use of alternate paths: while individual channels can be disabled using askrene-create-channel or askrene-inform-channel, that would be racy if new channels appeared."
      ],
      "request": {
        "required": [
          "layer",
          "node"
        ],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The name of the layer to apply this change to."
            ]
          },
          "node": {
            "type": "pubkey",
            "description": [
              "The node to disable.  It does not need to exist."
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "see_also": [
        "lightning-getroutes(7)",
        "lightning-askrene-create-channel(7)",
        "lightning-askrene-inform-channel(7)",
        "lightning-askrene-listlayers(7)",
        "lightning-askrene-age(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-disable-node#1",
            "method": "askrene-disable-node",
            "params": {
              "layer": "test_layers",
              "node": "nodeid010101010101010101010101010101010101010101010101010101010101"
            }
          },
          "response": {}
        }
      ]
    },
    "askrene-inform-channel.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-inform-channel",
      "title": "Command to add channel capacity restrictions to layer",
      "added": "v24.11",
      "description": [
        "The **askrene-inform-channel** RPC command tells askrene about channels we used so it can update its capacity estimates.  For most accuracy, you should remove your own reservations before calling this.  It can be applied whether the current channel exists or not."
      ],
      "request": {
        "required": [
          "layer",
          "short_channel_id_dir",
          "amount_msat",
          "inform"
        ],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The name of the layer to apply this change to.  Also causes us to consider any reservations which are local to that layer (which is useful for fake channels where `layer` is set in an `askrene-reserve` `path` object)."
            ]
          },
          "short_channel_id_dir": {
            "type": "short_channel_id_dir",
            "description": [
              "The short channel id and direction to apply this change to."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount we used on the channel"
            ]
          },
          "inform": {
            "type": "string",
            "enum": [
              "constrained",
              "unconstrained",
              "succeeded"
            ],
            "description": [
              "Whether this payment passed (implying capacity of at least that amount), failed (implying maximum capacity of one msat less), or succeeded (implying capacity has been reduced in this direction)"
            ]
          }
        }
      },
      "response": {
        "required": [
          "constraints"
        ],
        "additionalProperties": false,
        "properties": {
          "constraints": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "layer",
                "short_channel_id_dir",
                "timestamp"
              ],
              "additionalProperties": false,
              "properties": {
                "short_channel_id_dir": {
                  "type": "short_channel_id_dir",
                  "description": [
                    "The short channel id and direction"
                  ]
                },
                "layer": {
                  "type": "string",
                  "description": [
                    "The name of the layer to apply this change to."
                  ]
                },
                "timestamp": {
                  "type": "u64",
                  "description": [
                    "The UNIX timestamp when this constraint was created."
                  ]
                },
                "maximum_msat": {
                  "type": "msat",
                  "description": [
                    "The maximum value which this channel could pass."
                  ]
                },
                "minimum_msat": {
                  "type": "msat",
                  "description": [
                    "The minimum value which this channel could pass."
                  ]
                }
              }
            }
          }
        }
      },
      "see_also": [
        "lightning-getroutes(7)",
        "lightning-askrene-disable-node(7)",
        "lightning-askrene-create-channel(7)",
        "lightning-askrene-listlayers(7)",
        "lightning-askrene-age(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-inform-channel#1",
            "method": "askrene-inform-channel",
            "params": {
              "layer": "test_layers",
              "short_channel_id_dir": "0x0x1/1",
              "amount_msat": 100000,
              "inform": "unconstrained"
            }
          },
          "response": {
            "constraints": [
              {
                "layer": "test_layers",
                "short_channel_id_dir": "0x0x1/1",
                "timestamp": 1738000000,
                "minimum_msat": 100000
              }
            ]
          }
        }
      ]
    },
    "askrene-listlayers.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-listlayers",
      "title": "Command to display information about layers",
      "added": "v24.11",
      "description": [
        "The **askrene-listlayers** RPC command reports any modifications each layer (or, the layer specified) would make to the topology, if it were used for *getroutes*."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The name of the layer to report on."
            ]
          }
        }
      },
      "response": {
        "required": [
          "layers"
        ],
        "additionalProperties": false,
        "properties": {
          "layers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "layer",
                "persistent",
                "disabled_nodes",
                "created_channels",
                "channel_updates",
                "constraints"
              ],
              "properties": {
                "layer": {
                  "type": "string",
                  "description": [
                    "The name of the layer."
                  ]
                },
                "persistent": {
                  "type": "boolean",
                  "description": [
                    "Whether the layer is saved across restarts."
                  ]
                },
                "disabled_nodes": {
                  "type": "array",
                  "items": {
                    "type": "pubkey",
                    "description": [
                      "The id of the disabled node."
                    ]
                  }
                },
                "disabled_channels": {
                  "type": "array",
                  "items": {
                    "type": "short_channel_id_dir",
                    "description": [
                      "The channel and direction which is disabled."
                    ]
                  }
                },
                "created_channels": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "source",
                      "destination",
                      "short_channel_id",
                      "capacity_msat"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "source": {
                        "type": "pubkey",
                        "description": [
                          "The source node id for the channel."
                        ]
                      },
                      "destination": {
                        "type": "pubkey",
                        "description": [
                          "The destination node id for the channel."
                        ]
                      },
                      "short_channel_id": {
                        "type": "short_channel_id",
                        "description": [
                          "The short channel id for the channel."
                        ]
                      },
                      "capacity_msat": {
                        "type": "msat",
                        "description": [
                          "The capacity (onchain size) of the channel."
                        ]
                      }
                    }
                  }
                },
                "channel_updates": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "short_channel_id_dir"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "short_channel_id_dir": {
                        "type": "short_channel_id_dir",
                        "description": [
                          "The short channel id and direction this update applies to."
                        ]
                      },
                      "enabled": {
                        "type": "boolean",
                        "description": [
                          "True if this can be used, false otherwise."
                        ]
                      },
                      "htlc_minimum_msat": {
                        "type": "msat",
                        "description": [
                          "The minimum value allowed in this direction."
                        ]
                      },
                      "htlc_maximum_msat": {
                        "type": "msat",
                        "description": [
                          "The maximum value allowed in this direction."
                        ]
                      },
                      "fee_base_msat": {
                        "type": "msat",
                        "description": [
                          "The base fee to apply to use the channel in this direction."
                        ]
                      },
                      "fee_proportional_millionths": {
                        "type": "u32",
                        "description": [
                          "The proportional fee (in parts per million) to apply to use the channel in this direction."
                        ]
                      },
                      "cltv_expiry_delta": {
                        "type": "u16",
                        "description": [
                          "The CLTV delay required for this direction."
                        ]
                      }
                    }
                  }
                },
                "constraints": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "short_channel_id_dir"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "short_channel_id_dir": {
                        "type": "short_channel_id_dir",
                        "description": [
                          "The short channel id and direction"
                        ]
                      },
                      "timestamp": {
                        "type": "u64",
                        "description": [
                          "The UNIX timestamp when this constraint was created."
                        ]
                      },
                      "maximum_msat": {
                        "type": "msat",
                        "description": [
                          "The maximum value which this channel could pass."
                        ]
                      },
                      "minimum_msat": {
                        "type": "msat",
                        "description": [
                          "The minimum value which this channel could pass."
                        ]
                      }
                    }
                  }
                },
                "biases": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "short_channel_id_dir",
                      "bias",
                      "timestamp"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "short_channel_id_dir": {
                        "type": "short_channel_id_dir",
                        "description": [
                          "The short channel id and direction"
                        ]
                      },
                      "bias": {
                        "type": "integer",
                        "description": [
                          "The bias (-100 to +100)"
                        ]
                      },
                      "description": {
                        "type": "string",
                        "description": [
                          "Description/annotation for the bias"
                        ]
                      },
                      "timestamp": {
                        "type": "u64",
                        "added": "v25.12",
                        "description": [
                          "The UNIX timestamp when this bias was created."
                        ]
                      }
                    }
                  }
                },
                "node_biases": {
                  "added": "v25.12",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "node",
                      "in_bias",
                      "out_bias",
                      "timestamp"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "node": {
                        "added": "v25.12",
                        "type": "pubkey",
                        "description": [
                          "The id of the biased node."
                        ]
                      },
                      "in_bias": {
                        "added": "v25.12",
                        "type": "integer",
                        "description": [
                          "The bias (-100 to +100) on incoming channels."
                        ]
                      },
                      "out_bias": {
                        "added": "v25.12",
                        "type": "integer",
                        "description": [
                          "The bias (-100 to +100) on outgoing channels."
                        ]
                      },
                      "description": {
                        "added": "v25.12",
                        "type": "string",
                        "description": [
                          "A human readable annotation."
                        ]
                      },
                      "timestamp": {
                        "added": "v25.12",
                        "type": "u64",
                        "description": [
                          "The UNIX timestamp when this bias was created or last updated."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "see_also": [
        "lightning-getroutes(7)",
        "lightning-askrene-disable-node(7)",
        "lightning-askrene-create-channel(7)",
        "lightning-askrene-inform-channel(7)",
        "lightning-askrene-bias-channel(7)",
        "lightning-askrene-bias-node(7)",
        "lightning-askrene-age(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-listlayers#1",
            "method": "askrene-listlayers",
            "params": [
              "test_layers"
            ]
          },
          "response": {
            "layers": [
              {
                "layer": "test_layers",
                "persistent": false,
                "disabled_nodes": [
                  "nodeid010101010101010101010101010101010101010101010101010101010101"
                ],
                "created_channels": [
                  {
                    "source": "nodeid010101010101010101010101010101010101010101010101010101010101",
                    "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
                    "short_channel_id": "0x0x1",
                    "capacity_msat": 1000000000
                  }
                ],
                "channel_updates": [
                  {
                    "short_channel_id_dir": "0x0x1/0",
                    "htlc_minimum_msat": 100,
                    "htlc_maximum_msat": 900000000,
                    "fee_base_msat": 1,
                    "fee_proportional_millionths": 2,
                    "cltv_expiry_delta": 18
                  }
                ],
                "constraints": [
                  {
                    "short_channel_id_dir": "0x0x1/1",
                    "timestamp": 1738000000,
                    "minimum_msat": 100000
                  }
                ],
                "biases": [
                  {
                    "short_channel_id_dir": "109x1x1/1",
                    "description": "bigger bias",
                    "bias": -5
                  }
                ],
                "node_biases": [
                  {
                    "node": "nodeid030303030303030303030303030303030303030303030303030303030303",
                    "description": "this node is unreliable",
                    "in_bias": 0,
                    "out_bias": -5
                  }
                ]
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:askrene-listlayers#2",
            "method": "askrene-listlayers",
            "params": {}
          },
          "response": {
            "layers": [
              {
                "layer": "test_layers",
                "persistent": false,
                "disabled_nodes": [
                  "nodeid010101010101010101010101010101010101010101010101010101010101"
                ],
                "created_channels": [
                  {
                    "source": "nodeid010101010101010101010101010101010101010101010101010101010101",
                    "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
                    "short_channel_id": "0x0x1",
                    "capacity_msat": 1000000000
                  }
                ],
                "channel_updates": [
                  {
                    "short_channel_id_dir": "0x0x1/0",
                    "htlc_minimum_msat": 100,
                    "htlc_maximum_msat": 900000000,
                    "fee_base_msat": 1,
                    "fee_proportional_millionths": 2,
                    "cltv_expiry_delta": 18
                  }
                ],
                "constraints": [
                  {
                    "short_channel_id_dir": "0x0x1/1",
                    "timestamp": 1738000000,
                    "minimum_msat": 100000
                  }
                ],
                "biases": [
                  {
                    "short_channel_id_dir": "109x1x1/1",
                    "description": "bigger bias",
                    "bias": -5
                  }
                ],
                "node_biases": [
                  {
                    "node": "nodeid030303030303030303030303030303030303030303030303030303030303",
                    "description": "this node is unreliable",
                    "in_bias": 0,
                    "out_bias": -5
                  }
                ]
              },
              {
                "layer": "xpay",
                "persistent": true,
                "disabled_nodes": [],
                "created_channels": [],
                "channel_updates": [],
                "constraints": [],
                "biases": [],
                "node_biases": []
              }
            ]
          }
        }
      ]
    },
    "askrene-listreservations.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-listreservations",
      "title": "Command to display information about reservations",
      "added": "v24.11",
      "description": [
        "The **askrene-reservations** RPC command reports outstanding reservations made with `askrene-reserve`, mainly for debugging."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "response": {
        "required": [
          "reservations"
        ],
        "additionalProperties": false,
        "properties": {
          "reservations": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "short_channel_id_dir",
                "amount_msat",
                "age_in_seconds",
                "command_id"
              ],
              "additionalProperties": false,
              "properties": {
                "short_channel_id_dir": {
                  "type": "short_channel_id_dir",
                  "description": [
                    "The channel and direction that is reserved."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount reserved."
                  ]
                },
                "age_in_seconds": {
                  "type": "u64",
                  "description": [
                    "The age of this reservation."
                  ]
                },
                "command_id": {
                  "type": "string",
                  "description": [
                    "The JSON id of the command used to make the reservation."
                  ]
                }
              }
            }
          }
        }
      },
      "see_also": [
        "lightning-askrene-reserve(7)",
        "lightning-askrene-unreserve(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-listreservations#1",
            "method": "askrene-listreservations",
            "params": {}
          },
          "response": {
            "reservations": [
              {
                "short_channel_id_dir": "109x1x1/1",
                "amount_msat": 1250000,
                "age_in_seconds": 2,
                "command_id": "\"-c:askrene-reserve#62/cln:askrene-reserve#122\""
              },
              {
                "short_channel_id_dir": "123x1x1/0",
                "amount_msat": 1250001,
                "age_in_seconds": 2,
                "command_id": "\"-c:askrene-reserve#62/cln:askrene-reserve#122\""
              },
              {
                "short_channel_id_dir": "109x1x1/1",
                "amount_msat": 1250000000000,
                "age_in_seconds": 2,
                "command_id": "\"-c:askrene-reserve#66/cln:askrene-reserve#126\""
              },
              {
                "short_channel_id_dir": "123x1x1/0",
                "amount_msat": 1250000000000,
                "age_in_seconds": 2,
                "command_id": "\"-c:askrene-reserve#66/cln:askrene-reserve#126\""
              }
            ]
          }
        }
      ]
    },
    "askrene-remove-layer.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-remove-layer",
      "title": "Command to destroy a layer",
      "added": "v24.11",
      "description": [
        "The **askrene-remove-layer** RPC command tells askrene to forget a layer."
      ],
      "request": {
        "required": [
          "layer"
        ],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The name of the layer to remove."
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "see_also": [
        "lightning-askrene-create-layer(7)",
        "lightning-askrene-listlayers(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-remove-layer#1",
            "method": "askrene-remove-layer",
            "params": {
              "layer": "test_layers"
            }
          },
          "response": {}
        }
      ]
    },
    "askrene-reserve.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-reserve",
      "title": "Command for informing askrene that you are trying a path",
      "added": "v24.11",
      "description": [
        "The **askrene-reserve** RPC command tells askrene that a path is being attempted.  This allows it to take that into account when other *getroutes* calls are made.  You should call *askrene-unreserve* after the attempt has completed (and before calling *askrene-inform*).",
        "",
        "Note that additional properties inside the *path* elements are ignored, which is useful when used with the result of *getroutes*."
      ],
      "request": {
        "required": [
          "path"
        ],
        "additionalProperties": false,
        "properties": {
          "path": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "short_channel_id_dir",
                "amount_msat"
              ],
              "properties": {
                "short_channel_id_dir": {
                  "type": "short_channel_id_dir",
                  "description": [
                    "The channel and direction joining these nodes."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount to send into this hop."
                  ]
                },
                "layer": {
                  "added": "v25.12",
                  "type": "string",
                  "description": [
                    "The layer to restrict this reservation to.  This is only useful for fake channels which are not uniquely identified by `short_channel_id_dir`, which would otherwise confuse multiple unrelated callers."
                  ]
                }
              }
            }
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "see_also": [
        "lightning-getroutes(7)",
        "lightning-askrene-unreserve(7)",
        "lightning-askrene-listreservations(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-reserve#1",
            "method": "askrene-reserve",
            "params": {
              "path": [
                {
                  "short_channel_id_dir": "109x1x1/1",
                  "amount_msat": 1250000
                },
                {
                  "short_channel_id_dir": "123x1x1/0",
                  "amount_msat": 1250001
                }
              ]
            }
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:askrene-reserve#2",
            "method": "askrene-reserve",
            "params": {
              "path": [
                {
                  "short_channel_id_dir": "109x1x1/1",
                  "amount_msat": 1250000000000
                },
                {
                  "short_channel_id_dir": "123x1x1/0",
                  "amount_msat": 1250000000000
                }
              ]
            }
          },
          "response": {}
        }
      ]
    },
    "askrene-unreserve.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-unreserve",
      "title": "Command for informing askrene that you are no longer trying a path",
      "added": "v24.11",
      "description": [
        "The **askrene-unreserve** RPC command tells askrene that a path attempt has finished: it should only be called after a successful **askrene-reserve** call.",
        "",
        "Note that additional properties inside the *path* elements are ignored, which is useful when used with the result of *getroutes*."
      ],
      "request": {
        "required": [
          "path"
        ],
        "additionalProperties": false,
        "properties": {
          "path": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "short_channel_id_dir",
                "amount_msat"
              ],
              "properties": {
                "short_channel_id_dir": {
                  "type": "short_channel_id_dir",
                  "description": [
                    "The channel and direction joining these nodes."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount to send into this hop."
                  ]
                },
                "layer": {
                  "added": "v25.12",
                  "type": "string",
                  "description": [
                    "The layer to restrict this reservation to (useful for fake channels)."
                  ]
                }
              }
            }
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "see_also": [
        "lightning-getroutes(7)",
        "lightning-askrene-reserve(7)",
        "lightning-askrene-listreservations(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-unreserve#1",
            "method": "askrene-unreserve",
            "params": {
              "path": [
                {
                  "short_channel_id_dir": "109x1x1/1",
                  "amount_msat": 1250000
                },
                {
                  "short_channel_id_dir": "123x1x1/0",
                  "amount_msat": 1250001
                }
              ]
            }
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:askrene-unreserve#2",
            "method": "askrene-unreserve",
            "params": {
              "path": [
                {
                  "short_channel_id_dir": "109x1x1/1",
                  "amount_msat": 1250000000000
                },
                {
                  "short_channel_id_dir": "123x1x1/0",
                  "amount_msat": 1250000000000
                }
              ]
            }
          },
          "response": {}
        }
      ]
    },
    "askrene-update-channel.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "askrene-update-channel",
      "title": "Command to manipulate channel in a layer",
      "added": "v24.11",
      "description": [
        "The **askrene-update-channel** RPC command overrides updates for an existing channel when the layer is applied."
      ],
      "request": {
        "required": [
          "layer",
          "short_channel_id_dir"
        ],
        "additionalProperties": false,
        "properties": {
          "layer": {
            "type": "string",
            "description": [
              "The name of the layer to apply this change to."
            ]
          },
          "short_channel_id_dir": {
            "type": "short_channel_id_dir",
            "description": [
              "The channel and direction to apply the change to."
            ]
          },
          "enabled": {
            "type": "boolean",
            "description": [
              "Whether the channel is usable at all."
            ]
          },
          "htlc_minimum_msat": {
            "type": "msat",
            "description": [
              "The minimum value allowed in this direction."
            ]
          },
          "htlc_maximum_msat": {
            "type": "msat",
            "description": [
              "The maximum value allowed in this direction."
            ]
          },
          "fee_base_msat": {
            "type": "msat",
            "description": [
              "The base fee to apply to use the channel in this direction."
            ]
          },
          "fee_proportional_millionths": {
            "type": "u32",
            "description": [
              "The proportional fee (in parts per million) to apply to use the channel in this direction."
            ]
          },
          "cltv_expiry_delta": {
            "type": "u16",
            "description": [
              "The CLTV delay required for this direction."
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "see_also": [
        "lightning-getroutes(7)",
        "lightning-askrene-create-channel(7)"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:askrene-update-channel#1",
            "method": "askrene-update-channel",
            "params": [
              "test_layers",
              "0x0x1/0"
            ]
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:askrene-update-channel#2",
            "method": "askrene-update-channel",
            "params": {
              "layer": "test_layers",
              "short_channel_id_dir": "0x0x1/0",
              "htlc_minimum_msat": 100,
              "htlc_maximum_msat": 900000000,
              "fee_base_msat": 1,
              "fee_proportional_millionths": 2,
              "cltv_expiry_delta": 18
            }
          },
          "response": {}
        }
      ]
    },
    "autoclean-once.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "autoclean-once",
      "title": "A single deletion of old invoices/payments/forwards",
      "description": [
        "The **autoclean-once** RPC command tell the `autoclean` plugin to do a single sweep to delete old entries. This is a manual alternative (or addition) to the various `autoclean-...-age` parameters which cause autoclean to run once per hour: see lightningd-config(5)."
      ],
      "request": {
        "required": [
          "subsystem",
          "age"
        ],
        "additionalProperties": false,
        "properties": {
          "subsystem": {
            "type": "string",
            "enum": [
              "succeededforwards",
              "failedforwards",
              "succeededpays",
              "failedpays",
              "paidinvoices",
              "expiredinvoices",
              "networkevents"
            ],
            "description": [
              "What subsystem to clean. Currently supported subsystems are:",
              "    * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).",
              "    * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).",
              "    * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).",
              "    * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).",
              "    * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).",
              "    * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status).",
              "    * `networkevents`: all events in listnetworkevents (added *v25.12*)",
              "",
              "NOTE: until v25.12, the `uncleaned` field contained all entries not removed (e.g. in `failedforwards` it counted all forwards, not just failed ones).  This was an interface only an engineer could love, so it was fixed."
            ]
          },
          "age": {
            "type": "u64",
            "description": [
              "Non-zero number in seconds. How many seconds old an entry must be to delete it."
            ]
          }
        }
      },
      "response": {
        "required": [
          "autoclean"
        ],
        "additionalProperties": false,
        "properties": {
          "autoclean": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "succeededforwards": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cleaned",
                  "uncleaned"
                ],
                "properties": {
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "The number of successful forwards deleted."
                    ]
                  },
                  "uncleaned": {
                    "type": "u64",
                    "description": [
                      "The number of successful forwards *not* deleted (too new)."
                    ]
                  }
                }
              },
              "failedforwards": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cleaned",
                  "uncleaned"
                ],
                "properties": {
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "The number of failed forwards deleted."
                    ]
                  },
                  "uncleaned": {
                    "type": "u64",
                    "description": [
                      "The number of failed forwards *not* deleted (too new)."
                    ]
                  }
                }
              },
              "succeededpays": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cleaned",
                  "uncleaned"
                ],
                "properties": {
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "The number of successful payments deleted."
                    ]
                  },
                  "uncleaned": {
                    "type": "u64",
                    "description": [
                      "The number of successful forwards *not* deleted (too new)."
                    ]
                  }
                }
              },
              "failedpays": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cleaned",
                  "uncleaned"
                ],
                "properties": {
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "The number of unsuccessful payments deleted."
                    ]
                  },
                  "uncleaned": {
                    "type": "u64",
                    "description": [
                      "The number of unsuccessful payments *not* deleted (too new)."
                    ]
                  }
                }
              },
              "paidinvoices": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cleaned",
                  "uncleaned"
                ],
                "properties": {
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "The number of paid invoices deleted."
                    ]
                  },
                  "uncleaned": {
                    "type": "u64",
                    "description": [
                      "The number of paid invoices *not* deleted (too new)."
                    ]
                  }
                }
              },
              "expiredinvoices": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "cleaned",
                  "uncleaned"
                ],
                "properties": {
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "The number of expired invoices deleted."
                    ]
                  },
                  "uncleaned": {
                    "type": "u64",
                    "description": [
                      "The number of expired invoices *not* deleted (too new)."
                    ]
                  }
                }
              },
              "networkevents": {
                "type": "object",
                "additionalProperties": false,
                "added": "v25.12",
                "required": [
                  "cleaned",
                  "uncleaned"
                ],
                "properties": {
                  "cleaned": {
                    "added": "v25.12",
                    "type": "u64",
                    "description": [
                      "Total number of deletions done this run."
                    ]
                  },
                  "uncleaned": {
                    "added": "v25.12",
                    "type": "u64",
                    "description": [
                      "The total number of entries *not* deleted this run."
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightningd-config(5)",
        "lightning-autoclean-status(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:autoclean-once#1",
            "method": "autoclean-once",
            "params": [
              "failedpays",
              1
            ]
          },
          "response": {
            "autoclean": {
              "failedpays": {
                "cleaned": 0,
                "uncleaned": 7
              }
            }
          }
        },
        {
          "request": {
            "id": "example:autoclean-once#2",
            "method": "autoclean-once",
            "params": [
              "succeededpays",
              1
            ]
          },
          "response": {
            "autoclean": {
              "succeededpays": {
                "cleaned": 7,
                "uncleaned": 0
              }
            }
          }
        }
      ]
    },
    "autoclean-status.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "autoclean-status",
      "title": "Examine auto-delete of old invoices/payments/forwards",
      "description": [
        "The **autoclean-status** RPC command tells you about the status of the autoclean plugin, optionally for only one subsystem."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "subsystem": {
            "type": "string",
            "enum": [
              "succeededforwards",
              "failedforwards",
              "succeededpays",
              "failedpays",
              "paidinvoices",
              "expiredinvoices",
              "networkevents"
            ],
            "description": [
              "What subsystem to ask about. Currently supported subsystems are:",
              "    * `failedforwards`: routed payments which did not succeed (`failed` or `local_failed` in listforwards `status`).",
              "    * `succeededforwards`: routed payments which succeeded (`settled` in listforwards `status`).",
              "    * `failedpays`: payment attempts which did not succeed (`failed` in listpays `status`).",
              "    * `succeededpays`: payment attempts which succeeded (`complete` in listpays `status`).",
              "    * `expiredinvoices`: invoices which were not paid (and cannot be) (`expired` in listinvoices `status`).",
              "    * `paidinvoices`: invoices which were paid (`paid` in listinvoices `status).",
              "    * `networkevents`: all events in listnetworkevents (added *v25.12*)"
            ]
          }
        }
      },
      "response": {
        "required": [
          "autoclean"
        ],
        "additionalProperties": false,
        "properties": {
          "autoclean": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "succeededforwards": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "enabled",
                  "cleaned"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": [
                      "Whether autocleaning is enabled for successful listforwards."
                    ]
                  },
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "Total number of deletions done (ever)."
                    ]
                  }
                },
                "if": {
                  "additionalProperties": true,
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "age",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {},
                    "age": {
                      "type": "u64",
                      "description": [
                        "Age (in seconds) to delete successful listforwards."
                      ]
                    }
                  }
                },
                "else": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {}
                  }
                }
              },
              "failedforwards": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "enabled",
                  "cleaned"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": [
                      "Whether autocleaning is enabled for failed listforwards."
                    ]
                  },
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "Total number of deletions done (ever)."
                    ]
                  }
                },
                "if": {
                  "additionalProperties": true,
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "age",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {},
                    "age": {
                      "type": "u64",
                      "description": [
                        "Age (in seconds) to delete failed listforwards."
                      ]
                    }
                  }
                },
                "else": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {}
                  }
                }
              },
              "succeededpays": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "enabled",
                  "cleaned"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": [
                      "Whether autocleaning is enabled for successful listpays/listsendpays."
                    ]
                  },
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "Total number of deletions done (ever)."
                    ]
                  }
                },
                "if": {
                  "additionalProperties": true,
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "age",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {},
                    "age": {
                      "type": "u64",
                      "description": [
                        "Age (in seconds) to delete successful listpays/listsendpays."
                      ]
                    }
                  }
                },
                "else": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {}
                  }
                }
              },
              "failedpays": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "enabled",
                  "cleaned"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": [
                      "Whether autocleaning is enabled for failed listpays/listsendpays."
                    ]
                  },
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "Total number of deletions done (ever)."
                    ]
                  }
                },
                "if": {
                  "additionalProperties": true,
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "age",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {},
                    "age": {
                      "type": "u64",
                      "description": [
                        "Age (in seconds) to delete failed listpays/listsendpays."
                      ]
                    }
                  }
                },
                "else": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {}
                  }
                }
              },
              "paidinvoices": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "enabled",
                  "cleaned"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": [
                      "Whether autocleaning is enabled for paid listinvoices."
                    ]
                  },
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "Total number of deletions done (ever)."
                    ]
                  }
                },
                "if": {
                  "additionalProperties": true,
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "age",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {},
                    "age": {
                      "type": "u64",
                      "description": [
                        "Age (in seconds) to paid listinvoices."
                      ]
                    }
                  }
                },
                "else": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {}
                  }
                }
              },
              "expiredinvoices": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                  "enabled",
                  "cleaned"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": [
                      "Whether autocleaning is enabled for expired (unpaid) listinvoices."
                    ]
                  },
                  "cleaned": {
                    "type": "u64",
                    "description": [
                      "Total number of deletions done (ever)."
                    ]
                  }
                },
                "if": {
                  "additionalProperties": true,
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "age",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {},
                    "age": {
                      "type": "u64",
                      "description": [
                        "Age (in seconds) to expired listinvoices."
                      ]
                    }
                  }
                },
                "else": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {}
                  }
                }
              },
              "networkevents": {
                "type": "object",
                "added": "v25.12",
                "additionalProperties": true,
                "required": [
                  "enabled",
                  "cleaned"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "added": "v25.12",
                    "description": [
                      "Whether autocleaning is enabled for networkevents."
                    ]
                  },
                  "cleaned": {
                    "type": "u64",
                    "added": "v25.12",
                    "description": [
                      "Total number of deletions done (ever)."
                    ]
                  }
                },
                "if": {
                  "additionalProperties": true,
                  "properties": {
                    "enabled": {
                      "type": "boolean",
                      "enum": [
                        true
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "age",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {},
                    "age": {
                      "added": "v25.12",
                      "type": "u64",
                      "description": [
                        "Age (in seconds) to clean networkevents."
                      ]
                    }
                  }
                },
                "else": {
                  "additionalProperties": false,
                  "required": [
                    "enabled",
                    "cleaned"
                  ],
                  "properties": {
                    "enabled": {},
                    "cleaned": {}
                  }
                }
              }
            }
          }
        },
        "pre_return_value_notes": [
          "Note that the ages parameters are set by various `autoclean-...-age` parameters in your configuration: see lightningd-config(5)."
        ]
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightningd-config(5)",
        "lightning-listinvoices(7)",
        "lightning-listpays(7)",
        "lightning-listforwards(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:autoclean-status#1",
            "method": "autoclean-status",
            "params": {
              "subsystem": "expiredinvoices"
            }
          },
          "response": {
            "autoclean": {
              "expiredinvoices": {
                "enabled": true,
                "age": 300,
                "cleaned": 0
              }
            }
          }
        },
        {
          "request": {
            "id": "example:autoclean-status#2",
            "method": "autoclean-status",
            "params": {}
          },
          "response": {
            "autoclean": {
              "succeededforwards": {
                "enabled": false,
                "cleaned": 0
              },
              "failedforwards": {
                "enabled": false,
                "cleaned": 0
              },
              "succeededpays": {
                "enabled": false,
                "cleaned": 7
              },
              "failedpays": {
                "enabled": false,
                "cleaned": 0
              },
              "paidinvoices": {
                "enabled": false,
                "cleaned": 0
              },
              "expiredinvoices": {
                "enabled": true,
                "age": 300,
                "cleaned": 0
              }
            }
          }
        }
      ]
    },
    "batching.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "batching",
      "title": "Command to allow database batching.",
      "description": [
        "The **batching** RPC command allows (but does not guarantee!) database commitments to be deferred when multiple commands are issued on this RPC connection. This is only useful if many commands are being given at once, in which case it can offer a performance improvement (the cost being that if there is a crash, it's unclear how many of the commands will have been persisted)."
      ],
      "request": {
        "required": [
          "enable"
        ],
        "additionalProperties": false,
        "properties": {
          "enable": {
            "type": "boolean",
            "description": [
              "Whether to enable or disable transaction batching."
            ],
            "default": "False"
          }
        }
      },
      "response": {
        "additionalProperties": false,
        "properties": {}
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters."
      ],
      "author": [
        "Rusty Russell [rusty@blockstream.com](mailto:rusty@blockstream.com) wrote the initial version of this man page."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:batching#1",
            "method": "batching",
            "params": {
              "enable": true
            }
          },
          "response": {}
        }
      ]
    },
    "bkpr-channelsapy.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "bkpr-channelsapy",
      "title": "Command to list stats on channel earnings",
      "description": [
        "The **bkpr-channelsapy** RPC command lists stats on routing income, leasing income, and various calculated APYs for channel routed funds."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "start_time": {
            "type": "u64",
            "description": [
              "UNIX timestamp (in seconds) to filter events after the provided timestamp."
            ],
            "default": "zero"
          },
          "end_time": {
            "type": "u64",
            "description": [
              "UNIX timestamp (in seconds) to filter events up to and at the provided timestamp."
            ],
            "default": "max-int"
          }
        }
      },
      "response": {
        "required": [
          "channels_apy"
        ],
        "additionalProperties": false,
        "properties": {
          "channels_apy": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "account",
                "routed_out_msat",
                "routed_in_msat",
                "lease_fee_paid_msat",
                "lease_fee_earned_msat",
                "pushed_out_msat",
                "pushed_in_msat",
                "our_start_balance_msat",
                "channel_start_balance_msat",
                "fees_out_msat",
                "utilization_out",
                "utilization_in",
                "apy_out",
                "apy_in",
                "apy_total"
              ],
              "properties": {
                "account": {
                  "type": "string",
                  "description": [
                    "The account name. If the account is a channel, the channel_id. The 'net' entry is the rollup of all channel accounts."
                  ]
                },
                "routed_out_msat": {
                  "type": "msat",
                  "description": [
                    "Sats routed (outbound)."
                  ]
                },
                "routed_in_msat": {
                  "type": "msat",
                  "description": [
                    "Sats routed (inbound)."
                  ]
                },
                "lease_fee_paid_msat": {
                  "type": "msat",
                  "description": [
                    "Sats paid for leasing inbound (liquidity ads)."
                  ]
                },
                "lease_fee_earned_msat": {
                  "type": "msat",
                  "description": [
                    "Sats earned for leasing outbound (liquidity ads)."
                  ]
                },
                "pushed_out_msat": {
                  "type": "msat",
                  "description": [
                    "Sats pushed to peer at open."
                  ]
                },
                "pushed_in_msat": {
                  "type": "msat",
                  "description": [
                    "Sats pushed in from peer at open."
                  ]
                },
                "our_start_balance_msat": {
                  "type": "msat",
                  "description": [
                    "Starting balance in channel at funding. Note that if our start balance is zero, any _initial field will be omitted (can't divide by zero)."
                  ]
                },
                "channel_start_balance_msat": {
                  "type": "msat",
                  "description": [
                    "Total starting balance at funding."
                  ]
                },
                "fees_out_msat": {
                  "type": "msat",
                  "description": [
                    "Fees earned on routed outbound."
                  ]
                },
                "fees_in_msat": {
                  "type": "msat",
                  "description": [
                    "Fees earned on routed inbound."
                  ]
                },
                "utilization_out": {
                  "type": "string",
                  "description": [
                    "Sats routed outbound / total start balance."
                  ]
                },
                "utilization_out_initial": {
                  "type": "string",
                  "description": [
                    "Sats routed outbound / our start balance."
                  ]
                },
                "utilization_in": {
                  "type": "string",
                  "description": [
                    "Sats routed inbound / total start balance."
                  ]
                },
                "utilization_in_initial": {
                  "type": "string",
                  "description": [
                    "Sats routed inbound / our start balance."
                  ]
                },
                "apy_out": {
                  "type": "string",
                  "description": [
                    "Fees earned on outbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)."
                  ]
                },
                "apy_out_initial": {
                  "type": "string",
                  "description": [
                    "Fees earned on outbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)."
                  ]
                },
                "apy_in": {
                  "type": "string",
                  "description": [
                    "Fees earned on inbound routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)."
                  ]
                },
                "apy_in_initial": {
                  "type": "string",
                  "description": [
                    "Fees earned on inbound routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)."
                  ]
                },
                "apy_total": {
                  "type": "string",
                  "description": [
                    "Total fees earned on routed payments / total start balance for the length of time this channel has been open amortized to a year (APY)."
                  ]
                },
                "apy_total_initial": {
                  "type": "string",
                  "description": [
                    "Total fees earned on routed payments / our start balance for the length of time this channel has been open amortized to a year (APY)."
                  ]
                },
                "apy_lease": {
                  "type": "string",
                  "description": [
                    "Lease fees earned over total amount leased for the lease term, amortized to a year (APY). Only appears if channel was leased out by us."
                  ]
                }
              }
            }
          }
        }
      },
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-bkpr-listincome(7)",
        "lightning-bkpr-listfunds(7)",
        "lightning-bkpr-listaccountevents(7)",
        "lightning-bkpr-dumpincomecsv(7)",
        "lightning-listpeers(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:bkpr-channelsapy#1",
            "method": "bkpr-channelsapy",
            "params": {}
          },
          "response": {
            "channels_apy": [
              {
                "account": "channelid0120000120000120000120000120000120000120000120000120000",
                "routed_out_msat": 1000000,
                "routed_in_msat": 510091208,
                "lease_fee_paid_msat": 0,
                "lease_fee_earned_msat": 0,
                "pushed_out_msat": 0,
                "pushed_in_msat": 0,
                "our_start_balance_msat": 0,
                "channel_start_balance_msat": 1000000000,
                "fees_out_msat": 0,
                "fees_in_msat": 106,
                "utilization_out": "30.7060%",
                "utilization_in": "10.0027%",
                "utilization_in_initial": "50.0081%",
                "apy_out": "0.0080%",
                "apy_in": "0.0080%",
                "apy_in_initial": "0.0250%",
                "apy_total": "0.0160%"
              },
              {
                "account": "channelid0230000230000230000230000230000230000230000230000230000",
                "routed_out_msat": 510190102,
                "routed_in_msat": 0,
                "lease_fee_paid_msat": 0,
                "lease_fee_earned_msat": 0,
                "pushed_out_msat": 0,
                "pushed_in_msat": 0,
                "our_start_balance_msat": 1000000000,
                "channel_start_balance_msat": 1000000000,
                "fees_out_msat": 106,
                "fees_in_msat": 0,
                "utilization_out": "31.7060%",
                "utilization_out_initial": "51.5591%",
                "utilization_in": "11.0027%",
                "apy_out": "0.0081%",
                "apy_out_initial": "0.0121%",
                "apy_in": "0.0081%",
                "apy_total": "0.0161%",
                "apy_total_initial": "0.0161%"
              },
              {
                "account": "channelid0250000250000250000250000250000250000250000250000250000",
                "routed_out_msat": 500000000,
                "routed_in_msat": 0,
                "lease_fee_paid_msat": 0,
                "lease_fee_earned_msat": 0,
                "pushed_out_msat": 0,
                "pushed_in_msat": 0,
                "our_start_balance_msat": 1000000000,
                "channel_start_balance_msat": 1000000000,
                "fees_out_msat": 0,
                "fees_in_msat": 0,
                "utilization_out": "32.7060%",
                "utilization_out_initial": "52.5591%",
                "utilization_in": "12.0027%",
                "apy_out": "0.0082%",
                "apy_out_initial": "0.0122%",
                "apy_in": "0.0082%",
                "apy_total": "0.0162%",
                "apy_total_initial": "0.0162%"
              },
              {
                "account": "net",
                "routed_out_msat": 1011190102,
                "routed_in_msat": 510091208,
                "lease_fee_paid_msat": 0,
                "lease_fee_earned_msat": 0,
                "pushed_out_msat": 0,
                "pushed_in_msat": 0,
                "our_start_balance_msat": 2000000000,
                "channel_start_balance_msat": 3000000000,
                "fees_out_msat": 106,
                "fees_in_msat": 106,
                "utilization_out": "33.7060%",
                "utilization_out_initial": "53.5591%",
                "utilization_in": "13.0027%",
                "utilization_in_initial": "53.0081%",
                "apy_out": "0.0083%",
                "apy_out_initial": "0.0123%",
                "apy_in": "0.0083%",
                "apy_in_initial": "0.0253%",
                "apy_total": "0.0163%",
                "apy_total_initial": "0.0163%"
              }
            ]
          }
        }
      ]
    },
    "bkpr-dumpincomecsv.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "bkpr-dumpincomecsv",
      "title": "Command to emit a CSV of income events",
      "description": [
        "The **bkpr-dumpincomcsv** RPC command writes a CSV file to disk at *csv_file* location. This is a formatted output of the **listincome** RPC command."
      ],
      "request": {
        "required": [
          "csv_format"
        ],
        "additionalProperties": false,
        "properties": {
          "csv_format": {
            "type": "string",
            "description": [
              "CSV format to use. See RETURN VALUE for options."
            ]
          },
          "csv_file": {
            "type": "string",
            "description": [
              "On-disk destination of the generated CSV file."
            ]
          },
          "consolidate_fees": {
            "type": "boolean",
            "description": [
              "If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **dumpincomecsv** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction."
            ],
            "default": "True"
          },
          "start_time": {
            "type": "u64",
            "description": [
              "UNIX timestamp (in seconds) that filters events after the provided timestamp."
            ],
            "default": "zero"
          },
          "end_time": {
            "type": "u64",
            "description": [
              "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp."
            ],
            "default": "max-int"
          }
        }
      },
      "response": {
        "required": [
          "csv_file",
          "csv_format"
        ],
        "additionalProperties": false,
        "properties": {
          "csv_file": {
            "type": "string",
            "description": [
              "File that the csv was generated to."
            ]
          },
          "csv_format": {
            "type": "string",
            "enum": [
              "cointracker",
              "koinly",
              "harmony",
              "quickbooks"
            ],
            "description": [
              "Format to print csv as."
            ]
          }
        }
      },
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-bkpr-listincome(7)",
        "lightning-bkpr-listfunds(7)",
        "lightning-bkpr-listaccountevents(7)",
        "lightning-bkpr-channelsapy(7)",
        "lightning-listpeers(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:bkpr-dumpincomecsv#1",
            "method": "bkpr-dumpincomecsv",
            "params": [
              "koinly",
              "koinly.csv"
            ]
          },
          "response": {
            "csv_file": "koinly.csv",
            "csv_format": "koinly"
          }
        }
      ]
    },
    "bkpr-editdescriptionbyoutpoint.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "rpc": "bkpr-editdescriptionbyoutpoint",
      "title": "Command to change the description for events with {outpoint} after they're made",
      "description": [
        "The **bkpr-editdescriptionbyoutpoint** RPC command updates all chain and channel events that match the {outpoint} with the provided {description}"
      ],
      "request": {
        "required": [
          "outpoint",
          "description"
        ],
        "properties": {
          "outpoint": {
            "type": "string",
            "description": [
              "The outpoint to update the description for."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "The description to update to"
            ]
          }
        }
      },
      "response": {
        "required": [
          "updated"
        ],
        "properties": {
          "updated": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "account",
                "type",
                "tag",
                "credit_msat",
                "debit_msat",
                "currency",
                "timestamp",
                "description"
              ],
              "properties": {
                "account": {
                  "type": "string",
                  "description": [
                    "The account name. If the account is a channel, the channel_id."
                  ]
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "chain",
                    "channel"
                  ],
                  "description": [
                    "Coin movement type."
                  ]
                },
                "tag": {
                  "type": "string",
                  "description": [
                    "Description of movement."
                  ]
                },
                "credit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount credited."
                  ]
                },
                "debit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount debited."
                  ]
                },
                "currency": {
                  "type": "string",
                  "description": [
                    "Human-readable bech32 part for this coin type."
                  ]
                },
                "timestamp": {
                  "type": "u32",
                  "description": [
                    "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp."
                  ]
                },
                "description": {
                  "type": "string",
                  "description": [
                    "The description of this event"
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "chain"
                        ]
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "account": {},
                      "type": {},
                      "tag": {},
                      "credit_msat": {},
                      "debit_msat": {},
                      "currency": {},
                      "timestamp": {},
                      "description": {
                        "type": "string",
                        "description": [
                          "A description of this outpoint."
                        ]
                      },
                      "outpoint": {
                        "type": "string",
                        "description": [
                          "The txid:outnum for this event."
                        ]
                      },
                      "blockheight": {
                        "type": "u32",
                        "description": [
                          "For chain events, blockheight this occured at."
                        ]
                      },
                      "origin": {
                        "type": "string",
                        "description": [
                          "The account this movement originated from."
                        ]
                      },
                      "payment_id": {
                        "type": "hex",
                        "description": [
                          "Lightning payment identifier. For an htlc, this will be the preimage."
                        ]
                      },
                      "txid": {
                        "type": "txid",
                        "description": [
                          "The txid of the transaction that created this event."
                        ]
                      }
                    },
                    "required": [
                      "outpoint",
                      "blockheight"
                    ],
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "onchain_fee"
                        ]
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "account": {},
                      "type": {},
                      "tag": {},
                      "credit_msat": {},
                      "debit_msat": {},
                      "currency": {},
                      "timestamp": {},
                      "description": {},
                      "txid": {
                        "type": "txid",
                        "description": [
                          "The txid of the transaction that created this event."
                        ]
                      }
                    },
                    "required": [
                      "txid"
                    ],
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "channel"
                        ]
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "account": {},
                      "type": {},
                      "tag": {},
                      "credit_msat": {},
                      "debit_msat": {},
                      "currency": {},
                      "timestamp": {},
                      "description": {},
                      "fees_msat": {
                        "type": "msat",
                        "description": [
                          "Amount paid in fees."
                        ]
                      },
                      "is_rebalance": {
                        "type": "boolean",
                        "description": [
                          "Is this payment part of a rebalance."
                        ]
                      },
                      "payment_id": {
                        "type": "hex",
                        "description": [
                          "Lightning payment identifier. For an htlc, this will be the preimage."
                        ]
                      },
                      "part_id": {
                        "type": "u32",
                        "description": [
                          "Counter for multi-part payments."
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              ]
            }
          }
        }
      },
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-bkpr-editdescriptionbypaymentid(7)",
        "lightning-bkpr-listaccountevents(7)",
        "lightning-bkpr-listincome(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:bkpr-editdescriptionbyoutpoint#1",
            "method": "bkpr-editdescriptionbyoutpoint",
            "params": {
              "outpoint": "txidbk0101010101010101010101010101010101010101010101010101010101:1",
              "description": "edited utxo description"
            }
          },
          "response": {
            "updated": [
              {
                "account": "wallet",
                "type": "chain",
                "tag": "deposit",
                "credit_msat": 200000000000,
                "debit_msat": 0,
                "currency": "bcrt",
                "outpoint": "txidbk0101010101010101010101010101010101010101010101010101010101:1",
                "timestamp": 1738510000,
                "blockheight": 110,
                "description": "edited utxo description"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:bkpr-editdescriptionbyoutpoint#2",
            "method": "bkpr-editdescriptionbyoutpoint",
            "params": {
              "outpoint": "abcd020202020202020202020202020202020202020202020202020202020202:1",
              "description": "edited utxo description for non existing outpoint"
            }
          },
          "response": {
            "updated": []
          }
        }
      ]
    },
    "bkpr-editdescriptionbypaymentid.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "rpc": "bkpr-editdescriptionbypaymentid",
      "title": "Command to change the description for events with `payment_id` after they're made",
      "description": [
        "The **bkpr-editdescriptionbypaymentid** RPC command updates all chain and channel events that match the `payment_id` with the provided `description`"
      ],
      "request": {
        "required": [
          "payment_id",
          "description"
        ],
        "properties": {
          "payment_id": {
            "type": "string",
            "description": [
              "The payment hash (payment_id) to update the description for."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "The description to update to"
            ]
          }
        }
      },
      "response": {
        "required": [
          "updated"
        ],
        "properties": {
          "updated": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "account",
                "type",
                "tag",
                "credit_msat",
                "debit_msat",
                "currency",
                "timestamp",
                "description"
              ],
              "properties": {
                "account": {
                  "type": "string",
                  "description": [
                    "The account name. If the account is a channel, the channel_id."
                  ]
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "chain",
                    "channel"
                  ],
                  "description": [
                    "Coin movement type."
                  ]
                },
                "tag": {
                  "type": "string",
                  "description": [
                    "Description of movement."
                  ]
                },
                "credit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount credited."
                  ]
                },
                "debit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount debited."
                  ]
                },
                "currency": {
                  "type": "string",
                  "description": [
                    "Human-readable bech32 part for this coin type."
                  ]
                },
                "timestamp": {
                  "type": "u32",
                  "description": [
                    "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp."
                  ]
                },
                "description": {
                  "type": "string",
                  "description": [
                    "The description of this event"
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "chain"
                        ]
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "account": {},
                      "type": {},
                      "tag": {},
                      "credit_msat": {},
                      "debit_msat": {},
                      "currency": {},
                      "timestamp": {},
                      "outpoint": {
                        "type": "string",
                        "description": [
                          "The txid:outnum for this event."
                        ]
                      },
                      "blockheight": {
                        "type": "u32",
                        "description": [
                          "For chain events, blockheight this occured at."
                        ]
                      },
                      "origin": {
                        "type": "string",
                        "description": [
                          "The account this movement originated from."
                        ]
                      },
                      "payment_id": {
                        "type": "hex",
                        "description": [
                          "Lightning payment identifier. For an htlc, this will be the preimage."
                        ]
                      },
                      "txid": {
                        "type": "txid",
                        "description": [
                          "The txid of the transaction that created this event."
                        ]
                      }
                    },
                    "required": [
                      "outpoint",
                      "blockheight"
                    ],
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "onchain_fee"
                        ]
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "account": {},
                      "type": {},
                      "tag": {},
                      "credit_msat": {},
                      "debit_msat": {},
                      "currency": {},
                      "timestamp": {},
                      "description": {},
                      "txid": {
                        "type": "txid",
                        "description": [
                          "The txid of the transaction that created this event."
                        ]
                      }
                    },
                    "required": [
                      "txid"
                    ],
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "channel"
                        ]
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "account": {},
                      "type": {},
                      "tag": {},
                      "credit_msat": {},
                      "debit_msat": {},
                      "currency": {},
                      "timestamp": {},
                      "description": {},
                      "fees_msat": {
                        "type": "msat",
                        "description": [
                          "Amount paid in fees."
                        ]
                      },
                      "is_rebalance": {
                        "type": "boolean",
                        "description": [
                          "Is this payment part of a rebalance."
                        ]
                      },
                      "payment_id": {
                        "type": "hex",
                        "description": [
                          "Lightning payment identifier. For an htlc, this will be the preimage."
                        ]
                      },
                      "part_id": {
                        "type": "u32",
                        "description": [
                          "Counter for multi-part payments."
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              ]
            }
          }
        }
      },
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-bkpr-editdescriptionbyoutpoint(7)",
        "lightning-bkpr-listaccountevents(7)",
        "lightning-bkpr-listincome(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:bkpr-editdescriptionbypaymentid#1",
            "method": "bkpr-editdescriptionbypaymentid",
            "params": {
              "payment_id": "paymentid0000202020202020202020202020202020202020202020202020202",
              "description": "edited invoice description from description send some sats l2 to l3"
            }
          },
          "response": {
            "updated": [
              {
                "account": "channelid0230000230000230000230000230000230000230000230000230000",
                "type": "channel",
                "tag": "invoice",
                "credit_msat": 500000000,
                "debit_msat": 0,
                "currency": "bcrt",
                "payment_id": "paymentid0000202020202020202020202020202020202020202020202020202",
                "part_id": 0,
                "timestamp": 1738520000,
                "description": "edited invoice description from description send some sats l2 to l3",
                "is_rebalance": false
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:bkpr-editdescriptionbypaymentid#2",
            "method": "bkpr-editdescriptionbypaymentid",
            "params": {
              "payment_id": "c000010101010101010101010101010101010101010101010101010101010101",
              "description": "edited invoice description for non existing payment id"
            }
          },
          "response": {
            "updated": []
          }
        }
      ]
    },
    "bkpr-inspect.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "bkpr-inspect",
      "title": "Command to show onchain footprint of a channel",
      "description": [
        "The **bkpr-inspect** RPC command lists all known on-chain transactions and associated events for the provided account. Useful for inspecting unilateral closes for a given channel account. Only valid for channel accounts."
      ],
      "request": {
        "required": [
          "account"
        ],
        "additionalProperties": false,
        "properties": {
          "account": {
            "type": "string",
            "description": [
              "Channel account to inspect."
            ]
          }
        }
      },
      "response": {
        "required": [
          "txs"
        ],
        "additionalProperties": false,
        "properties": {
          "txs": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "txid",
                "fees_paid_msat",
                "outputs"
              ],
              "properties": {
                "txid": {
                  "type": "txid",
                  "description": [
                    "Transaction id."
                  ]
                },
                "blockheight": {
                  "type": "u32",
                  "description": [
                    "Blockheight of transaction."
                  ]
                },
                "fees_paid_msat": {
                  "type": "msat",
                  "description": [
                    "Amount paid in sats for this tx."
                  ]
                },
                "outputs": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "account",
                      "outnum",
                      "output_value_msat",
                      "currency"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "account": {
                        "type": "string",
                        "description": [
                          "Account this output affected."
                        ]
                      },
                      "outnum": {
                        "type": "u32",
                        "description": [
                          "Index of output."
                        ]
                      },
                      "output_value_msat": {
                        "type": "msat",
                        "description": [
                          "Value of the output."
                        ]
                      },
                      "currency": {
                        "type": "string",
                        "description": [
                          "Human-readable bech32 part for this coin type."
                        ]
                      },
                      "credit_msat": {
                        "type": "msat",
                        "description": [
                          "Amount credited to account."
                        ]
                      },
                      "debit_msat": {
                        "type": "msat",
                        "description": [
                          "Amount debited from account."
                        ]
                      },
                      "originating_account": {
                        "type": "string",
                        "description": [
                          "Account this output originated from."
                        ]
                      },
                      "output_tag": {
                        "type": "string",
                        "description": [
                          "Description of output creation event."
                        ]
                      },
                      "spend_tag": {
                        "type": "string",
                        "description": [
                          "Description of output spend event."
                        ]
                      },
                      "spending_txid": {
                        "type": "txid",
                        "description": [
                          "Transaction this output was spent in."
                        ]
                      },
                      "payment_id": {
                        "type": "hex",
                        "description": [
                          "Lightning payment identifier. For an htlc, this will be the preimage."
                        ]
                      }
                    },
                    "allOf": [
                      {
                        "if": {
                          "required": [
                            "credit_msat"
                          ]
                        },
                        "then": {
                          "required": [
                            "output_tag"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "account": {},
                            "outnum": {},
                            "output_value_msat": {},
                            "currency": {},
                            "credit_msat": {},
                            "originating_account": {},
                            "debit_msat": {},
                            "output_tag": {},
                            "spend_tag": {},
                            "spending_txid": {},
                            "payment_id": {}
                          }
                        }
                      },
                      {
                        "if": {
                          "required": [
                            "spending_txid"
                          ]
                        },
                        "then": {
                          "required": [
                            "spend_tag",
                            "debit_msat"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "account": {},
                            "outnum": {},
                            "output_value_msat": {},
                            "currency": {},
                            "credit_msat": {},
                            "originating_account": {},
                            "debit_msat": {},
                            "output_tag": {},
                            "spend_tag": {},
                            "spending_txid": {},
                            "payment_id": {}
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-listbalances(7)",
        "lightning-listfunds(7)",
        "lightning-listpeers(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:bkpr-inspect#1",
            "method": "bkpr-inspect",
            "params": {
              "account": "channelid0230200230200230200230200230200230200230200230200230200"
            }
          },
          "response": {
            "txs": [
              {
                "txid": "channeltxid230200230200230200230200230200230200230200230200230200",
                "blockheight": 123,
                "fees_paid_msat": 5020000,
                "outputs": [
                  {
                    "account": "channelid0230200230200230200230200230200230200230200230200230200",
                    "outnum": 1,
                    "output_tag": "channel_open",
                    "output_value_msat": 1000000000,
                    "credit_msat": 1000000000,
                    "currency": "bcrt"
                  }
                ]
              }
            ]
          }
        }
      ]
    },
    "bkpr-listaccountevents.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "bkpr-listaccountevents",
      "title": "Command for listing recorded bookkeeping events",
      "description": [
        "The **bkpr-listaccountevents** RPC command is a list of all bookkeeping events that have been recorded for this node.",
        "",
        "If the optional parameter **account** is set, we only emit events for the specified account, if exists.",
        "",
        "If the optional parameter **payment_id** is set, we only emit events which have that value as payment hash or as transaction id.",
        "",
        "The parameters **account** and **payment_id** are mutually exclusive.",
        "",
        "Note that the type **onchain_fees** that are emitted are of opposite credit/debit than as they appear in **listincome**, as **listincome** shows all events from the perspective of the node, whereas **listaccountevents** just dumps the event data as we've got it. Onchain fees are updated/recorded as we get more information about input and output spends -- the total onchain fees that were recorded for a transaction for an account can be found by summing all onchain fee events and taking the difference between the **credit_msat** and **debit_msat** for these events. We do this so that successive calls to **listaccountevents** always produce the same list of events -- no previously emitted event will be subsequently updated, rather we add a new event to the list."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "account": {
            "type": "string",
            "description": [
              "Receive events for the specified account."
            ]
          },
          "payment_id": {
            "type": "string",
            "added": "v24.08",
            "description": [
              "Receive events for the specified payment id."
            ]
          }
        }
      },
      "response": {
        "required": [
          "events"
        ],
        "additionalProperties": false,
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "account",
                "type",
                "tag",
                "credit_msat",
                "debit_msat",
                "currency",
                "timestamp"
              ],
              "properties": {
                "account": {
                  "type": "string",
                  "description": [
                    "The account name. If the account is a channel, the channel_id."
                  ]
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "onchain_fee",
                    "chain",
                    "channel"
                  ],
                  "description": [
                    "Coin movement type."
                  ]
                },
                "tag": {
                  "type": "string",
                  "description": [
                    "Description of movement."
                  ]
                },
                "credit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount credited."
                  ]
                },
                "debit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount debited."
                  ]
                },
                "currency": {
                  "type": "string",
                  "description": [
                    "Human-readable bech32 part for this coin type."
                  ]
                },
                "timestamp": {
                  "type": "u32",
                  "description": [
                    "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp."
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "chain"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "properties": {
                      "account": {},
                      "type": {},
                      "tag": {},
                      "credit_msat": {},
                      "debit_msat": {},
                      "currency": {},
                      "timestamp": {},
                      "description": {
                        "type": "string",
                        "description": [
                          "The description of this event."
                        ]
                      },
                      "outpoint": {
                        "type": "string",
                        "description": [
                          "The txid:outnum for this event."
                        ]
                      },
                      "blockheight": {
                        "type": "u32",
                        "description": [
                          "For chain events, blockheight this occured at."
                        ]
                      },
                      "origin": {
                        "type": "string",
                        "description": [
                          "The account this movement originated from."
                        ]
                      },
                      "payment_id": {
                        "type": "hex",
                        "description": [
                          "Lightning payment identifier. For an htlc, this will be the preimage."
                        ]
                      },
                      "txid": {
                        "type": "txid",
                        "description": [
                          "The txid of the transaction that created this event."
                        ]
                      }
                    },
                    "required": [
                      "outpoint",
                      "blockheight"
                    ]
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "onchain_fee"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "properties": {
                      "account": {},
                      "type": {},
                      "tag": {},
                      "credit_msat": {},
                      "debit_msat": {},
                      "currency": {},
                      "timestamp": {},
                      "description": {},
                      "txid": {
                        "type": "txid",
                        "description": [
                          "The txid of the transaction that created this event."
                        ]
                      }
                    },
                    "required": [
                      "txid"
                    ]
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "channel"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "properties": {
                      "account": {},
                      "type": {},
                      "tag": {},
                      "credit_msat": {},
                      "debit_msat": {},
                      "currency": {},
                      "timestamp": {},
                      "description": {},
                      "fees_msat": {
                        "type": "msat",
                        "description": [
                          "Amount paid in fees."
                        ]
                      },
                      "is_rebalance": {
                        "type": "boolean",
                        "description": [
                          "Is this payment part of a rebalance."
                        ]
                      },
                      "payment_id": {
                        "type": "hex",
                        "description": [
                          "Lightning payment identifier. For an htlc, this will be the preimage."
                        ]
                      },
                      "part_id": {
                        "type": "u32",
                        "description": [
                          "Counter for multi-part payments."
                        ]
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-bkpr-listincome(7)",
        "lightning-listfunds(7)",
        "lightning-bkpr-listbalances(7)",
        "lightning-bkpr-channelsapy(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:bkpr-listaccountevents#1",
            "method": "bkpr-listaccountevents",
            "params": [
              "channelid0230200230200230200230200230200230200230200230200230200"
            ]
          },
          "response": {
            "events": [
              {
                "account": "channelid0230200230200230200230200230200230200230200230200230200",
                "type": "chain",
                "tag": "channel_open",
                "credit_msat": 0,
                "debit_msat": 0,
                "currency": "bcrt",
                "outpoint": "txidbk0101010101010101010101010101010101010101010101010101010101:1",
                "timestamp": 1738500000,
                "blockheight": 123
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:bkpr-listaccountevents#2",
            "method": "bkpr-listaccountevents",
            "params": {}
          },
          "response": {
            "events": [
              {
                "account": "external",
                "origin": "channelid0340000340000340000340000340000340000340000340000340000",
                "type": "chain",
                "tag": "to_them",
                "credit_msat": 510010000,
                "debit_msat": 0,
                "currency": "bcrt",
                "outpoint": "txidbk0202020202020202020202020202020202020202020202020202020202:1",
                "timestamp": 1738520000,
                "blockheight": 142
              },
              {
                "account": "wallet",
                "type": "chain",
                "tag": "deposit",
                "credit_msat": 200000000000,
                "debit_msat": 0,
                "currency": "bcrt",
                "outpoint": "txidbk0101010101010101010101010101010101010101010101010101010101:1",
                "timestamp": 1738510000,
                "blockheight": 141,
                "description": "edited utxo description"
              },
              {
                "account": "channelid0230000230000230000230000230000230000230000230000230000",
                "type": "chain",
                "tag": "channel_open",
                "credit_msat": 0,
                "debit_msat": 0,
                "currency": "bcrt",
                "outpoint": "txidbk0303030303030303030303030303030303030303030303030303030303:1",
                "timestamp": 1738530000,
                "blockheight": 143
              }
            ]
          }
        }
      ]
    },
    "bkpr-listbalances.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "bkpr-listbalances",
      "title": "Command for listing current channel + wallet balances",
      "description": [
        "The **bkpr-listbalances** RPC command is a list of all current and historical account balances. An account is either the on-chain *wallet* or a channel balance. Any funds sent to an *external* account will not be accounted for here.",
        "",
        "Note that any channel that was recorded will be listed. Closed channel balances will be 0msat."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "response": {
        "required": [
          "accounts"
        ],
        "additionalProperties": false,
        "properties": {
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "account",
                "balances"
              ],
              "properties": {
                "account": {
                  "type": "string",
                  "description": [
                    "The account name. If the account is a channel, the channel_id."
                  ]
                },
                "balances": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "balance_msat",
                      "coin_type"
                    ],
                    "properties": {
                      "balance_msat": {
                        "type": "msat",
                        "description": [
                          "Current account balance."
                        ]
                      },
                      "coin_type": {
                        "type": "string",
                        "description": [
                          "Coin type, same as HRP for bech32."
                        ]
                      }
                    }
                  }
                }
              },
              "if": {
                "required": [
                  "peer_id"
                ]
              },
              "then": {
                "required": [
                  "account",
                  "balances",
                  "peer_id",
                  "we_opened",
                  "account_closed",
                  "account_resolved"
                ],
                "additionalProperties": false,
                "properties": {
                  "account": {},
                  "balances": {},
                  "peer_id": {
                    "type": "pubkey",
                    "description": [
                      "Node id for the peer this account is with."
                    ]
                  },
                  "we_opened": {
                    "type": "boolean",
                    "description": [
                      "Did we initiate this account open (open the channel)."
                    ]
                  },
                  "account_closed": {
                    "type": "boolean",
                    "description": [
                      "",
                      ""
                    ]
                  },
                  "account_resolved": {
                    "type": "boolean",
                    "description": [
                      "Has this channel been closed and all outputs resolved?"
                    ]
                  },
                  "resolved_at_block": {
                    "type": "u32",
                    "description": [
                      "Blockheight account resolved on chain."
                    ]
                  }
                }
              },
              "else": {
                "additionalProperties": false,
                "properties": {
                  "account": {},
                  "balances": {}
                }
              }
            }
          }
        }
      },
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-bkpr-listincome(7)",
        "lightning-listfunds(7)",
        "lightning-bkpr-listaccountevents(7)",
        "lightning-bkpr-channelsapy(7)",
        "lightning-listpeers(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:bkpr-listbalances#1",
            "method": "bkpr-listbalances",
            "params": {}
          },
          "response": {
            "accounts": [
              {
                "account": "wallet",
                "balances": [
                  {
                    "balance_msat": 202050000000,
                    "coin_type": "bcrt"
                  }
                ]
              },
              {
                "account": "channelid0230000230000230000230000230000230000230000230000230000",
                "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "we_opened": false,
                "account_closed": true,
                "account_resolved": true,
                "resolved_at_block": 121,
                "balances": [
                  {
                    "balance_msat": 0,
                    "coin_type": "bcrt"
                  }
                ]
              },
              {
                "account": "channelid0340000340000340000340000340000340000340000340000340000",
                "peer_id": "nodeid040404040404040404040404040404040404040404040404040404040404",
                "we_opened": true,
                "account_closed": true,
                "account_resolved": false,
                "balances": [
                  {
                    "balance_msat": 0,
                    "coin_type": "bcrt"
                  }
                ]
              },
              {
                "account": "channelid0230200230200230200230200230200230200230200230200230200",
                "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "we_opened": false,
                "account_closed": false,
                "account_resolved": false,
                "balances": [
                  {
                    "balance_msat": 0,
                    "coin_type": "bcrt"
                  }
                ]
              },
              {
                "account": "channelid0340200340200340200340200340200340200340200340200340200",
                "peer_id": "nodeid040404040404040404040404040404040404040404040404040404040404",
                "we_opened": true,
                "account_closed": false,
                "account_resolved": false,
                "balances": [
                  {
                    "balance_msat": 1000000000,
                    "coin_type": "bcrt"
                  }
                ]
              }
            ]
          }
        }
      ]
    },
    "bkpr-listincome.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "pre-v0.10.1",
      "rpc": "bkpr-listincome",
      "title": "Command for listing all income impacting events",
      "description": [
        "The **bkpr-listincome** RPC command is a list of all income impacting events that the bookkeeper plugin has recorded for this node."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "consolidate_fees": {
            "type": "boolean",
            "description": [
              "If true, we emit a single, consolidated event for any onchain-fees for a txid and account. Otherwise, events for every update to the onchain fee calculation for this account and txid will be printed. Note that this means that the events emitted are non-stable, i.e. calling **listincome** twice may result in different onchain fee events being emitted, depending on how much information we've logged for that transaction."
            ],
            "default": "True"
          },
          "start_time": {
            "type": "u32",
            "description": [
              "UNIX timestamp (in seconds) that filters events after the provided timestamp."
            ],
            "default": "zero"
          },
          "end_time": {
            "type": "u32",
            "description": [
              "UNIX timestamp (in seconds) that filters events up to and at the provided timestamp."
            ],
            "default": "max-int"
          }
        }
      },
      "response": {
        "required": [
          "income_events"
        ],
        "additionalProperties": false,
        "properties": {
          "income_events": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "account",
                "tag",
                "credit_msat",
                "debit_msat",
                "currency",
                "timestamp"
              ],
              "properties": {
                "account": {
                  "type": "string",
                  "description": [
                    "The account name. If the account is a channel, the channel_id."
                  ]
                },
                "tag": {
                  "type": "string",
                  "description": [
                    "Type of income event."
                  ]
                },
                "credit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount earned (income)."
                  ]
                },
                "debit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount spent (expenses)."
                  ]
                },
                "currency": {
                  "type": "string",
                  "description": [
                    "Human-readable bech32 part for this coin type."
                  ]
                },
                "timestamp": {
                  "type": "u32",
                  "description": [
                    "Timestamp this event was recorded by the node. For consolidated events such as onchain_fees, the most recent timestamp."
                  ]
                },
                "description": {
                  "type": "string",
                  "description": [
                    "More information about this event. If a `invoice` type, typically the bolt11/bolt12 description."
                  ]
                },
                "outpoint": {
                  "type": "string",
                  "description": [
                    "The txid:outnum for this event, if applicable."
                  ]
                },
                "txid": {
                  "type": "txid",
                  "description": [
                    "The txid of the transaction that created this event, if applicable."
                  ]
                },
                "payment_id": {
                  "type": "hex",
                  "description": [
                    "Lightning payment identifier. For an htlc, this will be the preimage."
                  ]
                }
              }
            }
          }
        }
      },
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-bkpr-listaccountevents(7)",
        "lightning-listfunds(7)",
        "lightning-bkpr-listbalances(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:bkpr-listincome#1",
            "method": "bkpr-listincome",
            "params": {
              "consolidate_fees": false
            }
          },
          "response": {
            "income_events": [
              {
                "account": "wallet",
                "tag": "deposit",
                "credit_msat": 200000000000,
                "debit_msat": 0,
                "currency": "bcrt",
                "timestamp": 1738500000,
                "description": "edited utxo description",
                "outpoint": "txidbk0000000000000000000000000000000000000000000000000000000000:1"
              },
              {
                "account": "wallet",
                "tag": "deposit",
                "credit_msat": 2000000000,
                "debit_msat": 0,
                "currency": "bcrt",
                "timestamp": 1738510000,
                "outpoint": "txidbk0101010101010101010101010101010101010101010101010101010101:1"
              },
              {
                "account": "wallet",
                "tag": "onchain_fee",
                "credit_msat": 0,
                "debit_msat": 1004927000,
                "currency": "bcrt",
                "timestamp": 1738520000,
                "txid": "channeltxid340000340000340000340000340000340000340000340000340000"
              },
              {
                "account": "wallet",
                "tag": "onchain_fee",
                "credit_msat": 1004927000,
                "debit_msat": 0,
                "currency": "bcrt",
                "timestamp": 1738530000,
                "txid": "channeltxid340000340000340000340000340000340000340000340000340000"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:bkpr-listincome#2",
            "method": "bkpr-listincome",
            "params": {}
          },
          "response": {
            "income_events": [
              {
                "account": "wallet",
                "tag": "deposit",
                "credit_msat": 200000000000,
                "debit_msat": 0,
                "currency": "bcrt",
                "timestamp": 1738510000,
                "description": "edited utxo description",
                "outpoint": "txidbk0101010101010101010101010101010101010101010101010101010101:1"
              },
              {
                "account": "channelid0230000230000230000230000230000230000230000230000230000",
                "tag": "invoice",
                "credit_msat": 500000000,
                "debit_msat": 0,
                "currency": "bcrt",
                "timestamp": 1738520000,
                "description": "edited invoice description from description send some sats l2 to l3",
                "payment_id": "paymentid0000202020202020202020202020202020202020202020202020202"
              },
              {
                "account": "channelid0340200340200340200340200340200340200340200340200340200",
                "tag": "onchain_fee",
                "credit_msat": 0,
                "debit_msat": 6960000,
                "currency": "bcrt",
                "timestamp": 1738530000,
                "txid": "channeltxid340200340200340200340200340200340200340200340200340200"
              }
            ]
          }
        }
      ]
    },
    "blacklistrune.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.08",
      "rpc": "blacklistrune",
      "title": "Command to prevent a rune from working",
      "description": [
        "The **blacklistrune** RPC command allows you to effectively revoke the rune you have created (and any runes derived from that rune with additional restictions). Attempting to use these runes will be resulted in a `Blacklisted rune` error message.",
        "",
        "Destroy a rune like in olden times with the **destroyrune** command.",
        "",
        "All runes created by lightning have a unique sequential id within them and can be blacklisted in ranges for efficiency. The command always returns the blacklisted ranges on success. If no parameters are specified, no changes have been made. If start specified without end, that single rune is blacklisted. If end is also specified, every rune from start till end inclusive is blacklisted."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "start": {
            "type": "u64",
            "description": [
              "First rune unique id to blacklist."
            ]
          },
          "end": {
            "type": "u64",
            "description": [
              "Final rune unique id to blacklist (defaults to start)."
            ]
          },
          "relist": {
            "type": "boolean",
            "added": "v25.02",
            "description": [
              "Undo the blacklisting (if any) of every rune in range start to end (inclusive)"
            ]
          }
        },
        "dependentUpon": {
          "start": [
            "end"
          ]
        }
      },
      "response": {
        "required": [
          "blacklist"
        ],
        "additionalProperties": false,
        "properties": {
          "blacklist": {
            "type": "array",
            "description": [
              "The resulting blacklist ranges after the command."
            ],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "start",
                "end"
              ],
              "properties": {
                "start": {
                  "type": "u64",
                  "description": [
                    "Unique id of first rune in this blacklist range."
                  ]
                },
                "end": {
                  "type": "u64",
                  "description": [
                    "Unique id of last rune in this blacklist range."
                  ]
                }
              }
            }
          }
        }
      },
      "author": [
        "Shahana Farooqui [sfarooqui@blockstream.com](mailto:sfarooqui@blockstream.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-commando-blacklist(7)",
        "lightning-showrunes(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:blacklistrune#1",
            "method": "blacklistrune",
            "params": {
              "start": 1
            }
          },
          "response": {
            "blacklist": [
              {
                "start": 1,
                "end": 1
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:blacklistrune#2",
            "method": "blacklistrune",
            "params": {
              "start": 0,
              "end": 2
            }
          },
          "response": {
            "blacklist": [
              {
                "start": 0,
                "end": 2
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:blacklistrune#3",
            "method": "blacklistrune",
            "params": {
              "start": 3,
              "end": 4
            }
          },
          "response": {
            "blacklist": [
              {
                "start": 0,
                "end": 4
              }
            ]
          }
        },
        {
          "description": [
            "This undoes the blacklisting of rune 3 only"
          ],
          "request": {
            "id": "example:blacklistrune#4",
            "method": "blacklistrune",
            "params": {
              "start": 3,
              "relist": true
            }
          },
          "response": {
            "blacklist": [
              {
                "start": 0,
                "end": 2
              },
              {
                "start": 4,
                "end": 4
              }
            ]
          }
        }
      ]
    },
    "cancelrecurringinvoice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v25.09",
      "rpc": "cancelrecurringinvoice",
      "title": "Command for sending a cancel message for a recurring offer",
      "description": [
        "NOTE: Recurring offers are experimental, and may be changed in backwards-incompable ways.",
        "",
        "The **cancelrecurringinvoice** RPC command sends a cancellation message in place of an invoice_request.  The BOLT 12 specification suggests sending this as a courtesy in place of the next invoice_request (as would be sent by fetchinvoice)."
      ],
      "request": {
        "required": [
          "offer",
          "recurrence_counter",
          "recurrence_label"
        ],
        "additionalProperties": false,
        "properties": {
          "offer": {
            "type": "string",
            "description": [
              "Offer string (must be recurring) which we have been paying."
            ]
          },
          "recurrence_counter": {
            "type": "u64",
            "description": [
              "One later than the last-specified recurrence_counter for the last invoice."
            ]
          },
          "recurrence_label": {
            "type": "string",
            "description": [
              "This must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together."
            ]
          },
          "recurrence_start": {
            "type": "number",
            "description": [
              "Indicates what period number to start at (usually 0).  This will be the same as previous fetchinvoice calls."
            ]
          },
          "payer_note": {
            "type": "string",
            "description": [
              "To tell the issuer the reason for the cancellation."
            ]
          },
          "bip353": {
            "type": "string",
            "description": [
              "BIP353 string (optionally with \u20bf) indicating where we fetched the offer from"
            ]
          }
        }
      },
      "response": {
        "required": [
          "bolt12"
        ],
        "additionalProperties": false,
        "properties": {
          "bolt12": {
            "type": "string",
            "description": [
              "The invoice_request we sent to the issuer."
            ]
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-fetchinvoice(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ]
    },
    "check.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "check",
      "title": "Command for verifying parameters",
      "description": [
        "The **check** RPC command verifies another command without actually making any changes.",
        "",
        "This is guaranteed to be safe, and will do all checks up to the point where something in the system would need to be altered (such as checking that channels are in the right state, peers connected, etc).",
        "",
        "It does not guarantee successful execution of the command in all cases. For example, a call to lightning-getroute(7) may still fail to find a route even if checking the parameters succeeds."
      ],
      "request": {
        "required": [
          "command_to_check"
        ],
        "additionalProperties": true,
        "properties": {
          "command_to_check": {
            "type": "string",
            "description": [
              "Name of the relevant command."
            ]
          }
        }
      },
      "response": {
        "additionalProperties": false,
        "properties": {
          "command_to_check": {
            "type": "string",
            "description": [
              "The *command_to_check* argument."
            ]
          }
        },
        "required": [
          "command_to_check"
        ]
      },
      "author": [
        "Mark Beckwith [wythe@intrig.com](mailto:wythe@intrig.com) and Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) are mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:check#1",
            "method": "check",
            "params": {
              "command_to_check": "sendpay",
              "route": [
                {
                  "amount_msat": 1011,
                  "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                  "delay": 20,
                  "channel": "123x1x1"
                },
                {
                  "amount_msat": 1000,
                  "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
                  "delay": 10,
                  "channel": "130x1x1"
                }
              ],
              "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000"
            }
          },
          "response": {
            "command_to_check": "sendpay"
          }
        },
        {
          "request": {
            "id": "example:check#2",
            "method": "check",
            "params": {
              "command_to_check": "dev",
              "subcommand": "slowcmd",
              "msec": 1000
            }
          },
          "response": {
            "command_to_check": "dev"
          }
        },
        {
          "request": {
            "id": "example:check#3",
            "method": "check",
            "params": {
              "command_to_check": "recover",
              "hsmsecret": "6c696768746e696e672d31000000000000000000000000000000000000000000"
            }
          },
          "response": {
            "command_to_check": "recover"
          }
        }
      ]
    },
    "checkmessage.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "checkmessage",
      "title": "Command to check if a signature is from a node",
      "description": [
        "The **checkmessage** RPC command is the counterpart to **signmessage**: given a node id (*pubkey*), signature (*zbase*) and a *message*, it verifies that the signature was generated by that node for that message (more technically: by someone who knows that node's secret).",
        "",
        "As a special case, if *pubkey* is not specified, we will try every known node key (as per *listnodes*), and verification succeeds if it matches for any one of them. Note: this is implemented far more efficiently than trying each one, so performance is not a concern."
      ],
      "request": {
        "required": [
          "message",
          "zbase"
        ],
        "additionalProperties": false,
        "properties": {
          "message": {
            "type": "string",
            "description": [
              "Message to be checked against the signature."
            ]
          },
          "zbase": {
            "type": "string",
            "description": [
              "The Zbase32 encoded signature to verify."
            ]
          },
          "pubkey": {
            "type": "pubkey",
            "description": [
              "The Zbase32 encoded signature to verify."
            ]
          }
        }
      },
      "response": {
        "required": [
          "verified",
          "pubkey"
        ],
        "additionalProperties": false,
        "properties": {
          "verified": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": [
              "Whether the signature was valid."
            ]
          },
          "pubkey": {
            "type": "pubkey",
            "description": [
              "The *pubkey* parameter, or the pubkey found by looking for known nodes."
            ]
          }
        }
      },
      "errors": [
        "On failure, an error is returned and core lightning exit with the following error code:",
        "",
        "- -32602: Parameter missed or malformed;",
        "- 1301: *pubkey* not found in the graph."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-signmessage(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:checkmessage#1",
            "method": "checkmessage",
            "params": {
              "message": "testcase to check new rpc error",
              "zbase": "d66bqz3qsku5fxtqsi37j11pci47ydxa95iusphutggz9ezaxt56neh77kxe5hyr41kwgkncgiu94p9ecxiexgpgsz8daoq4tw8kj8yx",
              "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7"
            }
          },
          "response": {
            "pubkey": "03be3b0e9992153b1d5a6e1623670b6c3663f72ce6cf2e0dd39c0a373a7de5a3b7",
            "verified": true
          }
        },
        {
          "request": {
            "id": "example:checkmessage#2",
            "method": "checkmessage",
            "params": {
              "message": "this is a test!",
              "zbase": "d6tqaeuonjhi98mmont9m4wag7gg4krg1f4txonug3h31e9h6p6k6nbwjondnj46dkyausobstnk7fhyy998bhgc1yr98dfmhb4k54d7"
            }
          },
          "response": {
            "pubkey": "nodeid010101010101010101010101010101010101010101010101010101010101",
            "verified": true
          }
        }
      ]
    },
    "checkrune.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.08",
      "rpc": "checkrune",
      "title": "Command to Validate Rune",
      "description": [
        "The **checkrune** RPC command checks the validity/authorization rights of specified rune for the given nodeid, method, and params.",
        "",
        "If successful, the rune \"usage\" counter (used for ratelimiting) is incremented.",
        "",
        "See lightning-createrune(7) for the fields in the rune which are checked."
      ],
      "request": {
        "required": [
          "rune"
        ],
        "additionalProperties": false,
        "properties": {
          "rune": {
            "type": "string",
            "description": [
              "Rune to check for authorization."
            ]
          },
          "nodeid": {
            "type": "string",
            "description": [
              "Node id of requesting node *(required until v23.11)*."
            ]
          },
          "method": {
            "type": "string",
            "description": [
              "Method for which rune needs to be validated *(required until v23.11)*."
            ]
          },
          "params": {
            "oneOf": [
              {
                "type": "array",
                "description": [
                  "Array of positional parameters."
                ]
              },
              {
                "type": "object",
                "description": [
                  "Parameters for method."
                ]
              }
            ]
          }
        }
      },
      "response": {
        "required": [
          "valid"
        ],
        "additionalProperties": false,
        "properties": {
          "valid": {
            "type": "boolean",
            "description": [
              "True if the rune is valid."
            ]
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- 1501 (RUNE_NOT_AUTHORIZED): rune is not for this node (or perhaps completely invalid)",
        "- 1502 (RUNE_NOT_PERMITTED): rune does not allow this usage (includes a detailed reason why)",
        "- 1503 (RUNE_BLACKLISTED): rune has been explicitly blacklisted."
      ],
      "author": [
        "Shahana Farooqui [sfarooqui@blockstream.com](mailto:sfarooqui@blockstream.com) is mainly responsible for consolidating logic from commando."
      ],
      "see_also": [
        "lightning-createrune(7)",
        "lightning-blacklistrune(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:checkrune#1",
            "method": "checkrune",
            "params": {
              "nodeid": "nodeid020202020202020202020202020202020202020202020202020202020202",
              "rune": "_RWaZZRI7wAYU2hqlFBmYgC_dFczcpAdI_9O87YbDpg9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl",
              "method": "listpeers",
              "params": {}
            }
          },
          "response": {
            "valid": true
          }
        },
        {
          "request": {
            "id": "example:checkrune#2",
            "method": "checkrune",
            "params": {
              "nodeid": "nodeid020202020202020202020202020202020202020202020202020202020202",
              "rune": "QUJEYMLGgiaJvMDv_MhR2hiMKIBTbq-PrL-KxcIlirQ9MiZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==",
              "method": "pay",
              "params": {
                "amount_msat": 9999
              }
            }
          },
          "response": {
            "valid": true
          }
        }
      ]
    },
    "clnrest-register-path.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v26.04",
      "rpc": "clnrest-register-path",
      "title": "Command to add a path to clnrest",
      "description": [
        "`clnrest-register-path` is a low-level rpc command for plugin developers to register a custom REST API path with an associated RPC method and optional rune validation."
      ],
      "request": {
        "required": [
          "path",
          "rpc_method"
        ],
        "properties": {
          "path": {
            "type": "string",
            "description": [
              "The REST API path to register (e.g., '/v1/custom/endpoint'). Captures which translate to an rpc parameter of 'key:value' are written like this: '/user/{key}'"
            ]
          },
          "rpc_method": {
            "type": "string",
            "description": [
              "The RPC method name to invoke when this ``path`` and ``http_method`` combination is accessed."
            ]
          },
          "http_method": {
            "type": "string",
            "description": [
              "HTTP method for this ``path``. Valid values are: ``GET``, ``POST``, ``PUT``, ``PATCH`` or ``DELETE``. Defaults to ``POST``."
            ]
          },
          "rune_required": {
            "type": "boolean",
            "description": [
              "Whether a rune is required to access this ``path``. Is only allowed to be ``false`` for ``GET`` requests. Defaults to true"
            ]
          },
          "rune_restrictions": {
            "type": "object",
            "description": [
              "Optional rune validation parameters to check before allowing access. These are passed to the checkrune RPC command. Omitting the rune_restrictions parameter means using your matched rpc method and the rpc params used. You can use this for example to not require the user to create a new rune for your rpc_method but rather require something like method=pay."
            ],
            "additionalProperties": false,
            "properties": {
              "nodeid": {
                "type": "string",
                "description": [
                  "Node id of requesting node *(required until v23.11)*."
                ]
              },
              "method": {
                "type": "string",
                "description": [
                  "Method for which rune needs to be validated *(required until v23.11)*. Omitting this means your rpc_method will be used."
                ]
              },
              "params": {
                "type": "object",
                "description": [
                  "Parameters for method. Omitting this means the rpc params from the request will be used."
                ]
              }
            }
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "examples": [
        {
          "request": {
            "id": "example:clnrest-register-path#1",
            "method": "clnrest-register-path",
            "params": {
              "path": "/custom/endpoint/{user}",
              "rpc_method": "custom-rpc-method",
              "http_method": "GET",
              "rune_required": false
            }
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:clnrest-register-path#2",
            "method": "clnrest-register-path",
            "params": {
              "path": "/v1/superpay",
              "rpc_method": "superpay",
              "http_method": "POST",
              "rune_required": true,
              "rune_restrictions": {
                "method": "pay"
              }
            }
          },
          "response": {}
        }
      ],
      "errors": [
        "The following errors may be reported:",
        "",
        "- 32700: Message either indicating conflicting paths or invalid/missing parameters."
      ],
      "author": [
        "daywalker90 is mainly responsible for this command."
      ],
      "see_also": [
        "lightning-createrune(7)",
        "lightning-checkrune(7)"
      ]
    },
    "close.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "close",
      "title": "Command for closing channels with direct peers",
      "description": [
        "The **close** RPC command attempts to close the channel cooperatively with the peer, or unilaterally after *unilateraltimeout*, and the to-local output will be sent to the address specified in *destination*.",
        "",
        "The peer needs to be live and connected in order to negotiate a mutual close. The default of unilaterally closing after 48 hours is usually a reasonable indication that you can no longer contact the peer."
      ],
      "request": {
        "required": [
          "id"
        ],
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string",
            "description": [
              "Peer id, channel id or short_channel_id. If the given *id* is a peer ID (66 hex digits as a string), then it applies to the active channel of the direct peer corresponding to the given peer ID. If the given *id* is a channel ID (64 hex digits as a string, or the short channel ID *blockheight:txindex:outindex* form), then it applies to that channel."
            ]
          },
          "unilateraltimeout": {
            "type": "u32",
            "description": [
              "If it is not zero, the command will unilaterally close the channel when that number of seconds is reached. If *unilateraltimeout* is zero, then the command will wait indefinitely until the peer is online and can negotiate a mutual close."
            ],
            "default": "2 days (172800 seconds)"
          },
          "destination": {
            "type": "string",
            "description": [
              "Any Bitcoin bech32 type. If the peer hasn't offered the option_shutdown_anysegwit feature, then taproot addresses (or other v1+ segwit) are not allowed. Tell your friends to upgrade!"
            ],
            "default": "a Core Lightning wallet address"
          },
          "fee_negotiation_step": {
            "type": "string",
            "description": [
              "It controls how closing fee negotiation is performed assuming the peer proposes a fee that is different than our estimate. (Note that modern peers use the quick-close protocol which does not allow negotiation: see *feerange* instead).",
              "",
              "On every negotiation step we must give up some amount from our proposal towards the peer's proposal. This parameter can be an integer in which case it is interpreted as number of satoshis to step at a time. Or it can be an integer followed by `%` to designate a percentage of the interval to give up. A few examples, assuming the peer proposes a closing fee of 3000 satoshi and our estimate shows it must be 4000:",
              "    * `10`: our next proposal will be 4000-10=3990.",
              "    * `10%`: our next proposal will be 4000-(10% of (4000-3000))=3900.",
              "    * '1': our next proposal will be 3999. This is the most extreme case when we insist on our fee as much as possible.",
              "    * `100%`: our next proposal will be 3000. This is the most relaxed case when we quickly accept the peer's proposal."
            ],
            "default": "`50%`"
          },
          "wrong_funding": {
            "type": "outpoint",
            "description": [
              "It can only be specified if both sides have offered the `shutdown_wrong_funding` feature (enabled by the **experimental-shutdown-wrong-funding** option). It must be a transaction id followed by a colon then the output number. Instead of negotiating a shutdown to spend the expected funding transaction, the shutdown transaction will spend this output instead. This is only allowed if this peer opened the channel and the channel is unused: it can rescue openings which have been manually miscreated."
            ]
          },
          "force_lease_closed": {
            "type": "boolean",
            "description": [
              "If the channel has funds leased to the peer (option_will_fund), we prevent initiation of a mutual close unless this flag is passed in."
            ],
            "default": "False"
          },
          "feerange": {
            "type": "array",
            "items": {
              "type": "feerate"
            },
            "description": [
              "An optional array [ *min*, *max* ], indicating the minimum and maximum feerates to offer: the peer will obey these if it supports the quick-close protocol. *slow* and *unilateral_close* are the defaults. Note that the maximum fee will be capped at the final commitment transaction fee (unless the experimental anchor-outputs option is negotiated)."
            ]
          }
        }
      },
      "response": {
        "required": [
          "type"
        ],
        "additionalProperties": true,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "mutual",
              "unilateral",
              "unopened"
            ],
            "description": [
              "Whether we successfully negotiated a mutual close, closed without them, or discarded not-yet-opened channel."
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "mutual",
                    "unilateral"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "txs",
                "txids"
              ],
              "properties": {
                "type": {},
                "txs": {
                  "added": "v24.11",
                  "type": "array",
                  "items": {
                    "type": "hex"
                  },
                  "description": [
                    "The raw bitcoin transactions used to close the channel (if it was open)."
                  ]
                },
                "txids": {
                  "added": "v24.11",
                  "type": "array",
                  "items": {
                    "type": "txid"
                  },
                  "description": [
                    "The transaction ids of the *tx* field(s)."
                  ]
                }
              }
            },
            "else": {
              "additionalProperties": false,
              "properties": {
                "type": {}
              }
            }
          }
        ],
        "post_return_value_notes": [
          "A unilateral close may still occur at any time if the peer did not behave correctly during the close negotiation.",
          "",
          "Unilateral closes will return your funds after a delay. The delay will vary based on the peer *to_self_delay* setting, not your own setting."
        ]
      },
      "notes": [
        "Prior to 0.7.2, **close** took two parameters: *force* and *timeout*. *timeout* was the number of seconds before *force* took effect (default, 30), and *force* determined whether the result was a unilateral close or an RPC error (default). Even after the timeout, the channel would be closed if the peer reconnected."
      ],
      "notifications": [
        "Notifications may be returned indicating what is going on, especially if the peer is offline and we are waiting."
      ],
      "author": [
        "ZmnSCPxj [ZmnSCPxj@protonmail.com](mailto:ZmnSCPxj@protonmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-disconnect(7)",
        "lightning-fundchannel(7)",
        "lightningd-config(5)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:close#1",
            "method": "close",
            "params": {
              "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "unilateraltimeout": 1
            }
          },
          "response": {
            "tx": "02000000000101cls00101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
            "txid": "txid010101010101010101010101010101010101010101010101010101010101",
            "txs": [
              "02000000000101cls00101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
            ],
            "txids": [
              "txid010101010101010101010101010101010101010101010101010101010101"
            ],
            "type": "mutual"
          }
        },
        {
          "request": {
            "id": "example:close#2",
            "method": "close",
            "params": {
              "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
              "destination": "bcrt1p0004040404040404040404040404040404040404040404040404040404"
            }
          },
          "response": {
            "tx": "02000000000101cls10202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202",
            "txid": "txid020202020202020202020202020202020202020202020202020202020202",
            "txs": [
              "02000000000101cls10202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202"
            ],
            "txids": [
              "txid020202020202020202020202020202020202020202020202020202020202"
            ],
            "type": "mutual"
          }
        }
      ]
    },
    "commando.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "commando",
      "title": "Command to Send a Command to a Remote Peer",
      "description": [
        "The **commando** RPC command is a homage to bad 80s movies. It also sends a directly-connected *peer_id* a custom message, containing a request to run *method* (with an optional dictionary of *params*); generally the peer will only allow you to run a command if it has provided you with a *rune* which allows it."
      ],
      "request": {
        "required": [
          "peer_id",
          "method"
        ],
        "additionalProperties": false,
        "properties": {
          "peer_id": {
            "type": "pubkey",
            "description": [
              "Peer to command."
            ]
          },
          "method": {
            "type": "string",
            "description": [
              "Method to invoke on peer."
            ]
          },
          "params": {
            "oneOf": [
              {
                "type": "array",
                "description": [
                  "Array of positional parameters."
                ]
              },
              {
                "type": "object",
                "description": [
                  "Parameters for method."
                ]
              }
            ]
          },
          "rune": {
            "type": "string",
            "description": [
              "Rune to authorize the command."
            ]
          },
          "filter": {
            "type": "object",
            "description": [
              "Filter to peer to apply to any successful result."
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": true,
        "properties": {},
        "pre_return_value_notes": [
          "On success, the return depends on the *method* invoked."
        ]
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32600: Usually means peer is not connected",
        "- 19535: the local commando plugin discovered an error.",
        "- 19536: the remote commando plugin discovered an error.",
        "- 19537: the remote commando plugin said we weren't authorized.",
        "",
        "It can also fail if the peer does not respond, in which case it will simply hang awaiting a response."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.",
        "",
        "Christian Decker came up with the name \"commando\", which almost excuses his previous adoption of the name \"Eltoo\"."
      ],
      "see_also": [
        "lightning-commando-rune(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:commando#1",
            "method": "commando",
            "params": {
              "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
              "rune": "zFMd1fjhrAYxUeFA54TjloZqOt8JrA_i_nYwIgXkag49MA==",
              "method": "newaddr",
              "params": {
                "addresstype": "p2tr"
              }
            }
          },
          "response": {
            "p2tr": "bcrt1p338x07070707070707070707070707070707070707070707070707070707"
          }
        },
        {
          "request": {
            "id": "example:commando#2",
            "method": "commando",
            "params": {
              "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
              "rune": "RXgu0DD_i0wSPEZkIDyZIWL0bSAGdhvJ_GHOQdTg04A9MSZpZF4wMjY2ZTQ1OThkMWQzYzQxNWY1NyZtZXRob2Q9bGlzdHBlZXJz",
              "method": "listpeers",
              "params": [
                "nodeid030303030303030303030303030303030303030303030303030303030303"
              ]
            }
          },
          "response": {
            "peers": [
              {
                "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "connected": true,
                "num_channels": 2,
                "netaddr": [
                  "127.0.0.1:19736"
                ],
                "features": "0898882a8a59a1"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:commando#3",
            "method": "commando",
            "params": {
              "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
              "rune": "QUJEYMLGgiaJvMDv_MhR2hiMKIBTbq-PrL-KxcIlirQ9MiZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==",
              "method": "pay",
              "params": {
                "bolt11": "lnbcrt100n1pnt2bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000bolt11invl020300000000",
                "amount_msat": 9900
              }
            }
          },
          "response": {
            "destination": "nodeid020202020202020202020202020202020202020202020202020202020202",
            "payment_hash": "paymenthashcmdpycp10cp10cp10cp10cp10cp10cp10cp10cp10cp10cp10cp10",
            "created_at": 1738000000,
            "parts": 1,
            "amount_msat": 9900,
            "amount_sent_msat": 9900,
            "payment_preimage": "paymentpreimagec010101010101010101010101010101010101010101010101",
            "status": "complete"
          }
        }
      ]
    },
    "connect.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "connect",
      "title": "Command for connecting to another lightning node",
      "description": [
        "The **connect** RPC command establishes a new connection with another node in the Lightning Network.",
        "",
        "Connecting to a node is just the first step in opening a channel with another node. Once the peer is connected a channel can be opened with lightning-fundchannel(7).",
        "",
        "If there are active channels with the peer, **connect** returns once all the subdaemons are in place to handle the channels, not just once it's connected."
      ],
      "request": {
        "required": [
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": [
              "The target node's public key. As a convenience, *id* may be of the form *id@host* or *id@host:port*. In this case, the *host* and *port* parameters must be omitted. This can fail if your C-lightning node is a fresh install that has not connected to any peers yet (your node has no gossip yet), or if the target *id* is a fresh install that has no channels yet (nobody will gossip about a node until it has one published channel)."
            ]
          },
          "host": {
            "type": "string",
            "description": [
              "The peer's hostname or IP address. If *host* is not specified (or doesn't work), the connection will be attempted to an IP belonging to *id* obtained through gossip with other already connected peers. If *host* begins with a `/` it is interpreted as a local path and the connection will be made to that local socket (see **bind-addr** in lightningd-config(5))."
            ]
          },
          "port": {
            "type": "u16",
            "description": [
              "The peer's port number. If not specified, the *port* depends on the current network:",
              "    * bitcoin **mainnet**: 9735.",
              "    * bitcoin **testnet**: 19735.",
              "    * bitcoin **signet**: 39735.",
              "    * bitcoin **regtest**: 19846."
            ]
          }
        }
      },
      "response": {
        "required": [
          "id",
          "features",
          "direction",
          "address"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "The peer we connected to."
            ]
          },
          "features": {
            "type": "hex",
            "description": [
              "BOLT 9 features bitmap offered by peer."
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "in",
              "out"
            ],
            "description": [
              "Whether they initiated connection or we did."
            ]
          },
          "address": {
            "type": "object",
            "description": [
              "Address information (mainly useful if **direction** is *out*)."
            ],
            "additionalProperties": true,
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "local socket",
                  "ipv4",
                  "ipv6",
                  "torv2",
                  "torv3"
                ],
                "description": [
                  "Type of connection (*torv2*/*torv3* only if **direction** is *out*)."
                ]
              }
            },
            "allOf": [
              {
                "if": {
                  "additionalProperties": true,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "local socket"
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "socket"
                  ],
                  "properties": {
                    "type": {},
                    "socket": {
                      "type": "string",
                      "description": [
                        "Socket filename."
                      ]
                    }
                  }
                }
              },
              {
                "if": {
                  "additionalProperties": true,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "ipv4",
                        "ipv6",
                        "torv2",
                        "torv3"
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "address",
                    "port"
                  ],
                  "properties": {
                    "type": {},
                    "address": {
                      "type": "string",
                      "description": [
                        "Address in expected format for **type**."
                      ]
                    },
                    "port": {
                      "type": "u16",
                      "description": [
                        "Port number."
                      ]
                    }
                  }
                }
              }
            ]
          }
        }
      },
      "errors": [
        "On failure, one of the following errors will be returned:",
        "",
        "- 400: Unable to connect, no address known for peer",
        "- 401: If some addresses are known but connecting to all of them failed, the message will contain details about the failures",
        "- 402: If the peer disconnected while we were connecting",
        "- -32602: If the given parameters are wrong"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible. Felix [fixone@gmail.com](mailto:fixone@gmail.com) is the original author of this manpage."
      ],
      "see_also": [
        "lightning-fundchannel(7)",
        "lightning-listpeers(7)",
        "lightning-listchannels(7)",
        "lightning-disconnect(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:connect#1",
            "method": "connect",
            "params": {
              "id": "nodeid020202020202020202020202020202020202020202020202020202020202",
              "host": "localhost",
              "port": 19735
            }
          },
          "response": {
            "id": "nodeid020202020202020202020202020202020202020202020202020202020202",
            "features": "0898882a8a59a1",
            "direction": "out",
            "address": {
              "type": "ipv4",
              "address": "127.0.0.1",
              "port": 19735
            }
          }
        },
        {
          "request": {
            "id": "example:connect#2",
            "method": "connect",
            "params": {
              "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "host": "localhost",
              "port": 19736
            }
          },
          "response": {
            "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
            "features": "0898882a8a59a1",
            "direction": "out",
            "address": {
              "type": "ipv4",
              "address": "127.0.0.1",
              "port": 19736
            }
          }
        }
      ]
    },
    "createinvoice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "createinvoice",
      "title": "Low-level invoice creation",
      "description": [
        "The **createinvoice** RPC command signs and saves an invoice into the database."
      ],
      "request": {
        "required": [
          "invstring",
          "label",
          "preimage"
        ],
        "additionalProperties": false,
        "properties": {
          "invstring": {
            "type": "string",
            "description": [
              "The bolt11/bolt12 invoice, but the final signature is ignored. Minimal sanity checks are done."
            ]
          },
          "label": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ],
            "description": [
              "A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice."
            ]
          },
          "preimage": {
            "type": "hex",
            "description": [
              "The preimage to supply upon successful payment of the invoice."
            ]
          }
        }
      },
      "response": {
        "required": [
          "label",
          "created_index",
          "payment_hash",
          "status",
          "description",
          "expires_at"
        ],
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "description": [
              "The label for the invoice."
            ]
          },
          "bolt11": {
            "type": "string",
            "description": [
              "The bolt11 string (always present unless **bolt12** is)."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The bolt12 string instead of **bolt11**"
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount of the invoice (if it has one)."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "paid",
              "expired",
              "unpaid"
            ],
            "description": [
              "Whether it has been paid, or can no longer be paid."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "Description extracted from **bolt11** or **bolt12**."
            ]
          },
          "expires_at": {
            "type": "u64",
            "description": [
              "UNIX timestamp of when invoice expires (or expired)."
            ]
          },
          "created_index": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "1-based index indicating order this invoice was created in."
            ]
          },
          "pay_index": {
            "type": "u64",
            "description": [
              "Incrementing id for when this was paid (**status** *paid* only)."
            ]
          },
          "amount_received_msat": {
            "type": "msat",
            "description": [
              "Amount actually received (**status** *paid* only)."
            ]
          },
          "paid_at": {
            "type": "u64",
            "description": [
              "UNIX timestamp of when invoice was paid (**status** *paid* only)."
            ]
          },
          "paid_outpoint": {
            "type": "object",
            "description": [
              "Outpoint this invoice was paid with (**status** *paid* only)."
            ],
            "added": "v23.11",
            "additionalProperties": false,
            "required": [
              "txid",
              "outnum"
            ],
            "properties": {
              "txid": {
                "added": "v23.11",
                "type": "txid",
                "description": [
                  "ID of the transaction that paid the invoice (**status** *paid* only)."
                ]
              },
              "outnum": {
                "added": "v23.11",
                "type": "u32",
                "description": [
                  "The 0-based output number of the transaction that paid the invoice (**status** *paid* only)."
                ]
              }
            }
          },
          "payment_preimage": {
            "type": "secret",
            "description": [
              "The proof of payment: SHA256 of this **payment_hash**."
            ]
          },
          "local_offer_id": {
            "type": "hex",
            "description": [
              "The *id* of our offer which created this invoice."
            ],
            "maxLength": 64,
            "minLength": 64
          },
          "invreq_payer_note": {
            "type": "string",
            "description": [
              "The optional *invreq_payer_note* from invoice_request which created this invoice."
            ]
          }
        },
        "pre_return_value_notes": [
          "(Note: the return format is the same as lightning-listinvoices(7))."
        ]
      },
      "errors": [
        "On failure, an error is returned and no invoice is created. If the lightning process fails before responding, the caller should use lightning-listinvoices(7) to query whether this invoice was created or not.",
        "",
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error.",
        "- 900: An invoice with the given *label* already exists."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-invoice(7)",
        "lightning-listinvoices(7)",
        "lightning-delinvoice(7)",
        "lightning-getroute(7)",
        "lightning-sendpay(7)",
        "lightning-offer(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:createinvoice#1",
            "method": "createinvoice",
            "params": {
              "invstring": "lnbcrt100n1pnt2bolt11invl010300000000bolt11invl010300000000bolt11invl010300000000bolt11invl010300000000bolt11invl010300000000bolt11invl010300000000bolt11invl010300000000bolt11invl010300000000bolt11invl010300000000bolt11invl010300000000",
              "label": "lbl_l13",
              "preimage": "0101010101010101010101010101010101010101010101010101010101010101"
            }
          },
          "response": {
            "label": "lbl_l13",
            "bolt11": "lnbcrt100n1pnt2bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000",
            "payment_hash": "paymenthashinvl0210021002100210021002100210021002100210021002100",
            "amount_msat": 100000,
            "status": "unpaid",
            "description": "l13 description",
            "expires_at": 1739000000,
            "created_index": 7
          }
        }
      ]
    },
    "createonion.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "createonion",
      "title": "Low-level command to create a custom onion",
      "description": [
        "The **createonion** RPC command allows the caller to create a custom onion with custom payloads at each hop in the route. A custom onion can be used to implement protocol extensions that are not supported by Core Lightning directly."
      ],
      "request": {
        "required": [
          "hops",
          "assocdata"
        ],
        "additionalProperties": false,
        "properties": {
          "hops": {
            "type": "array",
            "description": [
              "A JSON list of dicts, each specifying a node and the payload destined for that node."
            ],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "pubkey",
                "payload"
              ],
              "properties": {
                "pubkey": {
                  "type": "pubkey",
                  "description": [
                    "Node pubkey."
                  ]
                },
                "payload": {
                  "type": "hex",
                  "description": [
                    "Payload to be sent to the node."
                  ]
                }
              }
            }
          },
          "assocdata": {
            "type": "hex",
            "description": [
              "The associated data that the onion should commit to. If the onion is to be used to send a payment later it MUST match the `payment_hash` of the payment in order to be valid."
            ]
          },
          "session_key": {
            "type": "secret",
            "description": [
              "Can be used to specify a secret that is used to generate the shared secrets used to encrypt the onion for each hop. It should only be used for testing or if a specific shared secret is important. If not specified it will be securely generated internally, and the shared secrets will be returned."
            ]
          },
          "onion_size": {
            "type": "u16",
            "description": [
              "A size different from the default payment onion (1300 bytes). May be used for custom protocols like trampoline routing."
            ]
          }
        }
      },
      "response": {
        "required": [
          "onion",
          "shared_secrets"
        ],
        "additionalProperties": false,
        "properties": {
          "onion": {
            "type": "hex",
            "description": [
              "The onion packet (*onion_size* bytes)."
            ]
          },
          "shared_secrets": {
            "type": "array",
            "description": [
              "One shared secret for each node in the *hops* parameter."
            ],
            "items": {
              "type": "secret",
              "description": [
                "The shared secret with this hop."
              ]
            }
          }
        }
      },
      "author": [
        "Christian Decker [decker.christian@gmail.com](mailto:decker.christian@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-sendonion(7)",
        "lightning-getroute(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)",
        "",
        "[BOLT 04](https://github.com/lightning/bolts/blob/master/04-onion-routing.md)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:createonion#1",
            "method": "createonion",
            "params": {
              "hops": [
                {
                  "pubkey": "nodeid020202020202020202020202020202020202020202020202020202020202",
                  "payload": "payload010101010101010101010101010"
                },
                {
                  "pubkey": "nodeid030303030303030303030303030303030303030303030303030303030303",
                  "payload": "payload020202020202020202020202020"
                },
                {
                  "pubkey": "nodeid040404040404040404040404040404040404040404040404040404040404",
                  "payload": "payload030303030303030303030303030"
                }
              ],
              "assocdata": "assocdata0010101010101010101010101010101010101010101010101010101"
            }
          },
          "response": {
            "onion": "onion10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010",
            "shared_secrets": [
              "sharedsecret1010101010101010101010101010101010101010101010101010",
              "sharedsecret1111111111111111111111111111111111111111111111111111",
              "sharedsecret1212121212121212121212121212121212121212121212121212"
            ]
          }
        },
        {
          "request": {
            "id": "example:createonion#2",
            "method": "createonion",
            "params": {
              "hops": [
                {
                  "pubkey": "nodeid020202020202020202020202020202020202020202020202020202020202",
                  "payload": "payload010101010101010101010101010"
                },
                {
                  "pubkey": "nodeid030303030303030303030303030303030303030303030303030303030303",
                  "payload": "payload020202020202020202020202020"
                },
                {
                  "pubkey": "nodeid040404040404040404040404040404040404040404040404040404040404",
                  "payload": "payload030303030303030303030303030"
                }
              ],
              "assocdata": "assocdata0010101010101010101010101010101010101010101010101010101",
              "session_key": "4141414141414141414141414141414141414141414141414141414141414141"
            }
          },
          "response": {
            "onion": "onion20202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020",
            "shared_secrets": [
              "sharedsecret2020202020202020202020202020202020202020202020202020",
              "sharedsecret2121212121212121212121212121212121212121212121212121",
              "sharedsecret2222222222222222222222222222222222222222222222222222"
            ]
          }
        }
      ]
    },
    "createrune.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.08",
      "rpc": "createrune",
      "title": "Command to Create/Update Rune for Authorizing Remote Peer Access",
      "description": [
        "The **createrune** RPC command creates a base64 string called a *rune* which can be used to access commands on this node. Each *rune* contains a unique id (a number starting at 0), and can have restrictions inside it. Nobody can remove restrictions from a rune: if you try, the rune will be rejected. There is no limit on how many runes you can issue; the node simply decodes and checks them as they are received.",
        "",
        "Oh, I almost forgot. Runes can also be invoked like in ancient times with the **invokerune** command. Feel the magical powers of a rune by invoking it."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "rune": {
            "type": "string",
            "description": [
              "If supplied, the restrictions are simple appended to that *rune* (it doesn't need to be a rune belonging to this node). If not supplied, a new *rune* is constructed, with a new unique id."
            ]
          },
          "restrictions": {
            "description": [
              "It can be the string `readonly`, or an array of restrictions.",
              "Each restriction is an array of one or more alternatives, such as \"method is listpeers\", or \"method is listpeers OR time is before 2023\"."
            ],
            "oneOf": [
              {
                "type": "array",
                "description": [
                  "Alternatives use a simple language to examine the command which is being run:",
                  "    * time: the current UNIX time, e.g. `time<1656759180`.",
                  "    * id: the node_id of the peer, e.g. `id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605`.",
                  "    * method: the command being run, e.g. `method=withdraw`.",
                  "    * per: how often the rune can be used, with suffix \"sec\" (default), \"min\", \"hour\", \"day\" or \"msec\", \"usec\" or \"nsec\". e.g. `per=5sec`.",
                  "    * rate: the rate limit, per minute, e.g. `rate=60` is equivalent to `per=1sec`.",
                  "    * pnum: the number of parameters. e.g. `pnum<2`.",
                  "    * pnameX: the parameter named X e.g. `pnamedestination=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T`.  NOTE: until v24.05, X had to remove underscores from the parameter name (e.g. `pnameamount_msat` had to be specified as `pnameamountmsat`) but that is now fixed.",
                  "    * parrN: the N'th parameter. e.g. `parr0=1RustyRX2oai4EYYDpQGWvEL62BBGqN9T`.",
                  "    * pinvX_N: parse the parameter X as an invoice (bolt11 or bolt12) and extract field N for comparison.  Fails if parameter X is not present, does not parse, or N is not one of the following field names:",
                  "      * amount",
                  "      * description",
                  "      * node"
                ],
                "items": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "string",
                "enum": [
                  "readonly"
                ],
                "description": [
                  "A rune which allows most *get* and *list* commands, and the *summary* command."
                ]
              }
            ]
          }
        }
      },
      "response": {
        "required": [
          "rune",
          "unique_id"
        ],
        "additionalProperties": false,
        "properties": {
          "rune": {
            "type": "string",
            "description": [
              "The resulting rune."
            ]
          },
          "unique_id": {
            "type": "string",
            "description": [
              "The id of this rune: this is set at creation and cannot be changed (even as restrictions are added)."
            ]
          },
          "warning_unrestricted_rune": {
            "type": "string",
            "description": [
              "A warning shown when runes are created with powers that could drain your node."
            ]
          }
        }
      },
      "restriction_format": [
        "Restrictions are one or more alternatives. Each alternative is *name* *operator* *value*. The valid names are shown above.",
        "",
        "Note that if a value contains `\\`, it must be preceeded by another `\\` to form valid JSON:",
        "* `=`: passes if equal ie. identical. e.g. `method=withdraw`",
        "* `/`: not equals, e.g. `method/withdraw`",
        "* `^`: starts with, e.g. `id^024b9a1fa8e006f1e3937f`",
        "* `$`: ends with, e.g. `id$381df1cc449605`.",
        "* `~`: contains, e.g. `id~006f1e3937f65f66c40`.",
        "* `<`: is a decimal integer, and is less than. e.g. `time<1656759180`",
        "* `>`: is a decimal integer, and is greater than. e.g. `time>1656759180`",
        "* `{`: preceeds in alphabetical order (or matches but is shorter),",
        "       e.g. `id{02ff`.",
        "* `}`: follows in alphabetical order (or matches but is longer),",
        "       e.g. `id}02ff`.",
        "* `#`: a comment, ignored, e.g. `dumb example#`.",
        "* `!`: only passes if the *name* does *not* exist. e.g. `pnamedestination!`.",
        "Every other operator except `#` fails if *name* does not exist!"
      ],
      "sharing_runes": [
        "Because anyone can add a restriction to a rune, you can always turn a normal rune into a read-only rune, or restrict access for 30 minutes from the time you give it to someone. Adding restrictions before sharing runes is best practice.",
        "",
        "If a rune has a ratelimit, any derived rune will have the same id, and thus will compete for that ratelimit. You might want to consider adding a tighter ratelimit to a rune before sharing it, so you will keep the remainder. For example, if your rune has a limit of 60 times per minute, adding a limit of 5 times per minute and handing that rune out means you can still use your original rune 55 times per minute."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) wrote the original Python commando.py plugin, the in-tree commando plugin, and this manual page.",
        "",
        "Shahana Farooqui [sfarooqui@blockstream.com](mailto:sfarooqui@blockstream.com) is mainly responsible for migrating commando-rune to createrune."
      ],
      "see_also": [
        "lightning-commando-rune(7)",
        "lightning-checkrune(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "usage": [
        "- You can use lightning-decode(7) to examine runes you have been given:",
        "",
        "```shell",
        "lightning-cli decode tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y",
        "{",
        "   \"type\": \"rune\",",
        "   \"unique_id\": \"3\",",
        "   \"string\": \"b54f912e33220e9636534a375b5a05a306abdfa4451a95a5a0f6d6f7e46e65da:=3&id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605&method=listpeers&pnum=1&pnameid^024b9a1fa8e006f1e393|parr0^024b9a1fa8e006f1e393&time<1656920538&rate=2\",",
        "   \"restrictions\": [",
        "      {",
        "         \"alternatives\": [",
        "            \"id=024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605\"",
        "         ],",
        "         \"summary\": \"id (of commanding peer) equal to '024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605'\"",
        "      },",
        "      {",
        "         \"alternatives\": [",
        "            \"method=listpeers\"",
        "         ],",
        "         \"summary\": \"method (of command) equal to 'listpeers'\"",
        "      },",
        "      {",
        "         \"alternatives\": [",
        "            \"pnum=1\"",
        "         ],",
        "         \"summary\": \"pnum (number of command parameters) equal to 1\"",
        "      },",
        "      {",
        "         \"alternatives\": [",
        "            \"pnameid^024b9a1fa8e006f1e393\",",
        "            \"parr0^024b9a1fa8e006f1e393\"",
        "         ],",
        "         \"summary\": \"pnameid (object parameter 'id') starts with '024b9a1fa8e006f1e393' OR parr0 (array parameter #0) starts with '024b9a1fa8e006f1e393'\"",
        "      },",
        "      {",
        "         \"alternatives\": [",
        "            \"time<1656920538\"",
        "         ],",
        "         \"summary\": \"time (in seconds since 1970) less than 1656920538 (approximately 19 hours 18 minutes from now)\"",
        "      },",
        "      {",
        "         \"alternatives\": [",
        "            \"rate=2\"",
        "         ],",
        "         \"summary\": \"rate (max per minute) equal to 2\"",
        "      }",
        "   ],",
        "   \"valid\": true",
        "}",
        "```",
        "",
        "- You can use lightning-checkrune(7) to verify whether a rune is valid for a specific method and its parameters:",
        "",
        "```shell",
        "lightning-cli checkrune -k 'rune'=tU-RLjMiDpY2U0o3W1oFowar36RFGpWloPbW9-RuZdo9MyZpZD0wMjRiOWExZmE4ZTAwNmYxZTM5MzdmNjVmNjZjNDA4ZTZkYThlMWNhNzI4ZWE0MzIyMmE3MzgxZGYxY2M0NDk2MDUmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjRiOWExZmE4ZTAwNmYxZTM5M3xwYXJyMF4wMjRiOWExZmE4ZTAwNmYxZTM5MyZ0aW1lPDE2NTY5MjA1MzgmcmF0ZT0y 'method'='invoice' 'params'='{\"amount_msat\": 100000001, \"label\": \"invoicelabel\"', \"description\": \"Checking rune validity\"}'",
        "```"
      ],
      "examples": [
        {
          "description": [
            "This creates a fresh rune which can do anything:"
          ],
          "request": {
            "id": "example:createrune#1",
            "method": "createrune",
            "params": {}
          },
          "response": {
            "rune": "zFMd1fjhrAYxUeFA54TjloZqOt8JrA_i_nYwIgXkag49MA==",
            "unique_id": "0",
            "warning_unrestricted_rune": "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods."
          }
        },
        {
          "description": [
            "We can add restrictions to that rune, like so:",
            "",
            "The `readonly` restriction is a short-cut for two restrictions:",
            "",
            "1: `['method^list', 'method^get', 'method=summary']`: You may call list, get or summary.",
            "",
            "2: `['method/listdatastore']`: But not listdatastore: that contains sensitive stuff!"
          ],
          "request": {
            "id": "example:createrune#2",
            "method": "createrune",
            "params": {
              "rune": "zFMd1fjhrAYxUeFA54TjloZqOt8JrA_i_nYwIgXkag49MA==",
              "restrictions": "readonly"
            }
          },
          "response": {
            "rune": "_RWaZZRI7wAYU2hqlFBmYgC_dFczcpAdI_9O87YbDpg9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl",
            "unique_id": "0"
          }
        },
        {
          "description": [
            "We can do the same manually (readonly), like so:"
          ],
          "request": {
            "id": "example:createrune#3",
            "method": "createrune",
            "params": {
              "rune": "zFMd1fjhrAYxUeFA54TjloZqOt8JrA_i_nYwIgXkag49MA==",
              "restrictions": [
                [
                  "method^list",
                  "method^get",
                  "method=summary"
                ],
                [
                  "method/listdatastore"
                ]
              ]
            }
          },
          "response": {
            "rune": "_RWaZZRI7wAYU2hqlFBmYgC_dFczcpAdI_9O87YbDpg9MCZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl",
            "unique_id": "0"
          }
        },
        {
          "description": [
            "This will allow the rune to be used for id starting with 0266e4598d1d3c415f57, and for the method listpeers:"
          ],
          "request": {
            "id": "example:createrune#4",
            "method": "createrune",
            "params": {
              "restrictions": [
                [
                  "id^0266e4598d1d3c415f57"
                ],
                [
                  "method=listpeers"
                ]
              ]
            }
          },
          "response": {
            "rune": "RXgu0DD_i0wSPEZkIDyZIWL0bSAGdhvJ_GHOQdTg04A9MSZpZF4wMjY2ZTQ1OThkMWQzYzQxNWY1NyZtZXRob2Q9bGlzdHBlZXJz",
            "unique_id": "1"
          }
        },
        {
          "description": [
            "This will allow the rune to be used for the method pay, and for the parameter amount\\_msat to be less than 10000:"
          ],
          "request": {
            "id": "example:createrune#5",
            "method": "createrune",
            "params": {
              "restrictions": [
                [
                  "method=pay"
                ],
                [
                  "pnameamountmsat<10000"
                ]
              ]
            }
          },
          "response": {
            "rune": "QUJEYMLGgiaJvMDv_MhR2hiMKIBTbq-PrL-KxcIlirQ9MiZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==",
            "unique_id": "2"
          }
        },
        {
          "description": [
            "Let's create a rune which lets a specific peer run listpeers on themselves:"
          ],
          "request": {
            "id": "example:createrune#6",
            "method": "createrune",
            "params": {
              "restrictions": [
                [
                  "id=0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
                ],
                [
                  "method=listpeers"
                ],
                [
                  "pnum=1"
                ],
                [
                  "pnameid=0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
                  "parr0=0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
                ]
              ]
            }
          },
          "response": {
            "rune": "jEx3l0c7NMZPSDYT7xnXXvNA83z5PDNBHRQTIk1BwNw9MyZpZD0wMjY2ZTQ1OThkMWQzYzQxNWY1NzJhODQ4ODgzMGI2MGY3ZTc0NGVkOTIzNWViMGIxYmE5MzI4M2IzMTVjMDM1MTgmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjY2ZTQ1OThkMWQzYzQxNWY1NzJhODQ4ODgzMGI2MGY3ZTc0NGVkOTIzNWViMGIxYmE5MzI4M2IzMTVjMDM1MTh8cGFycjA9MDI2NmU0NTk4ZDFkM2M0MTVmNTcyYTg0ODg4MzBiNjBmN2U3NDRlZDkyMzVlYjBiMWJhOTMyODNiMzE1YzAzNTE4",
            "unique_id": "3"
          }
        },
        {
          "description": [
            "This allows `listpeers` with 1 argument (`pnum=1`), which is either by name (`pnameid`), or position (`parr0`). We could shorten this in several ways: either allowing only positional or named parameters, or by testing the start of the parameters only. Here's an example which only checks the first 10 bytes of the `listpeers` parameter:"
          ],
          "request": {
            "id": "example:createrune#7",
            "method": "createrune",
            "params": {
              "restrictions": [
                [
                  "id=0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
                ],
                [
                  "method=listpeers"
                ],
                [
                  "pnum=1"
                ],
                [
                  "pnameid^0266e4598d1d3c415f57",
                  "parr0^0266e4598d1d3c415f57"
                ]
              ]
            }
          },
          "response": {
            "rune": "8_CRIJ4arWAz72A4ILOZ46MESSJtQQQ9iQZjU28qulA9NCZpZD0wMjY2ZTQ1OThkMWQzYzQxNWY1NzJhODQ4ODgzMGI2MGY3ZTc0NGVkOTIzNWViMGIxYmE5MzI4M2IzMTVjMDM1MTgmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjY2ZTQ1OThkMWQzYzQxNWY1N3xwYXJyMF4wMjY2ZTQ1OThkMWQzYzQxNWY1Nw==",
            "unique_id": "4"
          }
        },
        {
          "description": [
            "Before we give this to our peer, let's add two more restrictions: that it only be usable for 24 hours from now (`time<`), and that it can only be used twice a minute (`rate=2`). `date +%s` can give us the current time in seconds:"
          ],
          "request": {
            "id": "example:createrune#8",
            "method": "createrune",
            "params": [
              "8_CRIJ4arWAz72A4ILOZ46MESSJtQQQ9iQZjU28qulA9NCZpZD0wMjY2ZTQ1OThkMWQzYzQxNWY1NzJhODQ4ODgzMGI2MGY3ZTc0NGVkOTIzNWViMGIxYmE5MzI4M2IzMTVjMDM1MTgmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjY2ZTQ1OThkMWQzYzQxNWY1N3xwYXJyMF4wMjY2ZTQ1OThkMWQzYzQxNWY1Nw==",
              [
                [
                  "time<\"$(($(date +%s) + 24*60*60))\"",
                  "rate=2"
                ]
              ]
            ]
          },
          "response": {
            "rune": "GJb2PC-4jYslzIVz6-425bOtpkz_A_zaEhekPlrXdj09NCZpZD0wMjY2ZTQ1OThkMWQzYzQxNWY1NzJhODQ4ODgzMGI2MGY3ZTc0NGVkOTIzNWViMGIxYmE5MzI4M2IzMTVjMDM1MTgmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjY2ZTQ1OThkMWQzYzQxNWY1N3xwYXJyMF4wMjY2ZTQ1OThkMWQzYzQxNWY1NyZ0aW1lPCIkKCgkKGRhdGUgKyVzKSArIDI0KjYwKjYwKSkifHJhdGU9Mg==",
            "unique_id": "4"
          }
        },
        {
          "description": [
            "Now, let us create a rune with `read-only` restrictions, extended to only allow sending payments of `less than 100,000 sats per day` using either the `pay` or `xpay` method. Ideally, the condition would look something like:",
            "",
            "`[[\"method^list or method^get or ((method=pay or method=xpay) and per=1day and pnameamount\\_msat<100000001)\"],[\"method/listdatastore\"]]`.",
            "",
            "However, since brackets and AND conditions within OR are currently not supported for rune creation, we can restructure the conditions as follows:",
            "",
            "- `method^list|method^get|method=summary|method=pay|method=xpay`",
            "- `method/listdatastore`",
            "- `method/pay|per=1day`",
            "- `method/pay|pnameamount_msat<100000001`",
            "- `method/xpay|per=1day`",
            "- `method/xpay|pnameamount_msat<100000001`"
          ],
          "request": {
            "id": "example:createrune#9",
            "method": "createrune",
            "params": {
              "restrictions": [
                [
                  "method^list",
                  "method^get",
                  "method=summary",
                  "method=pay",
                  "method=xpay"
                ],
                [
                  "method/listdatastore"
                ],
                [
                  "method/pay",
                  "per=1day"
                ],
                [
                  "method/pay",
                  "pnameamount_msat<100000001"
                ],
                [
                  "method/xpay",
                  "per=1day"
                ],
                [
                  "method/xpay",
                  "pnameamount_msat<100000001"
                ]
              ]
            }
          },
          "response": {
            "rune": "iP1FQEsFmPsu-XW7w8uXIJaJb7jU9PqOfkmXlOyWMuA9NSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5fG1ldGhvZD1wYXl8bWV0aG9kPXhwYXkmbWV0aG9kL2xpc3RkYXRhc3RvcmUmbWV0aG9kL3BheXxwZXI9MWRheSZtZXRob2QvcGF5fHBuYW1lYW1vdW50X21zYXQ8MTAwMDAwMDAxJm1ldGhvZC94cGF5fHBlcj0xZGF5Jm1ldGhvZC94cGF5fHBuYW1lYW1vdW50X21zYXQ8MTAwMDAwMDAx",
            "unique_id": "5"
          }
        }
      ]
    },
    "datastore.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "datastore",
      "title": "Command for storing (plugin) data",
      "description": [
        "The **datastore** RPC command allows plugins to store data in the Core Lightning database, for later retrieval."
      ],
      "request": {
        "required": [
          "key"
        ],
        "additionalProperties": false,
        "properties": {
          "key": {
            "description": [
              "A key can either have children or a value, never both: parents are created and removed automatically."
            ],
            "oneOf": [
              {
                "type": "array",
                "description": [
                  "An array of values to form a hierarchy (though a single value is treated as a one-element array). Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended."
                ],
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              }
            ]
          },
          "string": {
            "type": "string",
            "description": [
              "Data to be saved in string format."
            ]
          },
          "hex": {
            "type": "hex",
            "description": [
              "Data to be saved in hex format."
            ]
          },
          "mode": {
            "type": "string",
            "description": [
              "Write mode to determine how the record is updated:",
              "    * `must-create`: fails if it already exists.",
              "    * `must-replace`: fails if it doesn't already exist.",
              "    * `create-or-replace`: never fails.",
              "    * `must-append`: must already exist, append this to what's already there.",
              "    * `create-or-append`: append if anything is there, otherwise create."
            ],
            "enum": [
              "must-create",
              "must-replace",
              "create-or-replace",
              "must-append",
              "create-or-append"
            ],
            "default": "`must-create`"
          },
          "generation": {
            "type": "u64",
            "description": [
              "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with *mode* `must-replace` or `must-append`."
            ]
          }
        }
      },
      "response": {
        "required": [
          "key"
        ],
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "array",
            "items": {
              "type": "string",
              "description": [
                "Part of the key added to the datastore."
              ]
            }
          },
          "generation": {
            "type": "u64",
            "description": [
              "The number of times this has been updated."
            ]
          },
          "hex": {
            "type": "hex",
            "description": [
              "The hex data which has been added to the datastore."
            ]
          },
          "string": {
            "type": "string",
            "description": [
              "The data as a string, if it's valid utf-8."
            ]
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- 1202: The key already exists (and mode said it must not)",
        "- 1203: The key does not exist (and mode said it must)",
        "- 1204: The generation was wrong (and generation was specified)",
        "- 1205: The key has children already.",
        "- 1206: One of the parents already exists with a value.",
        "- -32602: invalid parameters"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listdatastore(7)",
        "lightning-deldatastore(7)",
        "lightning-datastoreusage(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:datastore#1",
            "method": "datastore",
            "params": {
              "key": [
                "employee",
                "index"
              ],
              "string": "saving employee keys to the store",
              "mode": "must-create"
            }
          },
          "response": {
            "key": [
              "employee",
              "index"
            ],
            "generation": 0,
            "hex": "736176696e6720656d706c6f796565206b65797320746f207468652073746f7265",
            "string": "saving employee keys to the store"
          }
        },
        {
          "request": {
            "id": "example:datastore#2",
            "method": "datastore",
            "params": {
              "key": "otherkey",
              "string": "other",
              "mode": "must-create"
            }
          },
          "response": {
            "key": [
              "otherkey"
            ],
            "generation": 0,
            "hex": "6f74686572",
            "string": "other"
          }
        },
        {
          "request": {
            "id": "example:datastore#3",
            "method": "datastore",
            "params": {
              "key": "otherkey",
              "string": " key: text to be appended to the otherkey",
              "mode": "must-append",
              "generation": 0
            }
          },
          "response": {
            "key": [
              "otherkey"
            ],
            "generation": 1,
            "hex": "6f74686572206b65793a207465787420746f20626520617070656e64656420746f20746865206f746865726b6579",
            "string": "other key: text to be appended to the otherkey"
          }
        }
      ]
    },
    "datastoreusage.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.11",
      "rpc": "datastoreusage",
      "title": "Command for listing datastore usage info",
      "description": [
        "The **datastoreusage** RPC command allows the caller to fetch the total bytes that are stored under a certain *key* (or from the root), including the size of the *key*.",
        "",
        "All descendants of the *key* (or root) are taken into account."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "key": {
            "oneOf": [
              {
                "type": "array",
                "description": [
                  "Key is an array of values (though a single value is treated as a one-element array). Used as the starting point to traverse the datastore."
                ],
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              }
            ]
          }
        }
      },
      "response": {
        "required": [
          "datastoreusage"
        ],
        "additionalProperties": false,
        "properties": {
          "datastoreusage": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "key",
              "total_bytes"
            ],
            "properties": {
              "key": {
                "type": "string",
                "added": "v23.11",
                "description": [
                  "The key from which the database was traversed."
                ]
              },
              "total_bytes": {
                "type": "u64",
                "added": "v23.11",
                "description": [
                  "The total bytes that are stored under the *key*, including the all descendants data and the size of the keys themselves."
                ]
              }
            }
          }
        }
      },
      "author": [
        "Peter Neuroth [pet.v.ne@gmail.com](mailto:pet.v.ne@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-datastore(7)",
        "lightning-deldatastore(7)",
        "lightning-listdatastore(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:datastoreusage#1",
            "method": "datastoreusage",
            "params": {}
          },
          "response": {
            "datastoreusage": {
              "key": "[]",
              "total_bytes": 2909
            }
          }
        },
        {
          "request": {
            "id": "example:datastoreusage#2",
            "method": "datastoreusage",
            "params": {
              "key": [
                "test",
                "name"
              ]
            }
          },
          "response": {
            "datastoreusage": {
              "key": "[test,name]",
              "total_bytes": 33
            }
          }
        },
        {
          "request": {
            "id": "example:datastoreusage#3",
            "method": "datastoreusage",
            "params": {
              "key": "otherkey"
            }
          },
          "response": {
            "datastoreusage": {
              "key": "[otherkey]",
              "total_bytes": 54
            }
          }
        }
      ]
    },
    "decode.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.05",
      "rpc": "decode",
      "title": "Command for decoding an invoice string (low-level)",
      "description": [
        "The **decode** RPC command checks and parses `bolt11`, `bolt12`, `rune` or `emergency_recover`. It may decode other formats in future."
      ],
      "request": {
        "required": [
          "string"
        ],
        "additionalProperties": false,
        "properties": {
          "string": {
            "type": "string",
            "description": [
              "Value to be decoded:",
              "    * a *bolt11* or *bolt12* string (optionally prefixed by `lightning:` or `LIGHTNING:`) as specified by the BOLT 11 and BOLT 12 specifications.",
              "    * a *rune* as created by lightning-commando-rune(7).",
              "    * an *emergency_recover* string generated by lightning-hsmtool like `lightning-hsmtool getemergencyrecover <path/to/emergency.recover>`. It holds `emergency.recover` contents and starts with `clnemerg1`."
            ]
          }
        }
      },
      "response": {
        "required": [
          "type",
          "valid"
        ],
        "additionalProperties": true,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "bolt12 offer",
              "bolt12 invoice",
              "bolt12 invoice_request",
              "bolt11 invoice",
              "rune",
              "emergency recover"
            ],
            "description": [
              "What kind of object it decoded to."
            ]
          },
          "valid": {
            "type": "boolean",
            "description": [
              "If this is false, you *MUST* not use the result except for diagnostics!"
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "bolt12 offer"
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                }
              }
            },
            "then": {
              "required": [
                "offer_id"
              ],
              "additionalProperties": false,
              "properties": {
                "type": {},
                "valid": {},
                "offer_id": {
                  "type": "hex",
                  "description": [
                    "The id we use to identify this offer."
                  ],
                  "maxLength": 64,
                  "minLength": 64
                },
                "offer_chains": {
                  "type": "array",
                  "description": [
                    "Which blockchains this offer is for (missing implies bitcoin mainnet only)."
                  ],
                  "items": {
                    "type": "hash",
                    "description": [
                      "The genesis blockhash."
                    ]
                  }
                },
                "offer_metadata": {
                  "type": "hex",
                  "description": [
                    "Any metadata the creator of the offer includes."
                  ]
                },
                "offer_currency": {
                  "type": "string",
                  "description": [
                    "ISO 4217 code of the currency (missing implies Bitcoin)."
                  ],
                  "maxLength": 3,
                  "minLength": 3
                },
                "warning_unknown_offer_currency": {
                  "type": "string",
                  "description": [
                    "The currency code is unknown (so no `currency_minor_unit`)."
                  ]
                },
                "currency_minor_unit": {
                  "type": "u32",
                  "description": [
                    "The number of decimal places to apply to amount (if currency known)."
                  ]
                },
                "offer_amount": {
                  "type": "u64",
                  "description": [
                    "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any."
                  ]
                },
                "offer_amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount in bitcoin (if specified, and no `offer_currency`)."
                  ]
                },
                "offer_description": {
                  "type": "string",
                  "description": [
                    "The description of the purpose of the offer."
                  ]
                },
                "offer_issuer": {
                  "type": "string",
                  "description": [
                    "The description of the creator of the offer."
                  ]
                },
                "offer_features": {
                  "type": "hex",
                  "description": [
                    "The feature bits of the offer."
                  ]
                },
                "offer_absolute_expiry": {
                  "type": "u64",
                  "description": [
                    "UNIX timestamp of when this offer expires."
                  ]
                },
                "offer_quantity_max": {
                  "type": "u64",
                  "description": [
                    "The maximum quantity (or, if 0, means any quantity)."
                  ]
                },
                "offer_paths": {
                  "type": "array",
                  "description": [
                    "Paths to the destination."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "first_path_key",
                      "path"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "first_node_id": {
                        "type": "pubkey",
                        "description": [
                          "The (presumably well-known) public key of the start of the path."
                        ]
                      },
                      "first_scid": {
                        "added": "v23.05",
                        "type": "short_channel_id",
                        "description": [
                          "the short channel id of the start of the path (alternative to first_node_id)"
                        ]
                      },
                      "first_scid_dir": {
                        "added": "v23.05",
                        "type": "u32",
                        "description": [
                          "which end of the first_scid is the start of the path"
                        ]
                      },
                      "blinding": {
                        "deprecated": [
                          "v24.11",
                          "v25.05"
                        ],
                        "type": "pubkey",
                        "description": [
                          "Blinding factor for this path."
                        ]
                      },
                      "first_path_key": {
                        "added": "v24.11",
                        "type": "pubkey",
                        "description": [
                          "Path key to deliver to first hop on this path."
                        ]
                      },
                      "path": {
                        "type": "array",
                        "description": [
                          "An individual path."
                        ],
                        "items": {
                          "type": "object",
                          "required": [
                            "blinded_node_id",
                            "encrypted_recipient_data"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "blinded_node_id": {
                              "type": "pubkey",
                              "description": [
                                "Node_id of the hop."
                              ]
                            },
                            "encrypted_recipient_data": {
                              "type": "hex",
                              "description": [
                                "Encrypted TLV entry for this hop."
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "warning_empty_blinded_path": {
                  "added": "v24.08",
                  "type": "string",
                  "description": [
                    "The blinded path has 0 hops."
                  ]
                },
                "offer_node_id": {
                  "type": "pubkey",
                  "deprecated": [
                    "v24.08",
                    "v24.11"
                  ],
                  "description": [
                    "Obsolete name for offer_issuer_id."
                  ]
                },
                "offer_issuer_id": {
                  "type": "pubkey",
                  "added": "v24.08",
                  "description": [
                    "The pubkey associated with the offer (can be a node id)."
                  ]
                },
                "offer_recurrence": {
                  "type": "object",
                  "description": [
                    "How often to this offer should be used."
                  ],
                  "required": [
                    "period",
                    "time_unit"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "time_unit": {
                      "type": "u32",
                      "description": [
                        "The BOLT12 time unit."
                      ]
                    },
                    "time_unit_name": {
                      "type": "string",
                      "description": [
                        "The name of `time_unit` (if valid)."
                      ]
                    },
                    "period": {
                      "type": "u32",
                      "description": [
                        "How many `time_unit` per payment period."
                      ]
                    },
                    "basetime": {
                      "type": "u64",
                      "description": [
                        "Period starts at this UNIX timestamp."
                      ]
                    },
                    "limit": {
                      "type": "u32",
                      "description": [
                        "Maximum period number for recurrence."
                      ]
                    },
                    "paywindow": {
                      "type": "object",
                      "description": [
                        "When within a period will payment be accepted."
                      ],
                      "default": "prior and during the period",
                      "required": [
                        "seconds_before",
                        "seconds_after"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "seconds_before": {
                          "type": "u32",
                          "description": [
                            "Seconds prior to period start."
                          ]
                        },
                        "seconds_after": {
                          "type": "u32",
                          "description": [
                            "Seconds after to period start."
                          ]
                        },
                        "proportional_amount": {
                          "type": "boolean",
                          "enum": [
                            true
                          ],
                          "description": [
                            "Amount should be scaled if paid after period start."
                          ]
                        }
                      }
                    }
                  }
                },
                "unknown_offer_tlvs": {
                  "type": "array",
                  "description": [
                    "Any extra fields we didn't know how to parse."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "length",
                      "value"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "type": "u64",
                        "description": [
                          "The type."
                        ]
                      },
                      "length": {
                        "type": "u64",
                        "description": [
                          "The length."
                        ]
                      },
                      "value": {
                        "type": "hex",
                        "description": [
                          "The value."
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "bolt12 offer"
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    false
                  ]
                }
              }
            },
            "then": {
              "required": [],
              "additionalProperties": false,
              "properties": {
                "type": {},
                "valid": {},
                "offer_id": {},
                "node_id": {},
                "signature": {},
                "chains": {},
                "currency": {},
                "minor_unit": {},
                "warning_unknown_offer_currency": {},
                "amount": {},
                "amount_msat": {},
                "send_invoice": {},
                "description": {},
                "vendor": {},
                "features": {},
                "absolute_expiry": {},
                "paths": {},
                "quantity_max": {},
                "unknown_offer_tlvs": {},
                "recurrence": {},
                "warning_missing_offer_node_id": {
                  "type": "string",
                  "deprecated": [
                    "v24.08",
                    "v24.11"
                  ],
                  "description": [
                    "`offer_node_id` is not present."
                  ]
                },
                "warning_missing_offer_issuer_id": {
                  "type": "string",
                  "added": "v24.08",
                  "description": [
                    "`offer_issuer_id` is not present and there are no offer_paths"
                  ]
                },
                "warning_invalid_offer_description": {
                  "type": "string",
                  "description": [
                    "`offer_description` is not valid UTF8."
                  ]
                },
                "warning_missing_offer_description": {
                  "type": "string",
                  "description": [
                    "`offer_description` is not present."
                  ]
                },
                "warning_invalid_offer_currency": {
                  "type": "string",
                  "description": [
                    "`offer_currency_code` is not valid UTF8."
                  ]
                },
                "warning_invalid_offer_issuer": {
                  "type": "string",
                  "description": [
                    "`offer_issuer` is not valid UTF8."
                  ]
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "bolt12 invoice_request"
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                }
              }
            },
            "then": {
              "required": [
                "invreq_metadata",
                "invreq_payer_id",
                "signature"
              ],
              "additionalProperties": false,
              "properties": {
                "type": {},
                "valid": {},
                "offer_id": {
                  "type": "hex",
                  "description": [
                    "The id we use to identify this offer."
                  ],
                  "maxLength": 64,
                  "minLength": 64
                },
                "offer_chains": {
                  "type": "array",
                  "description": [
                    "Which blockchains this offer is for (missing implies bitcoin mainnet only)."
                  ],
                  "items": {
                    "type": "hex",
                    "description": [
                      "The genesis blockhash."
                    ],
                    "maxLength": 64,
                    "minLength": 64
                  }
                },
                "offer_metadata": {
                  "type": "hex",
                  "description": [
                    "Any metadata the creator of the offer includes."
                  ]
                },
                "offer_currency": {
                  "type": "string",
                  "description": [
                    "ISO 4217 code of the currency (missing implies Bitcoin)."
                  ],
                  "maxLength": 3,
                  "minLength": 3
                },
                "warning_unknown_offer_currency": {
                  "type": "string",
                  "description": [
                    "The currency code is unknown (so no `currency_minor_unit`)."
                  ]
                },
                "currency_minor_unit": {
                  "type": "u32",
                  "description": [
                    "The number of decimal places to apply to amount (if currency known)."
                  ]
                },
                "offer_amount": {
                  "type": "u64",
                  "description": [
                    "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any."
                  ]
                },
                "offer_amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount in bitcoin (if specified, and no `offer_currency`)."
                  ]
                },
                "offer_description": {
                  "type": "string",
                  "description": [
                    "The description of the purpose of the offer."
                  ]
                },
                "offer_issuer": {
                  "type": "string",
                  "description": [
                    "The description of the creator of the offer."
                  ]
                },
                "offer_features": {
                  "type": "hex",
                  "description": [
                    "The feature bits of the offer."
                  ]
                },
                "offer_absolute_expiry": {
                  "type": "u64",
                  "description": [
                    "UNIX timestamp of when this offer expires."
                  ]
                },
                "offer_quantity_max": {
                  "type": "u64",
                  "description": [
                    "The maximum quantity (or, if 0, means any quantity)."
                  ]
                },
                "offer_paths": {
                  "type": "array",
                  "description": [
                    "Paths to the destination."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "first_path_key",
                      "path"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "first_node_id": {
                        "type": "pubkey",
                        "description": [
                          "The (presumably well-known) public key of the start of the path."
                        ]
                      },
                      "first_scid": {
                        "added": "v23.05",
                        "type": "short_channel_id",
                        "description": [
                          "the short channel id of the start of the path (alternative to first_node_id)"
                        ]
                      },
                      "first_scid_dir": {
                        "added": "v23.05",
                        "type": "u32",
                        "description": [
                          "which end of the first_scid is the start of the path"
                        ]
                      },
                      "first_path_key": {
                        "added": "v24.11",
                        "type": "pubkey",
                        "description": [
                          "Path key to deliver to first hop on this path."
                        ]
                      },
                      "blinding": {
                        "deprecated": [
                          "v24.11",
                          "v25.05"
                        ],
                        "type": "pubkey",
                        "description": [
                          "Blinding factor for this path."
                        ]
                      },
                      "path": {
                        "type": "array",
                        "description": [
                          "An individual path."
                        ],
                        "items": {
                          "type": "object",
                          "required": [
                            "blinded_node_id",
                            "encrypted_recipient_data"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "blinded_node_id": {
                              "type": "pubkey",
                              "description": [
                                "Node_id of the hop."
                              ]
                            },
                            "encrypted_recipient_data": {
                              "type": "hex",
                              "description": [
                                "Encrypted TLV entry for this hop."
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "offer_node_id": {
                  "type": "pubkey",
                  "deprecated": [
                    "v24.08",
                    "v24.11"
                  ],
                  "description": [
                    "Public key of the offering node."
                  ]
                },
                "offer_issuer_id": {
                  "type": "pubkey",
                  "added": "v24.08",
                  "description": [
                    "Public key of the offering node (can be a node id)."
                  ]
                },
                "offer_recurrence": {
                  "type": "object",
                  "description": [
                    "How often to this offer should be used."
                  ],
                  "required": [
                    "period",
                    "time_unit"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "time_unit": {
                      "type": "u32",
                      "description": [
                        "The BOLT12 time unit."
                      ]
                    },
                    "time_unit_name": {
                      "type": "string",
                      "description": [
                        "The name of `time_unit` (if valid)."
                      ]
                    },
                    "period": {
                      "type": "u32",
                      "description": [
                        "How many `time_unit` per payment period."
                      ]
                    },
                    "basetime": {
                      "type": "u64",
                      "description": [
                        "Period starts at this UNIX timestamp."
                      ]
                    },
                    "limit": {
                      "type": "u32",
                      "description": [
                        "Maximum period number for recurrence."
                      ]
                    },
                    "paywindow": {
                      "type": "object",
                      "description": [
                        "When within a period will payment be accepted."
                      ],
                      "default": "prior and during the period",
                      "required": [
                        "seconds_before",
                        "seconds_after"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "seconds_before": {
                          "type": "u32",
                          "description": [
                            "Seconds prior to period start."
                          ]
                        },
                        "seconds_after": {
                          "type": "u32",
                          "description": [
                            "Seconds after to period start."
                          ]
                        },
                        "proportional_amount": {
                          "type": "boolean",
                          "enum": [
                            true
                          ],
                          "description": [
                            "Amount should be scaled if paid after period start."
                          ]
                        }
                      }
                    }
                  }
                },
                "invreq_metadata": {
                  "type": "hex",
                  "description": [
                    "The payer-provided blob to derive invreq_payer_id."
                  ]
                },
                "invreq_payer_id": {
                  "type": "hex",
                  "description": [
                    "The payer-provided key."
                  ]
                },
                "invreq_chain": {
                  "type": "hex",
                  "description": [
                    "Which blockchain this offer is for (missing implies bitcoin mainnet only)."
                  ],
                  "maxLength": 64,
                  "minLength": 64
                },
                "invreq_amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount the invoice should be for."
                  ]
                },
                "invreq_features": {
                  "type": "hex",
                  "description": [
                    "The feature bits of the invoice_request."
                  ]
                },
                "invreq_quantity": {
                  "type": "u64",
                  "description": [
                    "The number of items to invoice for."
                  ]
                },
                "invreq_payer_note": {
                  "type": "string",
                  "description": [
                    "A note attached by the payer."
                  ]
                },
                "invreq_paths": {
                  "type": "array",
                  "added": "v24.08",
                  "description": [
                    "Paths to the destination."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "first_path_key",
                      "path"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "first_node_id": {
                        "added": "v24.08",
                        "type": "pubkey",
                        "description": [
                          "The (presumably well-known) public key of the start of the path."
                        ]
                      },
                      "first_scid": {
                        "added": "v24.08",
                        "type": "short_channel_id",
                        "description": [
                          "the short channel id of the start of the path (alternative to first_node_id)"
                        ]
                      },
                      "first_scid_dir": {
                        "added": "v24.08",
                        "type": "u32",
                        "description": [
                          "which end of the first_scid is the start of the path"
                        ]
                      },
                      "blinding": {
                        "added": "v24.08",
                        "deprecated": [
                          "v24.11",
                          "v25.05"
                        ],
                        "type": "pubkey",
                        "description": [
                          "Blinding factor for this path."
                        ]
                      },
                      "first_path_key": {
                        "added": "v24.11",
                        "type": "pubkey",
                        "description": [
                          "Path key to deliver to first hop on this path."
                        ]
                      },
                      "path": {
                        "type": "array",
                        "added": "v24.08",
                        "description": [
                          "An individual path."
                        ],
                        "items": {
                          "type": "object",
                          "required": [
                            "blinded_node_id",
                            "encrypted_recipient_data"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "blinded_node_id": {
                              "added": "v24.08",
                              "type": "pubkey",
                              "description": [
                                "Node_id of the hop."
                              ]
                            },
                            "encrypted_recipient_data": {
                              "added": "v24.08",
                              "type": "hex",
                              "description": [
                                "Encrypted TLV entry for this hop."
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "invreq_bip_353_name": {
                  "type": "object",
                  "added": "v25.02",
                  "description": [
                    "BIP 353 name which this invoice request is for."
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "type": "string",
                      "added": "v25.02",
                      "description": [
                        "The name (part before the @)."
                      ]
                    },
                    "domain": {
                      "type": "string",
                      "added": "v25.02",
                      "description": [
                        "The domain (part after the @)."
                      ]
                    }
                  }
                },
                "invreq_recurrence_counter": {
                  "type": "u32",
                  "description": [
                    "Which number request this is for the same invoice."
                  ]
                },
                "invreq_recurrence_start": {
                  "type": "u32",
                  "description": [
                    "When we're requesting to start an invoice at a non-zero period."
                  ]
                },
                "signature": {
                  "type": "bip340sig",
                  "description": [
                    "BIP-340 signature of the `invreq_payer_id` on this invoice_request."
                  ]
                },
                "unknown_invoice_request_tlvs": {
                  "type": "array",
                  "description": [
                    "Any extra fields we didn't know how to parse."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "length",
                      "value"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "type": "u64",
                        "description": [
                          "The type."
                        ]
                      },
                      "length": {
                        "type": "u64",
                        "description": [
                          "The length."
                        ]
                      },
                      "value": {
                        "type": "hex",
                        "description": [
                          "The value."
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "bolt12 invoice_request"
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    false
                  ]
                }
              }
            },
            "then": {
              "required": [],
              "additionalProperties": false,
              "properties": {
                "type": {},
                "valid": {},
                "offer_id": {},
                "offer_chains": {},
                "offer_metadata": {},
                "offer_currency": {},
                "warning_unknown_offer_currency": {},
                "currency_minor_unit": {},
                "offer_amount": {},
                "offer_amount_msat": {},
                "offer_description": {},
                "offer_issuer": {},
                "offer_features": {},
                "offer_absolute_expiry": {},
                "offer_quantity_max": {},
                "offer_paths": {},
                "offer_node_id": {},
                "offer_issuer_id": {},
                "offer_recurrence": {},
                "invreq_metadata": {},
                "invreq_payer_id": {},
                "invreq_chain": {},
                "invreq_amount_msat": {},
                "invreq_features": {},
                "invreq_quantity": {},
                "invreq_payer_note": {},
                "invreq_paths": {},
                "invreq_bip_353_name": {},
                "invreq_recurrence_counter": {},
                "invreq_recurrence_start": {},
                "warning_invalid_offer_description": {
                  "type": "string",
                  "description": [
                    "`offer_description` is not valid UTF8."
                  ]
                },
                "warning_missing_offer_description": {
                  "type": "string",
                  "description": [
                    "`offer_description` is not present."
                  ]
                },
                "warning_invalid_offer_currency": {
                  "type": "string",
                  "description": [
                    "`offer_currency_code` is not valid UTF8."
                  ]
                },
                "warning_invalid_offer_issuer": {
                  "type": "string",
                  "description": [
                    "`offer_issuer` is not valid UTF8."
                  ]
                },
                "warning_missing_invreq_metadata": {
                  "type": "string",
                  "description": [
                    "`invreq_metadata` is not present."
                  ]
                },
                "warning_missing_invreq_payer_id": {
                  "type": "string",
                  "description": [
                    "`invreq_payer_id` is not present."
                  ]
                },
                "warning_invalid_invreq_payer_note": {
                  "type": "string",
                  "description": [
                    "`invreq_payer_note` is not valid UTF8."
                  ]
                },
                "warning_invreq_bip_353_name_name_invalid": {
                  "type": "string",
                  "added": "v25.02",
                  "description": [
                    "`invreq_bip_353_name` name field contains unusual characters."
                  ]
                },
                "warning_invreq_bip_353_name_domain_invalid": {
                  "type": "string",
                  "added": "v25.02",
                  "description": [
                    "`invreq_bip_353_name` domain field contains unusual characters."
                  ]
                },
                "warning_missing_invoice_request_signature": {
                  "type": "string",
                  "description": [
                    "`signature` is not present."
                  ]
                },
                "warning_invalid_invoice_request_signature": {
                  "type": "string",
                  "description": [
                    "Incorrect `signature`."
                  ]
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "bolt12 invoice"
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                }
              }
            },
            "then": {
              "required": [
                "invreq_metadata",
                "invreq_payer_id",
                "invoice_paths",
                "invoice_created_at",
                "invoice_payment_hash",
                "invoice_amount_msat",
                "signature"
              ],
              "additionalProperties": false,
              "properties": {
                "type": {},
                "valid": {},
                "offer_id": {
                  "type": "hex",
                  "description": [
                    "The id we use to identify this offer."
                  ],
                  "maxLength": 64,
                  "minLength": 64
                },
                "offer_chains": {
                  "type": "array",
                  "description": [
                    "Which blockchains this offer is for (missing implies bitcoin mainnet only)."
                  ],
                  "items": {
                    "type": "hex",
                    "description": [
                      "The genesis blockhash."
                    ],
                    "maxLength": 64,
                    "minLength": 64
                  }
                },
                "offer_metadata": {
                  "type": "hex",
                  "description": [
                    "Any metadata the creator of the offer includes."
                  ]
                },
                "offer_currency": {
                  "type": "string",
                  "description": [
                    "ISO 4217 code of the currency (missing implies Bitcoin)."
                  ],
                  "maxLength": 3,
                  "minLength": 3
                },
                "warning_unknown_offer_currency": {
                  "type": "string",
                  "description": [
                    "The currency code is unknown (so no `currency_minor_unit`)."
                  ]
                },
                "currency_minor_unit": {
                  "type": "u32",
                  "description": [
                    "The number of decimal places to apply to amount (if currency known)."
                  ]
                },
                "offer_amount": {
                  "type": "u64",
                  "description": [
                    "The amount in the `offer_currency` adjusted by `currency_minor_unit`, if any."
                  ]
                },
                "offer_amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount in bitcoin (if specified, and no `offer_currency`)."
                  ]
                },
                "offer_description": {
                  "type": "string",
                  "description": [
                    "The description of the purpose of the offer."
                  ]
                },
                "offer_issuer": {
                  "type": "string",
                  "description": [
                    "The description of the creator of the offer."
                  ]
                },
                "offer_features": {
                  "type": "hex",
                  "description": [
                    "The feature bits of the offer."
                  ]
                },
                "offer_absolute_expiry": {
                  "type": "u64",
                  "description": [
                    "UNIX timestamp of when this offer expires."
                  ]
                },
                "offer_quantity_max": {
                  "type": "u64",
                  "description": [
                    "The maximum quantity (or, if 0, means any quantity)."
                  ]
                },
                "offer_paths": {
                  "type": "array",
                  "description": [
                    "Paths to the destination."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "first_path_key",
                      "path"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "first_node_id": {
                        "type": "pubkey",
                        "description": [
                          "The (presumably well-known) public key of the start of the path."
                        ]
                      },
                      "first_scid": {
                        "added": "v23.05",
                        "type": "short_channel_id",
                        "description": [
                          "the short channel id of the start of the path (alternative to first_node_id)"
                        ]
                      },
                      "first_scid_dir": {
                        "added": "v23.05",
                        "type": "u32",
                        "description": [
                          "which end of the first_scid is the start of the path"
                        ]
                      },
                      "blinding": {
                        "deprecated": [
                          "v24.11",
                          "v25.05"
                        ],
                        "type": "pubkey",
                        "description": [
                          "Blinding factor for this path."
                        ]
                      },
                      "first_path_key": {
                        "added": "v24.11",
                        "type": "pubkey",
                        "description": [
                          "Path key to deliver to first hop on this path."
                        ]
                      },
                      "path": {
                        "type": "array",
                        "description": [
                          "An individual path."
                        ],
                        "items": {
                          "type": "object",
                          "required": [
                            "blinded_node_id",
                            "encrypted_recipient_data"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "blinded_node_id": {
                              "type": "pubkey",
                              "description": [
                                "Node_id of the hop."
                              ]
                            },
                            "encrypted_recipient_data": {
                              "type": "hex",
                              "description": [
                                "Encrypted TLV entry for this hop."
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "offer_node_id": {
                  "type": "pubkey",
                  "deprecated": [
                    "v24.08",
                    "v24.11"
                  ],
                  "description": [
                    "Public key of the offering node."
                  ]
                },
                "offer_issuer_id": {
                  "type": "pubkey",
                  "added": "v24.08",
                  "description": [
                    "Public key of the offering node (can be a node id)."
                  ]
                },
                "offer_recurrence": {
                  "type": "object",
                  "description": [
                    "How often to this offer should be used."
                  ],
                  "required": [
                    "period",
                    "time_unit"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "time_unit": {
                      "type": "u32",
                      "description": [
                        "The BOLT12 time unit."
                      ]
                    },
                    "time_unit_name": {
                      "type": "string",
                      "description": [
                        "The name of `time_unit` (if valid)."
                      ]
                    },
                    "period": {
                      "type": "u32",
                      "description": [
                        "How many `time_unit` per payment period."
                      ]
                    },
                    "basetime": {
                      "type": "u64",
                      "description": [
                        "Period starts at this UNIX timestamp."
                      ]
                    },
                    "limit": {
                      "type": "u32",
                      "description": [
                        "Maximum period number for recurrence."
                      ]
                    },
                    "paywindow": {
                      "type": "object",
                      "description": [
                        "When within a period will payment be accepted."
                      ],
                      "default": "prior and during the period",
                      "required": [
                        "seconds_before",
                        "seconds_after"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "seconds_before": {
                          "type": "u32",
                          "description": [
                            "Seconds prior to period start."
                          ]
                        },
                        "seconds_after": {
                          "type": "u32",
                          "description": [
                            "Seconds after to period start."
                          ]
                        },
                        "proportional_amount": {
                          "type": "boolean",
                          "enum": [
                            true
                          ],
                          "description": [
                            "Amount should be scaled if paid after period start."
                          ]
                        }
                      }
                    }
                  }
                },
                "invreq_metadata": {
                  "type": "hex",
                  "description": [
                    "The payer-provided blob to derive invreq_payer_id."
                  ]
                },
                "invreq_payer_id": {
                  "type": "hex",
                  "description": [
                    "The payer-provided key."
                  ]
                },
                "invreq_chain": {
                  "type": "hex",
                  "description": [
                    "Which blockchain this offer is for (missing implies bitcoin mainnet only)."
                  ],
                  "maxLength": 64,
                  "minLength": 64
                },
                "invreq_amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount the invoice should be for."
                  ]
                },
                "invreq_features": {
                  "type": "hex",
                  "description": [
                    "The feature bits of the invoice_request."
                  ]
                },
                "invreq_quantity": {
                  "type": "u64",
                  "description": [
                    "The number of items to invoice for."
                  ]
                },
                "invreq_payer_note": {
                  "type": "string",
                  "description": [
                    "A note attached by the payer."
                  ]
                },
                "invreq_paths": {
                  "type": "array",
                  "added": "v24.08",
                  "description": [
                    "Paths to the destination."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "first_path_key",
                      "path"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "first_node_id": {
                        "added": "v24.08",
                        "type": "pubkey",
                        "description": [
                          "The (presumably well-known) public key of the start of the path."
                        ]
                      },
                      "first_scid": {
                        "added": "v24.08",
                        "type": "short_channel_id",
                        "description": [
                          "the short channel id of the start of the path (alternative to first_node_id)"
                        ]
                      },
                      "first_scid_dir": {
                        "added": "v24.08",
                        "type": "u32",
                        "description": [
                          "which end of the first_scid is the start of the path"
                        ]
                      },
                      "blinding": {
                        "added": "v24.08",
                        "deprecated": [
                          "v24.11",
                          "v25.05"
                        ],
                        "type": "pubkey",
                        "description": [
                          "Blinding factor for this path."
                        ]
                      },
                      "first_path_key": {
                        "added": "v24.11",
                        "type": "pubkey",
                        "description": [
                          "Path key to deliver to first hop on this path."
                        ]
                      },
                      "path": {
                        "type": "array",
                        "added": "v24.08",
                        "description": [
                          "An individual path."
                        ],
                        "items": {
                          "type": "object",
                          "required": [
                            "blinded_node_id",
                            "encrypted_recipient_data"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "blinded_node_id": {
                              "added": "v24.08",
                              "type": "pubkey",
                              "description": [
                                "Node_id of the hop."
                              ]
                            },
                            "encrypted_recipient_data": {
                              "added": "v24.08",
                              "type": "hex",
                              "description": [
                                "Encrypted TLV entry for this hop."
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "invreq_bip_353_name": {
                  "type": "object",
                  "added": "v25.02",
                  "description": [
                    "BIP 353 name which this invoice request is for."
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "type": "string",
                      "added": "v25.02",
                      "description": [
                        "The name (part before the @)."
                      ]
                    },
                    "domain": {
                      "type": "string",
                      "added": "v25.02",
                      "description": [
                        "The domain (part after the @)."
                      ]
                    }
                  }
                },
                "invreq_recurrence_counter": {
                  "type": "u32",
                  "description": [
                    "Which number request this is for the same invoice."
                  ]
                },
                "invreq_recurrence_start": {
                  "type": "u32",
                  "description": [
                    "When we're requesting to start an invoice at a non-zero period."
                  ]
                },
                "invoice_paths": {
                  "type": "array",
                  "description": [
                    "Paths to pay the destination."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "first_path_key",
                      "payinfo",
                      "path"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "first_node_id": {
                        "type": "pubkey",
                        "description": [
                          "The (presumably well-known) public key of the start of the path."
                        ]
                      },
                      "first_scid": {
                        "added": "v23.05",
                        "type": "short_channel_id",
                        "description": [
                          "the short channel id of the start of the path (alternative to first_node_id)"
                        ]
                      },
                      "first_scid_dir": {
                        "added": "v23.05",
                        "type": "u32",
                        "description": [
                          "which end of the first_scid is the start of the path"
                        ]
                      },
                      "blinding": {
                        "type": "pubkey",
                        "deprecated": [
                          "v24.11",
                          "v25.05"
                        ],
                        "description": [
                          "Blinding factor for this path."
                        ]
                      },
                      "first_path_key": {
                        "added": "v24.11",
                        "type": "pubkey",
                        "description": [
                          "Path key to deliver to first hop on this path."
                        ]
                      },
                      "payinfo": {
                        "type": "object",
                        "required": [
                          "fee_base_msat",
                          "fee_proportional_millionths",
                          "cltv_expiry_delta",
                          "features"
                        ],
                        "additionalProperties": false,
                        "properties": {
                          "fee_base_msat": {
                            "type": "msat",
                            "description": [
                              "Basefee for path."
                            ]
                          },
                          "fee_proportional_millionths": {
                            "type": "u32",
                            "description": [
                              "Proportional fee for path."
                            ]
                          },
                          "cltv_expiry_delta": {
                            "type": "u32",
                            "description": [
                              "CLTV delta for path."
                            ]
                          },
                          "features": {
                            "type": "hex",
                            "description": [
                              "Features allowed for path."
                            ]
                          }
                        }
                      },
                      "path": {
                        "type": "array",
                        "description": [
                          "An individual path."
                        ],
                        "items": {
                          "type": "object",
                          "required": [
                            "blinded_node_id",
                            "encrypted_recipient_data"
                          ],
                          "additionalProperties": false,
                          "properties": {
                            "blinded_node_id": {
                              "type": "pubkey",
                              "description": [
                                "Node_id of the hop."
                              ]
                            },
                            "encrypted_recipient_data": {
                              "type": "hex",
                              "description": [
                                "Encrypted TLV entry for this hop."
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "invoice_created_at": {
                  "type": "u64",
                  "description": [
                    "The UNIX timestamp of invoice creation."
                  ]
                },
                "invoice_relative_expiry": {
                  "type": "u32",
                  "description": [
                    "The number of seconds after *invoice_created_at* when this expires."
                  ]
                },
                "invoice_payment_hash": {
                  "type": "hex",
                  "description": [
                    "The hash of the *payment_preimage*."
                  ],
                  "maxLength": 64,
                  "minLength": 64
                },
                "invoice_amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount required to fulfill invoice."
                  ]
                },
                "invoice_fallbacks": {
                  "type": "array",
                  "description": [
                    "Onchain addresses."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "version",
                      "hex"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "version": {
                        "type": "u8",
                        "description": [
                          "Segwit address version."
                        ]
                      },
                      "hex": {
                        "type": "hex",
                        "description": [
                          "Raw encoded segwit address."
                        ]
                      },
                      "address": {
                        "type": "string",
                        "description": [
                          "Bech32 segwit address."
                        ]
                      }
                    }
                  }
                },
                "invoice_features": {
                  "type": "hex",
                  "description": [
                    "The feature bits of the invoice."
                  ]
                },
                "invoice_node_id": {
                  "type": "pubkey",
                  "description": [
                    "The id to pay (usually the same as offer_issuer_id)."
                  ]
                },
                "invoice_recurrence_basetime": {
                  "type": "u64",
                  "description": [
                    "The UNIX timestamp to base the invoice periods on."
                  ]
                },
                "signature": {
                  "type": "bip340sig",
                  "description": [
                    "BIP-340 signature of the `offer_issuer_id` on this invoice."
                  ]
                },
                "unknown_invoice_tlvs": {
                  "type": "array",
                  "description": [
                    "Any extra fields we didn't know how to parse."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "length",
                      "value"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "type": "u64",
                        "description": [
                          "The type."
                        ]
                      },
                      "length": {
                        "type": "u64",
                        "description": [
                          "The length."
                        ]
                      },
                      "value": {
                        "type": "hex",
                        "description": [
                          "The value."
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "bolt12 invoice"
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    false
                  ]
                }
              }
            },
            "then": {
              "required": [],
              "additionalProperties": false,
              "properties": {
                "type": {},
                "valid": {},
                "offer_id": {},
                "offer_chains": {},
                "offer_metadata": {},
                "offer_currency": {},
                "warning_unknown_offer_currency": {},
                "currency_minor_unit": {},
                "offer_amount": {},
                "offer_amount_msat": {},
                "offer_description": {},
                "offer_issuer": {},
                "offer_features": {},
                "offer_absolute_expiry": {},
                "offer_quantity_max": {},
                "offer_paths": {},
                "offer_node_id": {},
                "offer_issuer_id": {},
                "offer_recurrence": {},
                "invreq_metadata": {},
                "invreq_payer_id": {},
                "invreq_chain": {},
                "invreq_amount_msat": {},
                "invreq_features": {},
                "invreq_quantity": {},
                "invreq_payer_note": {},
                "invreq_paths": {},
                "invreq_bip_353_name": {},
                "invreq_node_id": {},
                "invreq_recurrence_counter": {},
                "invreq_recurrence_start": {},
                "warning_invalid_offer_description": {
                  "type": "string",
                  "description": [
                    "`offer_description` is not valid UTF8."
                  ]
                },
                "warning_missing_offer_description": {
                  "type": "string",
                  "description": [
                    "`offer_description` is not present."
                  ]
                },
                "warning_invalid_offer_currency": {
                  "type": "string",
                  "description": [
                    "`offer_currency_code` is not valid UTF8."
                  ]
                },
                "warning_invalid_offer_issuer": {
                  "type": "string",
                  "description": [
                    "`offer_issuer` is not valid UTF8."
                  ]
                },
                "warning_missing_invreq_metadata": {
                  "type": "string",
                  "description": [
                    "`invreq_metadata` is not present."
                  ]
                },
                "warning_invalid_invreq_payer_note": {
                  "type": "string",
                  "description": [
                    "`invreq_payer_note` is not valid UTF8."
                  ]
                },
                "warning_missing_invoice_paths": {
                  "type": "string",
                  "description": [
                    "`invoice_paths` is not present."
                  ]
                },
                "warning_missing_invoice_blindedpay": {
                  "type": "string",
                  "description": [
                    "`invoice_blindedpay` is not present."
                  ]
                },
                "warning_missing_invoice_created_at": {
                  "type": "string",
                  "description": [
                    "`invoice_created_at` is not present."
                  ]
                },
                "warning_missing_invoice_payment_hash": {
                  "type": "string",
                  "description": [
                    "`invoice_payment_hash` is not present."
                  ]
                },
                "warning_missing_invoice_amount": {
                  "type": "string",
                  "description": [
                    "`invoice_amount` is not present."
                  ]
                },
                "warning_missing_invoice_recurrence_basetime": {
                  "type": "string",
                  "description": [
                    "`invoice_recurrence_basetime` is not present."
                  ]
                },
                "warning_missing_invoice_node_id": {
                  "type": "string",
                  "description": [
                    "`invoice_node_id` is not present."
                  ]
                },
                "warning_missing_invoice_signature": {
                  "type": "string",
                  "description": [
                    "`signature` is not present."
                  ]
                },
                "warning_invalid_invoice_signature": {
                  "type": "string",
                  "description": [
                    "Incorrect `signature`."
                  ]
                },
                "fallbacks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "version",
                      "hex"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "version": {},
                      "hex": {},
                      "address": {},
                      "warning_invoice_fallbacks_version_invalid": {
                        "type": "string",
                        "description": [
                          "`version` is > 16."
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "bolt11 invoice"
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                }
              }
            },
            "then": {
              "required": [
                "currency",
                "created_at",
                "expiry",
                "payee",
                "min_final_cltv_expiry",
                "payment_hash",
                "signature"
              ],
              "additionalProperties": false,
              "properties": {
                "type": {},
                "valid": {},
                "currency": {
                  "type": "string",
                  "description": [
                    "The BIP173 name for the currency."
                  ]
                },
                "created_at": {
                  "type": "u64",
                  "description": [
                    "The UNIX-style timestamp of the invoice."
                  ]
                },
                "expiry": {
                  "type": "u64",
                  "description": [
                    "The number of seconds this is valid after `created_at`."
                  ]
                },
                "payee": {
                  "type": "pubkey",
                  "description": [
                    "The public key of the recipient."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "Amount the invoice asked for."
                  ]
                },
                "payment_hash": {
                  "type": "hash",
                  "description": [
                    "The hash of the *payment_preimage*."
                  ]
                },
                "signature": {
                  "type": "signature",
                  "description": [
                    "Signature of the *payee* on this invoice."
                  ]
                },
                "description": {
                  "type": "string",
                  "description": [
                    "The description of the purpose of the purchase."
                  ]
                },
                "description_hash": {
                  "type": "hash",
                  "description": [
                    "The hash of the description, in place of *description*."
                  ]
                },
                "min_final_cltv_expiry": {
                  "type": "u32",
                  "description": [
                    "The minimum CLTV delay for the final node."
                  ]
                },
                "payment_secret": {
                  "type": "secret",
                  "description": [
                    "The secret to hand to the payee node."
                  ]
                },
                "features": {
                  "type": "hex",
                  "description": [
                    "The features bitmap for this invoice."
                  ]
                },
                "payment_metadata": {
                  "type": "hex",
                  "description": [
                    "The payment_metadata to put in the payment."
                  ]
                },
                "fallbacks": {
                  "type": "array",
                  "description": [
                    "Onchain addresses."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "type",
                      "hex"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "type": "string",
                        "description": [
                          "The address type (if known)."
                        ],
                        "enum": [
                          "P2PKH",
                          "P2SH",
                          "P2WPKH",
                          "P2WSH",
                          "P2TR"
                        ]
                      },
                      "addr": {
                        "type": "string",
                        "description": [
                          "The address in appropriate format for *type*."
                        ]
                      },
                      "hex": {
                        "type": "hex",
                        "description": [
                          "Raw encoded address."
                        ]
                      }
                    }
                  }
                },
                "routes": {
                  "type": "array",
                  "description": [
                    "Route hints to the *payee*."
                  ],
                  "items": {
                    "type": "array",
                    "description": [
                      "Hops in the route."
                    ],
                    "items": {
                      "type": "object",
                      "required": [
                        "pubkey",
                        "short_channel_id",
                        "fee_base_msat",
                        "fee_proportional_millionths",
                        "cltv_expiry_delta"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "pubkey": {
                          "type": "pubkey",
                          "description": [
                            "The public key of the node."
                          ]
                        },
                        "short_channel_id": {
                          "type": "short_channel_id",
                          "description": [
                            "A channel to the next peer."
                          ]
                        },
                        "fee_base_msat": {
                          "type": "msat",
                          "description": [
                            "The base fee for payments."
                          ]
                        },
                        "fee_proportional_millionths": {
                          "type": "u32",
                          "description": [
                            "The parts-per-million fee for payments."
                          ]
                        },
                        "cltv_expiry_delta": {
                          "type": "u32",
                          "description": [
                            "The CLTV delta across this hop."
                          ]
                        }
                      }
                    }
                  }
                },
                "extra": {
                  "type": "array",
                  "description": [
                    "Any extra fields we didn't know how to parse."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "tag",
                      "data"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "tag": {
                        "type": "string",
                        "description": [
                          "The bech32 letter which identifies this field."
                        ],
                        "maxLength": 1,
                        "minLength": 1
                      },
                      "data": {
                        "type": "string",
                        "description": [
                          "The bech32 data for this field."
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "rune"
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                }
              }
            },
            "then": {
              "required": [
                "string",
                "restrictions",
                "valid"
              ],
              "additionalProperties": false,
              "properties": {
                "unique_id": {
                  "type": "string",
                  "description": [
                    "Unique id (always a numeric id on runes we create)."
                  ]
                },
                "version": {
                  "type": "string",
                  "description": [
                    "Rune version, not currently set on runes we create."
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                },
                "type": {},
                "string": {
                  "type": "string",
                  "description": [
                    "The string encoding of the rune."
                  ]
                },
                "restrictions": {
                  "type": "array",
                  "description": [
                    "Restrictions built into the rune: all must pass."
                  ],
                  "items": {
                    "type": "object",
                    "required": [
                      "alternatives",
                      "summary"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "alternatives": {
                        "type": "array",
                        "description": [
                          "Each way restriction can be met: any can pass."
                        ],
                        "items": {
                          "type": "string",
                          "description": [
                            "The alternative of form fieldname condition fieldname."
                          ]
                        }
                      },
                      "summary": {
                        "type": "string",
                        "description": [
                          "Human-readable summary of this restriction."
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "rune"
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    false
                  ]
                }
              }
            },
            "then": {
              "required": [
                "valid"
              ],
              "additionalProperties": false,
              "properties": {
                "valid": {
                  "type": "boolean",
                  "enum": [
                    false
                  ]
                },
                "type": {},
                "warning_rune_invalid_utf8": {
                  "type": "string",
                  "description": [
                    "The rune contains invalid UTF-8 strings."
                  ]
                },
                "hex": {
                  "type": "hex",
                  "description": [
                    "The raw rune in hex."
                  ]
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "emergency recover"
                  ]
                },
                "valid": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                }
              }
            },
            "then": {
              "required": [
                "decrypted"
              ],
              "additionalProperties": false,
              "properties": {
                "type": {},
                "valid": {},
                "decrypted": {
                  "type": "hex",
                  "description": [
                    "The decrypted value of the provided bech32 of emergency.recover."
                  ],
                  "added": "v23.11"
                }
              }
            }
          }
        ]
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-pay(7)",
        "lightning-offer(7)",
        "lightning-fetchinvoice(7)",
        "lightning-sendinvoice(7)",
        "lightning-commando-rune(7)"
      ],
      "resources": [
        "[BOLT #11](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md)",
        "",
        "[BOLT #12](https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md)",
        "(experimental, [bolt](https://github.com/lightning/bolts) #798)",
        "",
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:decode#1",
            "method": "decode",
            "params": [
              "zFMd1fjhrAYxUeFA54TjloZqOt8JrA_i_nYwIgXkag49MA=="
            ]
          },
          "response": {
            "type": "rune",
            "unique_id": "0",
            "string": "cc531dd5f8e1ac063151e140e784e396866a3adf09ac0fe2fe76302205e46a0e:=0",
            "restrictions": [],
            "valid": true
          }
        },
        {
          "request": {
            "id": "example:decode#2",
            "method": "decode",
            "params": [
              "lnbcrt100n1pnt2bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000"
            ]
          },
          "response": {
            "type": "bolt11 invoice",
            "currency": "bcrt",
            "created_at": 1738000000,
            "expiry": 604800,
            "payee": "nodeid020202020202020202020202020202020202020202020202020202020202",
            "amount_msat": 200000,
            "description": "l22 description",
            "min_final_cltv_expiry": 5,
            "payment_secret": "paymentsecretinvl00220002200022000220002200022000220002200022000",
            "features": "02024100",
            "routes": [
              [
                {
                  "pubkey": "nodeid030303030303030303030303030303030303030303030303030303030303",
                  "short_channel_id": "111x1x1",
                  "fee_base_msat": 1,
                  "fee_proportional_millionths": 10,
                  "cltv_expiry_delta": 6
                }
              ]
            ],
            "payment_hash": "paymenthashinvl0220022002200220022002200220022002200220022002200",
            "signature": "dcde30c4bb50bed221009d010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
            "valid": true
          }
        }
      ]
    },
    "deldatastore.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "deldatastore",
      "title": "Command for removing (plugin) data",
      "description": [
        "The **deldatastore** RPC command allows plugins to delete data it has stored in the Core Lightning database.",
        "",
        "The command fails if the *key* isn't present, or if *generation* is specified and the generation of the data does not exactly match."
      ],
      "request": {
        "required": [
          "key"
        ],
        "additionalProperties": false,
        "properties": {
          "key": {
            "oneOf": [
              {
                "type": "array",
                "description": [
                  "Key is an array of values (though a single value is treated as a one-element array), to form a heirarchy. Using the first element of the key as the plugin name (e.g. [ 'summary' ]) is recommended. A key can either have children or a value, never both: parents are created and removed automatically."
                ],
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              }
            ]
          },
          "generation": {
            "type": "u64",
            "description": [
              "If specified, means that the update will fail if the previously-existing data is not exactly that generation. This allows for simple atomicity. This is only legal with mode `must-replace` or `must-append`."
            ]
          }
        }
      },
      "response": {
        "required": [
          "key"
        ],
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "array",
            "items": {
              "type": "string",
              "description": [
                "Part of the key added to the datastore."
              ]
            }
          },
          "generation": {
            "type": "u64",
            "description": [
              "The number of times this has been updated."
            ]
          },
          "hex": {
            "type": "hex",
            "description": [
              "The hex data which has removed from the datastore."
            ]
          },
          "string": {
            "type": "string",
            "description": [
              "The data as a string, if it's valid utf-8."
            ]
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- 1200: the key does not exist",
        "- 1201: the key does exist, but the generation is wrong",
        "- -32602: invalid parameters"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listdatastore(7)",
        "lightning-datastore(7)",
        "lightning-datastoreusage(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:deldatastore#1",
            "method": "deldatastore",
            "params": {
              "key": [
                "test",
                "name"
              ]
            }
          },
          "response": {
            "key": [
              "test",
              "name"
            ],
            "generation": 0,
            "hex": "736176696e67206461746120746f207468652073746f7265",
            "string": "saving data to the store"
          }
        },
        {
          "request": {
            "id": "example:deldatastore#2",
            "method": "deldatastore",
            "params": {
              "key": "otherkey",
              "generation": 1
            }
          },
          "response": {
            "key": [
              "otherkey"
            ],
            "generation": 1,
            "hex": "6f74686572206b65793a207465787420746f20626520617070656e64656420746f20746865206f746865726b6579",
            "string": "other key: text to be appended to the otherkey"
          }
        }
      ]
    },
    "delforward.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "delforward",
      "title": "Command for removing a forwarding entry",
      "description": [
        "The **delforward** RPC command removes a single forward from **listforwards**, using the uniquely-identifying *in_channel* and *in_htlc_id* (and, as a sanity check, the *status*) given by that command.",
        "",
        "This command is mainly used by the *autoclean* plugin (see lightningd- config(7)), As these database entries are only kept for your own analysis, removing them has no effect on the running of your node."
      ],
      "request": {
        "required": [
          "in_channel",
          "in_htlc_id",
          "status"
        ],
        "additionalProperties": false,
        "properties": {
          "in_channel": {
            "type": "short_channel_id",
            "description": [
              "Only the matching forwards on the given inbound channel are deleted. Note: for **listforwards** entries without an *in_htlc_id* entry (no longer created in v22.11, but can exist from older versions), a value of 18446744073709551615 can be used, but then it will delete *all* entries without *in_htlc_id* for this *in_channel* and *status*."
            ]
          },
          "in_htlc_id": {
            "type": "u64",
            "description": [
              "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)."
            ]
          },
          "status": {
            "type": "string",
            "description": [
              "The status of the forward to delete. You cannot delete forwards which have status *offered* (i.e. are currently active)."
            ],
            "enum": [
              "settled",
              "local_failed",
              "failed"
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "errors": [
        "The following errors may be reported:",
        "",
        "- 1401: The forward specified does not exist."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-autoclean(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:delforward#1",
            "method": "delforward",
            "params": {
              "in_channel": "109x1x1",
              "in_htlc_id": 4,
              "status": "local_failed"
            }
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:delforward#2",
            "method": "delforward",
            "params": {
              "in_channel": "109x1x1",
              "in_htlc_id": 21,
              "status": "failed"
            }
          },
          "response": {}
        }
      ]
    },
    "delinvoice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "delinvoice",
      "title": "Command for removing an invoice (or just its description)",
      "description": [
        "The **delinvoice** RPC command removes an invoice with *status* as given in **listinvoices**, or with *desconly* set, removes its description."
      ],
      "request": {
        "required": [
          "label",
          "status"
        ],
        "additionalProperties": true,
        "properties": {
          "label": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "u64"
              }
            ],
            "description": [
              "Label of the invoice to be deleted."
            ]
          },
          "status": {
            "type": "string",
            "description": [
              "Label of the invoice to be deleted. The caller should be particularly aware of the error case caused by the *status* changing just before this command is invoked!"
            ],
            "enum": [
              "paid",
              "expired",
              "unpaid"
            ]
          },
          "desconly": {
            "type": "boolean",
            "description": [
              "If set to True, the invoice is not deleted, but has its description removed (this can save space with very large descriptions, as would be used with lightning-invoice(7) *deschashonly*."
            ]
          }
        }
      },
      "response": {
        "required": [
          "label",
          "payment_hash",
          "status",
          "created_index",
          "expires_at"
        ],
        "additionalProperties": true,
        "properties": {
          "label": {
            "type": "string",
            "description": [
              "Unique label given at creation time."
            ]
          },
          "bolt11": {
            "type": "string",
            "description": [
              "BOLT11 string."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "BOLT12 string."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount required to pay this invoice."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "Description used in the invoice."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "created_index": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "1-based index indicating order this invoice was created in."
            ]
          },
          "updated_index": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "1-based index indicating order this invoice was changed (only present if it has changed since creation)."
            ]
          },
          "status": {
            "type": "string",
            "description": [
              "State of invoice."
            ],
            "enum": [
              "paid",
              "expired",
              "unpaid"
            ]
          },
          "expires_at": {
            "type": "u64",
            "description": [
              "UNIX timestamp when invoice expires (or expired)."
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "required": [
                "bolt12"
              ]
            },
            "then": {
              "required": [],
              "additionalProperties": false,
              "properties": {
                "label": {},
                "bolt12": {},
                "status": {},
                "expires_at": {},
                "msatoshi": {},
                "amount_msat": {},
                "description": {},
                "payment_hash": {},
                "pay_index": {},
                "created_index": {},
                "updated_index": {},
                "amount_received_msat": {},
                "paid_at": {},
                "payment_preimage": {},
                "local_offer_id": {
                  "type": "hex",
                  "description": [
                    "Offer for which this invoice was created."
                  ]
                },
                "invreq_payer_note": {
                  "type": "string",
                  "description": [
                    "The optional *invreq_payer_note* from invoice_request which created this invoice."
                  ]
                }
              }
            },
            "else": {
              "required": [
                "bolt11"
              ],
              "additionalProperties": false,
              "properties": {
                "label": {},
                "bolt11": {},
                "status": {},
                "expires_at": {},
                "msatoshi": {},
                "amount_msat": {},
                "description": {},
                "payment_hash": {},
                "pay_index": {},
                "created_index": {},
                "updated_index": {},
                "amount_received_msat": {},
                "msatoshi_received": {},
                "paid_at": {},
                "payment_preimage": {}
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "paid"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "pay_index",
                "amount_received_msat",
                "paid_at",
                "payment_preimage"
              ],
              "properties": {
                "label": {},
                "bolt11": {},
                "bolt12": {},
                "status": {},
                "expires_at": {},
                "msatoshi": {},
                "amount_msat": {},
                "description": {},
                "payment_hash": {},
                "invreq_payer_note": {},
                "local_offer_id": {},
                "created_index": {},
                "updated_index": {},
                "pay_index": {
                  "type": "u64",
                  "description": [
                    "Unique index for this invoice payment."
                  ]
                },
                "amount_received_msat": {
                  "type": "msat",
                  "description": [
                    "How much was actually received."
                  ]
                },
                "paid_at": {
                  "type": "u64",
                  "description": [
                    "UNIX timestamp of when payment was received."
                  ]
                },
                "payment_preimage": {
                  "type": "secret",
                  "description": [
                    "SHA256 of this is the *payment_hash* offered in the invoice."
                  ]
                }
              }
            },
            "else": {
              "additionalProperties": false,
              "properties": {
                "label": {},
                "bolt11": {},
                "bolt12": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "description": {},
                "payment_hash": {},
                "expires_at": {},
                "created_index": {},
                "updated_index": {},
                "pay_index": {},
                "invreq_payer_note": {},
                "local_offer_id": {}
              }
            }
          }
        ],
        "pre_return_value_notes": [
          "Note: The return is the same as an object from lightning-listinvoices(7)."
        ]
      },
      "errors": [
        "The following errors may be reported:",
        "",
        "- -1: Database error.",
        "- 905: An invoice with that label does not exist.",
        "- 906: The invoice *status* does not match the parameter. An error object will be returned as error *data*, containing *current_status* and *expected_status* fields. This is most likely due to the *status* of the invoice changing just before this command is invoked.",
        "- 908: The invoice already has no description, and *desconly* was set."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listinvoices(7)",
        "lightning-waitinvoice(7)",
        "lightning-invoice(7)",
        "lightning-autoclean-status(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:delinvoice#1",
            "method": "delinvoice",
            "params": {
              "label": "lbl_l36",
              "status": "unpaid"
            }
          },
          "response": {
            "label": "lbl_l36",
            "bolt11": "lnbcrt222n1pnt3005720bolt113000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
            "payment_hash": "paymenthashdelinv10101010101010101010101010101010101010101010101",
            "amount_msat": 50000000,
            "status": "unpaid",
            "description": "l36 description",
            "expires_at": 1739000000,
            "created_index": 9
          }
        },
        {
          "request": {
            "id": "example:delinvoice#2",
            "method": "delinvoice",
            "params": {
              "label": "lbl_l37",
              "status": "paid",
              "desconly": true
            }
          },
          "response": {
            "label": "lbl_l37",
            "bolt11": "lnbcrt222n1pnt3005720bolt113000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
            "payment_hash": "paymenthashdelinv20202020202020202020202020202020202020202020202",
            "amount_msat": 50000000,
            "status": "paid",
            "pay_index": 9,
            "amount_received_msat": 50000000,
            "paid_at": 1738500000,
            "payment_preimage": "paymentpreimagedelinv01010101010101010101010101010101010101010101",
            "expires_at": 1739000000,
            "created_index": 10,
            "updated_index": 9
          }
        }
      ]
    },
    "delnetworkevent.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "delnetworkevent",
      "title": "Command for removing a listnetworkevents entry",
      "added": "v25.12",
      "description": [
        "The **delnetworkevent** RPC command removes a single event from **listnetworkevents**, using the uniquely-identifying *created_index*.",
        "",
        "This command is mainly used by the *autoclean* plugin (see lightningd-config(7)), as these database entries are only kept for your own analysis, removing them has no effect on the running of your node."
      ],
      "request": {
        "required": [
          "created_index"
        ],
        "additionalProperties": false,
        "properties": {
          "created_index": {
            "type": "u64",
            "description": [
              "The unique created_index of the entry.."
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "errors": [
        "The following errors may be reported:",
        "",
        "- 1402: The listnetworkevents specified does not exist."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-autoclean(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ]
    },
    "delpay.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "delpay",
      "title": "Command for removing a completed or failed payment",
      "description": [
        "The **delpay** RPC command deletes a payment with the given `payment_hash` if its status is either `complete` or `failed`. If *partid* and *groupid* are not specified, all payment parts with matchin status are deleted."
      ],
      "request": {
        "required": [
          "payment_hash",
          "status"
        ],
        "additionalProperties": false,
        "properties": {
          "payment_hash": {
            "type": "hash",
            "description": [
              "The unique identifier of a payment."
            ]
          },
          "status": {
            "type": "string",
            "description": [
              "Expected status of the payment. Only deletes if the payment status matches. Deleting a `pending` payment will return an error."
            ],
            "enum": [
              "complete",
              "failed"
            ]
          },
          "partid": {
            "type": "u64",
            "description": [
              "Specific partid to delete (must be paired with *groupid*)."
            ]
          },
          "groupid": {
            "type": "u64",
            "description": [
              "Specific groupid to delete (must be paired with *partid*)."
            ]
          }
        },
        "pairedWith": [
          [
            "partid",
            "groupid"
          ]
        ]
      },
      "response": {
        "required": [
          "payments"
        ],
        "additionalProperties": false,
        "properties": {
          "payments": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "created_index",
                "id",
                "payment_hash",
                "status",
                "amount_sent_msat",
                "created_at"
              ],
              "properties": {
                "created_index": {
                  "added": "v23.11",
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this payment was created in."
                  ]
                },
                "id": {
                  "type": "u64",
                  "description": [
                    "Old synonym for created_index."
                  ]
                },
                "payment_hash": {
                  "type": "hash",
                  "description": [
                    "The hash of the *payment_preimage* which will prove payment."
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "failed",
                    "complete"
                  ],
                  "description": [
                    "Status of the payment."
                  ]
                },
                "amount_sent_msat": {
                  "type": "msat",
                  "description": [
                    "The amount we actually sent, including fees."
                  ]
                },
                "partid": {
                  "type": "u64",
                  "description": [
                    "Unique ID within this (multi-part) payment."
                  ]
                },
                "destination": {
                  "type": "pubkey",
                  "description": [
                    "The final destination of the payment if known."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount the destination received, if known."
                  ]
                },
                "created_at": {
                  "type": "u64",
                  "description": [
                    "The UNIX timestamp showing when this payment was initiated."
                  ]
                },
                "updated_index": {
                  "added": "v23.11",
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this payment was changed (only present if it has changed since creation)."
                  ]
                },
                "completed_at": {
                  "type": "u64",
                  "description": [
                    "The UNIX timestamp showing when this payment was completed."
                  ]
                },
                "groupid": {
                  "type": "u64",
                  "description": [
                    "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
                  ]
                },
                "payment_preimage": {
                  "type": "secret",
                  "description": [
                    "Proof of payment."
                  ]
                },
                "label": {
                  "type": "string",
                  "description": [
                    "The label, if given to sendpay."
                  ]
                },
                "bolt11": {
                  "type": "string",
                  "description": [
                    "The bolt11 string (if pay supplied one)."
                  ]
                },
                "bolt12": {
                  "type": "string",
                  "description": [
                    "The bolt12 string (if supplied for pay)."
                  ]
                },
                "erroronion": {
                  "type": "hex",
                  "description": [
                    "The error onion returned on failure, if any."
                  ]
                }
              }
            }
          }
        },
        "pre_return_value_notes": [
          "The returned format is the same as lightning-listsendpays(7). If the payment is a multi-part payment (MPP) the command return a list of payments will be returned -- one payment object for each partid."
        ]
      },
      "errors": [
        "On failure, an error is returned. If the lightning process fails before responding, the",
        "caller should use lightning-listsentpays(7) or lightning-listpays(7) to query whether this payment was deleted or not.",
        "",
        "The following error codes may occur:",
        "",
        "- -32602: Parameter missed or malformed;",
        "- 211: Payment status mismatch. Check the correct status via **paystatus**;",
        "- 208: Payment with payment_hash not found."
      ],
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-listpays(7)",
        "lightning-listsendpays(7)",
        "lightning-paystatus(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:delpay#1",
            "method": "delpay",
            "params": {
              "payment_hash": "paymenthashdelpay10101010101010101010101010101010101010101010101",
              "status": "complete"
            }
          },
          "response": {
            "payments": [
              {
                "created_index": 1,
                "id": 1,
                "payment_hash": "paymenthashdelpay10101010101010101010101010101010101010101010101",
                "groupid": 1,
                "updated_index": 1,
                "destination": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "amount_msat": 500000000,
                "amount_sent_msat": 500000000,
                "created_at": 1738000000,
                "completed_at": 1738500000,
                "status": "complete",
                "payment_preimage": "paymentpreimgdp1010101010101010101010101010101010101010101010101",
                "bolt11": "lnbcrt222n1pnt3005720bolt114000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:delpay#2",
            "method": "delpay",
            "params": [
              "paymenthashdelpay20202020202020202020202020202020202020202020202",
              "failed"
            ]
          },
          "response": {
            "payments": [
              {
                "created_index": 23,
                "id": 23,
                "payment_hash": "paymenthashdelinv10101010101010101010101010101010101010101010101",
                "groupid": 1,
                "updated_index": 22,
                "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "amount_msat": 50000000,
                "amount_sent_msat": 50000501,
                "created_at": 1738000000,
                "completed_at": 1738500000,
                "status": "failed",
                "bolt11": "lnbcrt222n1pnt3005720bolt113000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:delpay#3",
            "method": "delpay",
            "params": {
              "payment_hash": "paymenthashdelpay30303030303030303030303030303030303030303030303",
              "status": "failed",
              "groupid": 1,
              "partid": 2
            }
          },
          "response": {
            "payments": [
              {
                "created_index": 20,
                "id": 20,
                "payment_hash": "paymenthashdelpay30303030303030303030303030303030303030303030303",
                "groupid": 1,
                "updated_index": 19,
                "partid": 2,
                "destination": "nodeid040404040404040404040404040404040404040404040404040404040404",
                "amount_msat": 1000000,
                "amount_sent_msat": 1000000,
                "created_at": 1738000000,
                "completed_at": 1738500000,
                "status": "failed"
              }
            ]
          }
        }
      ]
    },
    "deprecations.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v24.02",
      "rpc": "deprecations",
      "title": "Command to enable/disable deprecated APIs",
      "description": [
        "The **deprecations** RPC command is used to override global config option `allow-deprecated-apis` for further RPC commands on this same connection. This can be useful for developer testing to ensure you don't accidentally rely on deprecated features."
      ],
      "request": {
        "required": [
          "enable"
        ],
        "additionalProperties": false,
        "properties": {
          "enable": {
            "type": "boolean",
            "description": [
              "Flag to enable or disable deprecated APIs. Setting it to `false` will neither accept deprecated parameters or commands, nor output deprecated fields."
            ]
          }
        }
      },
      "response": {
        "additionalProperties": false,
        "properties": {}
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters."
      ],
      "author": [
        "Rusty Russell [rusty@blockstream.com](mailto:rusty@blockstream.com) wrote the initial version of this man page."
      ],
      "see_also": [
        "lightningd-config(5)",
        "lightning-notifications(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:deprecations#1",
            "method": "deprecations",
            "params": {
              "enable": true
            }
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:deprecations#2",
            "method": "deprecations",
            "params": {
              "enable": false
            }
          },
          "response": {}
        }
      ]
    },
    "dev-forget-channel.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "dev-forget-channel",
      "title": "Command to remove the DB entries from the database after a close",
      "warning": "For advanced users only",
      "description": [
        "Never use any `dev` command, including this one, unless you know exactly what you are doing; and have checked with a developer that your understanding is correct. They are meant only as a means of last resort and have the potential to mess things up. You have been warned\u2757\ufe0f",
        "",
        "The **dev-forget-channel** forgets the channel with given details. It will perform additional checks on whether it is safe to forget the channel, and only then remove the channel from the DB. Notice that this command is only available if CLN was started with --developer.",
        "",
        "Also see https://docs.corelightning.org/docs/faq#how-to-forget-about-a-channel"
      ],
      "request": {
        "required": [
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "The peer id of the channel to be forgotten. Checks if the channel is still active by checking its funding transaction."
            ]
          },
          "short_channel_id": {
            "type": "short_channel_id",
            "description": [
              "The short channel id of the channel you want to remove."
            ]
          },
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel id of the channel you want to remove."
            ]
          },
          "force": {
            "type": "boolean",
            "description": [
              "Ignores UTXO check for forced removal."
            ],
            "default": "False"
          }
        }
      },
      "response": {
        "required": [
          "forced",
          "funding_unspent",
          "funding_txid"
        ],
        "additionalProperties": false,
        "properties": {
          "forced": {
            "type": "boolean",
            "description": [
              "If the command was forced or not."
            ]
          },
          "funding_unspent": {
            "type": "boolean",
            "description": [
              "The funding is spent or not in the channel."
            ]
          },
          "funding_txid": {
            "type": "txid",
            "description": [
              "The id of the funding transaction."
            ]
          }
        }
      },
      "errors": [
        "The following errors may be reported:",
        "",
        "- -32602: If the given parameters are missing or wrong.",
        "- -1: Catch all nonspecific errors, eg. `Multiple channels: please specify short_channel_id.` OR `No channels matching that peer_id and that short_channel_id.`, etc."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-close(7)",
        "lightning-listchannels(7)",
        "lightning-listpeerchannels(7)",
        "lightning-listfunds(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "description": [
            "Forget a channel by peer pubkey when only one channel exists with the peer:"
          ],
          "request": {
            "id": "example:dev-forget-channel#1",
            "method": "dev-forget-channel",
            "params": {
              "id": "nodeid050505050505050505050505050505050505050505050505050505050505"
            }
          },
          "response": {
            "forced": false,
            "funding_unspent": false,
            "funding_txid": "fundingtxid00101010101010101010101010101010101010101010101010101"
          }
        },
        {
          "description": [
            "Forget a channel by short channel id when peer has multiple channels:"
          ],
          "request": {
            "id": "example:dev-forget-channel#2",
            "method": "dev-forget-channel",
            "params": {
              "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "short_channel_id": "111x1x1",
              "force": true
            }
          },
          "response": {
            "forced": true,
            "funding_unspent": false,
            "funding_txid": "fundingtxid00202020202020202020202020202020202020202020202020202"
          }
        }
      ]
    },
    "dev-splice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "added": "v24.11",
      "rpc": "dev-splice",
      "title": "Command to initiate a channel to a peer",
      "warning": "experimental-splicing only",
      "description": [
        "`splice` is the command to move funds into or out of a channel. Multiple actions can be combined together resulting in a single onchain transaction. Funds may be moved out of a channel and into another in a single batch enabling cross-channel movement."
      ],
      "request": {
        "required": [
          "script_or_json"
        ],
        "properties": {
          "script_or_json": {
            "type": "string",
            "description": [
              "The splice script to execute or json equivilent"
            ]
          },
          "dryrun": {
            "type": "boolean",
            "description": [
              "Don't execute any actions and output a transcript of what would have been done"
            ]
          },
          "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"
            ]
          },
          "debug_log": {
            "type": "boolean",
            "description": [
              "Adds a verbose log of each splice calculation step to the result"
            ]
          },
          "dev-wetrun": {
            "type": "boolean",
            "description": [
              "Executes the splice up until the point signatures would be sent and then aborts"
            ]
          }
        }
      },
      "response": {
        "required": [],
        "properties": {
          "dryrun": {
            "type": "array",
            "items": {
              "type": "string",
              "description": [
                "One action line of the splice script result"
              ]
            },
            "description": [
              "The transcript of what the script would have done"
            ]
          },
          "psbt": {
            "type": "string",
            "description": [
              "The final psbt"
            ]
          },
          "tx": {
            "type": "string",
            "description": [
              "The final transaction in hex"
            ]
          },
          "txid": {
            "type": "string",
            "description": [
              "The txid of the final transaction"
            ]
          },
          "log": {
            "type": "array",
            "description": [
              "A verbose log of each step of splice calcuations"
            ],
            "items": {
              "type": "string",
              "description": [
                "A line of detail about splice calcuations"
              ]
            }
          }
        }
      },
      "usage": [
        "The primary method is to make a `script` containing one or more splice actions",
        "that will be merged into a single transaction. If possible the entire operation",
        "will be completed and broadcast to the mempool.",
        "",
        "However if you specified your own inputs using `psbt`, then the command will",
        "return a psbt that you must sign and then pass to `splice_signed`.",
        "",
        "It is required to pass `script_or_json`.",
        "",
        "It is recommended you first do a `dryrun` to confirm your script does what you",
        "expect it to do.",
        "",
        "*script* The splice script to execute",
        "",
        "*dryrun* Don't execute any actions and output a transcript of what would have",
        "been done",
        "",
        "*psbt* An initial psbt to begin the splice with",
        "",
        "*user\\_provided\\_sats* The amount of sats being contributed by the initial psbt",
        "",
        "*force\\_feerate* 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 to true to skip this saftey check",
        "",
        "*json* A json payload of instructions can be passed instead of script",
        "",
        "*debug\\_log* Adds a verbose log of each splice calculation step to the result",
        "",
        "*dev-wetrun* Executes the splice up until the point signatures would be sent and then aborts",
        "",
        "The primary purpose of splice script is to execute all types of splices using",
        "a single command. You can perform all these actions manually using the lower",
        "level api (see `splice_init`) however this splice command interface is much simpler to use",
        "and it provides some security against signing maliciously inserted inputs.",
        "",
        "SCRIPT",
        "-----",
        "",
        "A splice script is a series of 'segments' that are separated by newlines or ",
        "semicolons. Each segment represents one splice action which is typically adding",
        "to or removing from a channel. The funds are designated as going into the",
        "channel or coming out of the channel by which side of an arrow \"->\" the channel",
        "identifier is placed on. The amount of funds is placed on the other side of the",
        "arrow.",
        "",
        "Take this example:",
        "```shell",
        "8338aef0 -> 10000sat",
        "```",
        "",
        "This is how we take 10,000 sats out of channel 8338aef0.",
        "",
        "To put 10,000 sats into the channel, we make the arrow point into the channel",
        "like so:",
        "```shell",
        "10000sat -> 8338aef0",
        "```",
        "",
        "In the last two examples we specified the first 8 digits of the channel",
        "identifier. You can specify as few as 4 digits of the beginning of the channel",
        "identifier and it will be autocompleted to the matching channel. If the code",
        "matches more than one channel or node id, the script will fail with an error.",
        "",
        "In order to put funds into a channel however, we need get the funds from",
        "somewhere. The simplest place to get them is the built in onchain wallet. The",
        "\"wallet\" operator can be placed just like channel identifiers. We can take funds",
        "out of the wallet like so:",
        "```shell",
        "wallet -> 10000sat",
        "```",
        "",
        "We can put funds back into the wallet like so:",
        "```shell",
        "10000sat -> wallet",
        "```",
        "",
        "Now that we know how to take funds out of a wallet, let's combine them into an",
        "individual script:",
        "```shell",
        "wallet -> 10000sat",
        "10000sat -> 8338aef0",
        "```",
        "",
        "The first line withdraws 10,000 sats from the wallet and puts them in the",
        "script's \"general script funds.\" The second line takes 10,000 sats from the",
        "\"general script funds\" and places them into channel 8338aef0. This example is",
        "called a \"splice in.\"",
        "",
        "In order for this script to work, we need one more thing. Onchain fees must be",
        "funded from somewhere. The simplest way to pay the fee from the \"general script",
        "funds.\" If we change the amount going into the channel to a percentage, the fee",
        "will automatically be taken from the \"general script funds\" like so:",
        "```shell",
        "wallet -> 10000sat",
        "100% -> 8338aef0",
        "```",
        "",
        "When specifying a percentage instead of an amount, it means take that percentage",
        "out of the \"general script fund.\"",
        "",
        "This will take 10,000 sats from the onchain wallet and put that amount less any",
        "onchain fees into channel 8338aef0. The feerate used will be the node's",
        "standard opening feerate. In order to use your own feerate you must us the fee",
        "operator.",
        "",
        "The fee operator is attached to an amount. If you want to take out extra to",
        "cover the fee, use \"+fee\" and if you want to reduce the amount being sent",
        "somewhere use the \"-fee\" suffix. Take this example:",
        "```shell",
        "wallet -> 10000sat+fee",
        "10000sat -> 8338aef0",
        "```",
        "",
        "In this example we add precisely 10,000 sats to channel 8338aef0 and withdraw",
        "enough from the wallet to cover the 10,000 sats and the onchain fee.",
        "",
        "To control the amount of fee, you can specify a fee-rate with the use of the at",
        "\"@\" symbol after fee. After the at symbol, specify a number of sats to pay per",
        "kiloweight (aka. perkw) like so:",
        "```shell",
        "wallet -> 10000sat+fee@300",
        "10000sat -> 8338aef0",
        "```",
        "",
        "This example pays a fee rate of 300 sats per thousand weight units. To view this",
        "amount in other units (ie. sats/vbyte) execute a `dryrun` of the script.",
        "",
        "Instead of withdrawing extra from the wallet, we can reduce the amount going to",
        "channel 8338aef0 using the \"-fee\" operator like so:",
        "```shell",
        "wallet -> 10000sat",
        "10000sat-fee -> 8338aef0",
        "```",
        "",
        "This example withdraws 10,000 sats from the onchain wallet, pays the onchain",
        "fee from that amount, and puts the rest into channel 8338aef0.",
        "",
        "You can also specify the feerate here like so:",
        "```shell",
        "wallet -> 10000sat",
        "10000sat-fee@300 -> 8338aef0",
        "```",
        "",
        "Now let's build a script that takes funds out of a channel and puts them into",
        "the onchain wallet:",
        "```shell",
        "8338aef0 -> 10000sat",
        "100% -> wallet",
        "```",
        "",
        "By default however, scripts that leave sats in the \"general script fund,\" will",
        "be automatically sent to the wallet. So the second line is not needed, we can",
        "simplify the script to:",
        "```shell",
        "8338aef0 -> 10000sat",
        "```",
        "",
        "We can can also move sats to a specific bitcoin address like so:",
        "```shell",
        "8338aef0 -> 10000sat+fee",
        "100% -> 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu",
        "```",
        "",
        "This example pays 10,000 sats to the address 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu",
        "out of your channel balance in 8338aef0.",
        "",
        "Percentages on the right side take out that amount of available funds from a",
        "channel. For example:",
        "```shell",
        "8338aef0 -> 100%",
        "```",
        "",
        "This takes all available funds out of channel 8338aef0 and puts them into the",
        "onchain wallet. Note that available funds is restricted by pending HTLCs and",
        "the 1% reserve requirement. To get all the funds you need to close the channel.",
        "More useful would be something like this:",
        "```shell",
        "8338aef0 -> 50%",
        "100% -> 07bfddea",
        "```",
        "",
        "This example takes half the available funds from channel 8338aef0 and puts them",
        "into channel 07bfddea.",
        "",
        "We can also split this amount like so:",
        "```shell",
        "8338aef0 -> 50%",
        "50% -> 07bfddea",
        "50% -> 09ad6278",
        "```",
        "",
        "This example takes half the funds in 8338aef0 and splits them between channels",
        "07bfddea and 09ad6278.",
        "",
        "If we want to send funds to more channels calculating percentages can get",
        "unwieldy so we can use the asterisk operator \"\\*\" which divides the \"general",
        "script funds\" amongst all destinations using it, like so:",
        "```shell",
        "8338aef0 -> 50%",
        "* -> 07bfddea",
        "* -> 09ad6278",
        "* -> efc2a7ff",
        "```",
        "",
        "This example takes half the available funds in 8338aef0 and splits them evenly",
        "among three achannels.",
        "",
        "Sats can be specified with multiple suffixes including sat, msat, btc, M, or K.",
        "The M suffix is shorthand for a million satoshis and the K suffix is shorthand",
        "for a thousand satoshis. These can be combined with a decimal point like so:",
        "```shell",
        "07bfddea -> 1.23M",
        "09ad6278 -> 900K",
        "efc2a7ff -> 0.01btc",
        "```",
        "",
        "This example takes 1,230,000 sats from 07bfddea, 900,000 sats from 09ad6278, and",
        "1,000,000 sats from efc2a7ff and puts them in the onchain wallet.",
        "",
        "Another way to specify channel ids is a channel query. These take the form of a",
        "node id, a colon, and a number or symbol (ie. \"034645dc:0\") which results in",
        "your first channel with the peer whose node id starts with 034645dc. Change the",
        "number after the colon to get a different index like so:",
        "```shell",
        "034645dc:0 -> 10K",
        "034645dc:1 -> 10K",
        "034645dc:2 -> 10K",
        "```",
        "",
        "This example takes 10,000 sats out of the first three channels with peer",
        "034645dc and puts the total minus fees into the onchain wallet.",
        "",
        "In addition to index numbers, the symbol after the colon can be a question mark",
        "\"?\" or an asterisk \"\\*\" which mean match the first unused channel or all the",
        "remaining channels respectively like so:",
        "```shell",
        "* -> 034645dc:?",
        "* -> 03e3d03e:0",
        "03e3d03e:* -> 100%",
        "```",
        "",
        "This example takes 100% of available funds from all of 03e3d03e's channels",
        "except the first one and splits them between 03e3d03e's first channel and",
        "034645dc's first channel.",
        "",
        "The node id prefix can also be replaced with the asterisk \"\\*\" which means match",
        "all nodes. This can be combined with the asterisk \"\\*\" that matches all unused",
        "channels like so:",
        "```shell",
        "wallet -> 10000sat",
        "100% -> *:*",
        "```",
        "",
        "This example takes 10,000 sats from the onchain wallet and divides them between",
        "all channels.",
        "",
        "It is possible to request a peer to add funds to a channel with a lease request.",
        "This is done using the pipe \"|\" symbol and optionally specifying the maximum fee",
        "you authorize using the at \"@\" symbol. After the pipe you specify the amount of",
        "sats you would like to lease, followed by the at symbol and a percentage value",
        "like so:",
        "```shell",
        "wallet -> 10M+fee",
        "100%|10M@1% -> 8338aef0",
        "```",
        "",
        "This example splices 10,000,000 sats into channel and requests your peer also",
        "add 10,000,000 sats to the channel. If they fee they demand is over 1% or the lease",
        "amount is too small the operation will be aborted. Whatever lease fee they do",
        "charge will come out of the 10,000,000 sats going into the channel balance. The",
        "onchain fee will be paid by taking extra funds out of the onchain wallet.",
        "",
        "Lease requests do not need to combined with splicing in funds but you must pay",
        "the onchain fee from somewhere. One simple location to take the fees from is",
        "your existing channel balance. Doing so requires using two arrows since funds",
        "are going into and out of the channel at the same time, like so:",
        "```shell",
        "|10M@1% -> 8338aef0 -> 0+fee",
        "```",
        "",
        "This example makes a lease request from your peer on 8338aef0 for 10,000,000",
        "sats and pays the onchain fee using the channel balance. This is a particularly",
        "elegant way to pay the onchain fee without adding any inputs or outputs beyond",
        "the channel funding itself.",
        "",
        "When passing via the command line using semicolons can be simpler instead of",
        "newlines. Here are some command line examples:",
        "",
        "Splice out 10 million satoshis to the onchain wallet",
        "```shell",
        "lightning-cli splice \"8338aef0 -> 10M\"",
        "```",
        "",
        "Splice in 10 thousand satoshis from the onchain wallet",
        "```shell",
        "lightning-cli splice \"wallet -> 10K; 100% -> 8338aef0\"",
        "```",
        "",
        "Send 900 thousand satoshis from a channel to an onchain address",
        "```shell",
        "lightning-cli splice \"8338aef0 -> 0.9M+fee; 0.9M -> 1JfbZRwdDHKZmuiZgYArJZhcuuzuw2HuMu\"",
        "```",
        "",
        "Move 1 bitcoin between two channels",
        "```shell",
        "lightning-cli splice \"8338aef0 -> 1btc; 100% -> 07bfddea\"",
        "```",
        "",
        "Splice in 100 thousand sats to the first channel with peer id 034645dc",
        "```shell",
        "lightning-cli splice \"wallet -> 0.1M; 100% -> 034645dc:?\"",
        "```",
        "",
        "Splice in 100 thousand sats split across *all* channels with peer id 034645dc",
        "```shell",
        "lightning-cli splice \"wallet -> 100000; 100% -> 034645dc:*\"",
        "```",
        "",
        "Take the maximum out of one chanel and split the value across peer 034645dc's",
        "channel plus one more channel",
        "```shell",
        "lightning-cli splice \"8338aef0 -> 100%; * -> 034645dc:*; * -> 07bfddea\"",
        "```"
      ],
      "author": [
        "Dusty [@dusty_daemon](mailto:@dustydaemon) is mainly responsible."
      ],
      "see_also": [
        "lightning-splice_signed(7)",
        "lightning-splice_update(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ]
    },
    "disableinvoicerequest.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v22.11",
      "rpc": "disableinvoicerequest",
      "title": "Command for removing an invoice request",
      "description": [
        "The **disableinvoicerequest** RPC command disables an invoice_request, so that no further invoices will be accepted (and thus, no further payments made)..",
        "",
        "We currently don't support deletion of invoice_requests, so they are not forgotten entirely (there may be payments which refer to this invoice_request)."
      ],
      "request": {
        "required": [
          "invreq_id"
        ],
        "additionalProperties": false,
        "properties": {
          "invreq_id": {
            "type": "string",
            "description": [
              "A specific invoice can be disabled by providing the `invreq_id`, which is presented by lightning-invoicerequest(7)."
            ]
          }
        }
      },
      "response": {
        "required": [
          "invreq_id",
          "single_use",
          "active",
          "bolt12",
          "used"
        ],
        "additionalProperties": false,
        "properties": {
          "invreq_id": {
            "type": "hash",
            "description": [
              "The SHA256 hash of all invoice_request fields less than 160."
            ]
          },
          "active": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": [
              "Whether the invoice_request is currently active."
            ]
          },
          "single_use": {
            "type": "boolean",
            "description": [
              "Whether the invoice_request will become inactive after we pay an invoice for it."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The bolt12 string starting with lnr."
            ]
          },
          "used": {
            "type": "boolean",
            "description": [
              "Whether the invoice_request has already been used."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "The label provided when creating the invoice_request."
            ]
          }
        },
        "pre_return_value_notes": [
          "Note: the returned object is the same format as **listinvoicerequests**."
        ]
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-invoicerequest(7)",
        "lightning-listinvoicerequests(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:disableinvoicerequest#1",
            "method": "disableinvoicerequest",
            "params": {
              "invreq_id": "invreqid02020202020202020202020202020202020202020202020202020202"
            }
          },
          "response": {
            "invreq_id": "invreqid02020202020202020202020202020202020202020202020202020202",
            "active": false,
            "single_use": true,
            "bolt12": "lno1qgsq000bolt240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000",
            "used": false
          }
        }
      ]
    },
    "disableoffer.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "disableoffer",
      "title": "Command for removing an offer",
      "description": [
        "The **disableoffer** RPC command disables an offer, so that no further invoices will be given out.",
        "",
        "We currently don't support deletion of offers, so offers are not forgotten entirely (there may be invoices which refer to this offer)."
      ],
      "request": {
        "required": [
          "offer_id"
        ],
        "additionalProperties": false,
        "properties": {
          "offer_id": {
            "type": "hash",
            "description": [
              "The id we use to identify this offer."
            ]
          }
        }
      },
      "response": {
        "required": [
          "offer_id",
          "active",
          "single_use",
          "bolt12",
          "used"
        ],
        "additionalProperties": false,
        "properties": {
          "offer_id": {
            "type": "hash",
            "description": [
              "The merkle hash of the offer."
            ]
          },
          "active": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": [
              "Whether the offer can produce invoices/payments."
            ]
          },
          "single_use": {
            "type": "boolean",
            "description": [
              "Whether the offer is disabled after first successful use."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The bolt12 string representing this offer."
            ]
          },
          "description": {
            "added": "v26.04",
            "type": "string",
            "description": [
              "The user-specified bolt 12 description."
            ]
          },
          "used": {
            "type": "boolean",
            "description": [
              "Whether the offer has had an invoice paid / payment made."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "The label provided when offer was created."
            ]
          }
        },
        "pre_return_value_notes": [
          "Note: the returned object is the same format as **listoffers**."
        ]
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-enableoffer(7)",
        "lightning-offer(7)",
        "lightning-listoffers(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:disableoffer#1",
            "method": "disableoffer",
            "params": {
              "offer_id": "offeridl23000002300000230000023000002300000230000023000002300000"
            }
          },
          "response": {
            "offer_id": "offeridl23000002300000230000023000002300000230000023000002300000",
            "active": false,
            "single_use": false,
            "bolt12": "lno1qgsq000bolt230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000",
            "description": "Movie ticket",
            "used": false
          }
        }
      ]
    },
    "disconnect.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "disconnect",
      "title": "Command for disconnecting from another lightning node",
      "description": [
        "The disconnect RPC command closes an existing connection to a peer, identified by *id*, in the Lightning Network, as long as it doesn't have an active channel."
      ],
      "request": {
        "required": [
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "The public key of the peer to terminate the connection. It can be discovered as peer_id in the output of the listpeerchannels command."
            ]
          },
          "force": {
            "type": "boolean",
            "description": [
              "If set to True, it will disconnect even with an active channel."
            ]
          }
        }
      },
      "response": {
        "additionalProperties": false,
        "properties": {}
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: Catchall nonspecific error."
      ],
      "author": [
        "Michael Hawkins [michael.hawkins@protonmail.com](mailto:michael.hawkins@protonmail.com)."
      ],
      "see_also": [
        "lightning-connect(7)",
        "lightning-listpeerchannels(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:disconnect#1",
            "method": "disconnect",
            "params": {
              "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
              "force": false
            }
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:disconnect#2",
            "method": "disconnect",
            "params": {
              "id": "nodeid050505050505050505050505050505050505050505050505050505050505",
              "force": true
            }
          },
          "response": {}
        }
      ]
    },
    "emergencyrecover.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "emergencyrecover",
      "title": "Command for recovering channels from the emergency.recovery file in the lightning directory",
      "description": [
        "The **emergencyrecover** RPC command fetches data from the emergency.recover file and tries to reconnect to the peer and force him to close the channel. The data in this file has enough information to reconnect and sweep the funds.",
        "",
        "This recovery method is not spontaneous and it depends on the peer, so it should be used as a last resort to recover the funds stored in a channel in case of severe data loss."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "response": {
        "required": [
          "stubs"
        ],
        "additionalProperties": false,
        "properties": {
          "stubs": {
            "type": "array",
            "items": {
              "type": "hash",
              "description": [
                "Channel IDs of channels successfully inserted."
              ]
            }
          }
        }
      },
      "author": [
        "Aditya [aditya.sharma20111@gmail.com](mailto:aditya.sharma20111@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-getsharedsecret(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:emergencyrecover#1",
            "method": "emergencyrecover",
            "params": {}
          },
          "response": {
            "stubs": []
          }
        },
        {
          "request": {
            "id": "example:emergencyrecover#2",
            "method": "emergencyrecover",
            "params": {}
          },
          "response": {
            "stubs": [
              "1267da6521b372d7c6407a74066f7a3a5bc3489bbda5eb9f0e990e1e913e2eb9",
              "e13472d6512413eb1bf03b9a0bb391d0e4152fd337fa6d1014e3de5e131918d9",
              "f8fc83a432cbfb2fffe222cc06727fdd977b5dd10ebd6707158e799e6f522d9f"
            ]
          }
        }
      ]
    },
    "enableoffer.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "enableoffer",
      "title": "Command for re-enabling an offer",
      "description": [
        "The **enableoffer** RPC command enables an offer, after it has been disabled."
      ],
      "request": {
        "required": [
          "offer_id"
        ],
        "additionalProperties": false,
        "properties": {
          "offer_id": {
            "type": "hash",
            "description": [
              "The id we use to identify this offer."
            ]
          }
        }
      },
      "response": {
        "required": [
          "offer_id",
          "active",
          "single_use",
          "bolt12",
          "used"
        ],
        "additionalProperties": false,
        "properties": {
          "offer_id": {
            "type": "hash",
            "description": [
              "The merkle hash of the offer."
            ]
          },
          "active": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": [
              "Whether the offer can produce invoices/payments."
            ]
          },
          "single_use": {
            "type": "boolean",
            "description": [
              "Whether the offer is disabled after first successful use."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The bolt12 string representing this offer."
            ]
          },
          "description": {
            "added": "v26.04",
            "type": "string",
            "description": [
              "The user-specified bolt 12 description."
            ]
          },
          "used": {
            "type": "boolean",
            "description": [
              "Whether the offer has had an invoice paid / payment made."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "The label provided when offer was created."
            ]
          }
        },
        "pre_return_value_notes": [
          "Note: the returned object is the same format as **listoffers**."
        ]
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters.",
        "- 1006: offer already enabled."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-offer(7)",
        "lightning-disableoffer(7)",
        "lightning-listoffers(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:enableoffer#1",
            "method": "enableoffer",
            "params": {
              "offer_id": "offeridl23000002300000230000023000002300000230000023000002300000"
            }
          },
          "response": {
            "offer_id": "offeridl23000002300000230000023000002300000230000023000002300000",
            "active": true,
            "single_use": false,
            "bolt12": "lno1qgsq000bolt230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000",
            "description": "Movie ticket",
            "used": false
          }
        }
      ]
    },
    "exposesecret.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "rpc": "exposesecret",
      "title": "Command for extracting the hsm_secret file for backup",
      "description": [
        "The **exposesecret** RPC command allows you to read the HSM secret, and does not work with encrypted hsm secrets.  It only operates if the `exposesecret-passphrase` has been set in the configuration."
      ],
      "request": {
        "required": [
          "passphrase"
        ],
        "properties": {
          "passphrase": {
            "type": "string",
            "description": [
              "The passphrase, which must match the `exposesecret-passphrase` configuration parameter."
            ]
          },
          "identifier": {
            "type": "string",
            "description": [
              "A four-character, valid lowercase bech32 string (not 1, i, o or b) to use in the resulting BIP-93 output.  If not specified, this is generated from the node alias."
            ]
          }
        }
      },
      "response": {
        "required": [
          "identifier",
          "codex32"
        ],
        "properties": {
          "identifier": {
            "type": "string",
            "description": [
              "The four-character identifier used in the codex32 output.  Redundant, but presented separately for clarity."
            ]
          },
          "codex32": {
            "type": "string",
            "description": [
              "The full codex32-encoded (i.e. BIP-93 encoded) HSM secret."
            ]
          },
          "mnemonic": {
            "type": "string",
            "added": "v25.12",
            "description": [
              "The BIP39 mnemonic phrase for the HSM secret (only present for mnemonic-based secrets)."
            ]
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-hsmtool(8)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:exposesecret#1",
            "method": "exposesecret",
            "params": {
              "passphrase": "test_exposesecret"
            }
          },
          "response": {
            "identifier": "luea",
            "codex32": "cl10lueasd35kw6r5de5kueedxyesqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqanvrktzhlhusz"
          }
        },
        {
          "request": {
            "id": "example:exposesecret#2",
            "method": "exposesecret",
            "params": [
              "test_exposesecret",
              "cln2"
            ]
          },
          "response": {
            "identifier": "cln2",
            "codex32": "cl10cln2sd35kw6r5de5kueedxyesqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqn9lcvcu7cez4s"
          }
        },
        {
          "request": {
            "id": "example:exposesecret#3",
            "method": "exposesecret",
            "params": {
              "passphrase": "test_exposesecret"
            }
          },
          "response": {
            "identifier": "peev",
            "codex32": "cl10peevst6cqh0wu7p5ssjyf4z4ez42ks9jlt3zneju9uuypr2hddak6tlqsjhsks4laxts8q",
            "mnemonic": "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"
          }
        }
      ]
    },
    "feerates.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "feerates",
      "title": "Command for querying recommended onchain feerates",
      "description": [
        "The **feerates** command returns the feerates that CLN will use. The feerates will be based on the recommended feerates from the backend. The backend may fail to provide estimates, but if it was able to provide estimates in the past, CLN will continue to use those for a while. CLN will also smoothen feerate estimations from the backend.",
        "",
        "Explorers often present fees in \"sat/vB\": 4 sat/vB is `4000perkb` or `1000perkw`.",
        "",
        "Bitcoin transactions have non-witness and witness bytes:",
        "",
        "* Non-witness bytes count as 4 weight, 1 virtual byte. All bytes other than SegWit witness count as non-witness bytes. * Witness bytes count as 1 weight, 0.25 virtual bytes.",
        "",
        "Thus, all *perkb* feerates will be exactly 4 times *perkw* feerates.",
        "",
        "To compute the fee for a transaction, multiply its weight or virtual bytes by the appropriate *perkw* or *perkw* feerate returned by this command, then divide by 1000.",
        "",
        "There is currently no way to change these feerates from the RPC. If you need custom control over onchain feerates, you will need to provide your own plugin that replaces the `bcli` plugin backend. For commands like lightning-withdraw(7) or lightning-fundchannel(7) you can provide a preferred feerate directly as a parameter, which will override the recommended feerates returned by **feerates**."
      ],
      "request": {
        "required": [
          "style"
        ],
        "additionalProperties": false,
        "properties": {
          "style": {
            "type": "string",
            "description": [
              "Fee rate style to use. This can be:",
              "    *perkw* - provide feerate in units of satoshis per 1000 weight (e.g. the minimum fee is usually `253perkw`).",
              "    *perkb* - provide feerate in units of satoshis per 1000 virtual bytes (eg. the minimum fee is usually `1000perkb`)."
            ],
            "enum": [
              "perkb",
              "perkw"
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "warning_missing_feerates": {
            "type": "string",
            "description": [
              "Some fee estimates are missing."
            ]
          },
          "perkb": {
            "type": "object",
            "description": [
              "If *style* parameter was perkb."
            ],
            "additionalProperties": false,
            "required": [
              "min_acceptable",
              "max_acceptable",
              "floor",
              "estimates"
            ],
            "properties": {
              "min_acceptable": {
                "type": "u32",
                "description": [
                  "The smallest feerate that we allow peers to specify: half the 100-block estimate."
                ]
              },
              "max_acceptable": {
                "type": "u32",
                "description": [
                  "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)."
                ]
              },
              "floor": {
                "type": "u32",
                "added": "v23.05",
                "description": [
                  "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)."
                ]
              },
              "estimates": {
                "type": "array",
                "added": "v23.05",
                "description": [
                  "Feerate estimates from plugin which we are using (usuallly bcli)."
                ],
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "blockcount",
                    "feerate",
                    "smoothed_feerate"
                  ],
                  "properties": {
                    "blockcount": {
                      "type": "u32",
                      "added": "v23.05",
                      "description": [
                        "The number of blocks the feerate is expected to get a transaction in."
                      ]
                    },
                    "feerate": {
                      "type": "u32",
                      "added": "v23.05",
                      "description": [
                        "The feerate for this estimate, in given *style*."
                      ]
                    },
                    "smoothed_feerate": {
                      "type": "u32",
                      "added": "v23.05",
                      "description": [
                        "The feerate, smoothed over time (useful for coordinating with other nodes)."
                      ]
                    }
                  }
                }
              },
              "opening": {
                "type": "u32",
                "description": [
                  "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)."
                ]
              },
              "mutual_close": {
                "type": "u32",
                "description": [
                  "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer."
                ]
              },
              "unilateral_close": {
                "type": "u32",
                "description": [
                  "Feerate for commitment_transaction in a live channel which we originally funded."
                ]
              },
              "unilateral_anchor_close": {
                "type": "u32",
                "added": "v23.08",
                "description": [
                  "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)."
                ]
              },
              "delayed_to_us": {
                "type": "u32",
                "deprecated": [
                  "v23.05",
                  "v24.05"
                ],
                "description": [
                  "Feerate for returning unilateral close funds to our wallet."
                ]
              },
              "htlc_resolution": {
                "type": "u32",
                "deprecated": [
                  "v23.05",
                  "v24.05"
                ],
                "description": [
                  "Feerate for returning unilateral close HTLC outputs to our wallet."
                ]
              },
              "penalty": {
                "type": "u32",
                "description": [
                  "Feerate to use when creating penalty tx for watchtowers."
                ]
              }
            }
          },
          "perkw": {
            "type": "object",
            "description": [
              "If *style* parameter was perkw."
            ],
            "additionalProperties": false,
            "required": [
              "min_acceptable",
              "max_acceptable",
              "floor",
              "estimates"
            ],
            "properties": {
              "min_acceptable": {
                "type": "u32",
                "description": [
                  "The smallest feerate that you can use, usually the minimum relayed feerate of the backend."
                ]
              },
              "max_acceptable": {
                "type": "u32",
                "description": [
                  "The largest feerate we will accept from remote negotiations. If a peer attempts to set the feerate higher than this we will unilaterally close the channel (or simply forget it if it's not open yet)."
                ]
              },
              "floor": {
                "type": "u32",
                "added": "v23.05",
                "description": [
                  "The smallest feerate that our backend tells us it will accept (i.e. minrelayfee or mempoolminfee)."
                ]
              },
              "estimates": {
                "type": "array",
                "added": "v23.05",
                "description": [
                  "Feerate estimates from plugin which we are using (usuallly bcli)."
                ],
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "blockcount",
                    "feerate",
                    "smoothed_feerate"
                  ],
                  "properties": {
                    "blockcount": {
                      "type": "u32",
                      "added": "v23.05",
                      "description": [
                        "The number of blocks the feerate is expected to get a transaction in."
                      ]
                    },
                    "feerate": {
                      "type": "u32",
                      "added": "v23.05",
                      "description": [
                        "The feerate for this estimate, in given *style*."
                      ]
                    },
                    "smoothed_feerate": {
                      "type": "u32",
                      "added": "v23.05",
                      "description": [
                        "The feerate, smoothed over time (useful for coordinating with other nodes)."
                      ]
                    }
                  }
                }
              },
              "opening": {
                "type": "u32",
                "description": [
                  "Default feerate for lightning-fundchannel(7) and lightning-withdraw(7)."
                ]
              },
              "mutual_close": {
                "type": "u32",
                "description": [
                  "Feerate to aim for in cooperative shutdown. Note that since mutual close is a **negotiation**, the actual feerate used in mutual close will be somewhere between this and the corresponding mutual close feerate of the peer."
                ]
              },
              "unilateral_close": {
                "type": "u32",
                "description": [
                  "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was not negotiated)."
                ]
              },
              "unilateral_anchor_close": {
                "type": "u32",
                "added": "v23.08",
                "description": [
                  "Feerate for commitment_transaction in a live channel which we originally funded (if anchor_outputs was negotiated)."
                ]
              },
              "delayed_to_us": {
                "type": "u32",
                "deprecated": [
                  "v23.05",
                  "v24.05"
                ],
                "description": [
                  "Feerate for returning unilateral close funds to our wallet."
                ]
              },
              "htlc_resolution": {
                "type": "u32",
                "deprecated": [
                  "v23.05",
                  "v24.05"
                ],
                "description": [
                  "Feerate for returning unilateral close HTLC outputs to our wallet."
                ]
              },
              "penalty": {
                "type": "u32",
                "description": [
                  "Feerate to use when creating penalty tx for watchtowers."
                ]
              }
            }
          },
          "onchain_fee_estimates": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "opening_channel_satoshis",
              "mutual_close_satoshis",
              "unilateral_close_satoshis",
              "htlc_timeout_satoshis",
              "htlc_success_satoshis"
            ],
            "properties": {
              "opening_channel_satoshis": {
                "type": "u64",
                "description": [
                  "Estimated cost of typical channel open."
                ]
              },
              "mutual_close_satoshis": {
                "type": "u64",
                "description": [
                  "Estimated cost of typical channel close."
                ]
              },
              "unilateral_close_satoshis": {
                "type": "u64",
                "description": [
                  "Estimated cost of typical unilateral close (without HTLCs). If anchors are supported, this assumes a channel with anchors."
                ]
              },
              "unilateral_close_nonanchor_satoshis": {
                "added": "v23.08",
                "type": "u64",
                "description": [
                  "Estimated cost of non-anchor typical unilateral close (without HTLCs)."
                ]
              },
              "htlc_timeout_satoshis": {
                "type": "u64",
                "description": [
                  "Estimated cost of typical HTLC timeout transaction (non-anchors)."
                ]
              },
              "htlc_success_satoshis": {
                "type": "u64",
                "description": [
                  "Estimated cost of typical HTLC fulfillment transaction (non-anchors)."
                ]
              }
            }
          }
        }
      },
      "errors": [
        "The **feerates** command will never error, however some fields may be missing in the result if feerate estimates for that kind of transaction are unavailable."
      ],
      "notes": [
        "Many other commands have a *feerate* parameter. This can be:",
        "",
        "* One of the strings to use lightningd's internal estimates:",
        "  * *urgent* (next 6 blocks or so)",
        "  * *normal* (next 12 blocks or so)",
        "  * *slow* (next 100 blocks or so)",
        "  * *minimum* for the lowest value bitcoind will currently accept (added in v23.05)",
        "",
        "* A number, with an optional suffix:",
        "  * *blocks* means aim for confirmation in that many blocks (added in v23.05)",
        "  * *perkw* means the number is interpreted as satoshi-per-kilosipa (weight)",
        "  * *perkb* means it is interpreted bitcoind-style as satoshi-per-kilobyte. ",
        "",
        "Omitting the suffix is equivalent to *perkb*."
      ],
      "trivia": [
        "In C-lightning we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"."
      ],
      "author": [
        "ZmnSCPxj [ZmnSCPxj@protonmail.com](mailto:ZmnSCPxj@protonmail.com) wrote the initial version of this manpage."
      ],
      "see_also": [
        "lightning-parsefeerate(7)",
        "lightning-fundchannel(7)",
        "lightning-withdraw(7)",
        "lightning-txprepare(7)",
        "lightning-fundchannel_start(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:feerates#1",
            "method": "feerates",
            "params": {
              "style": "perkw"
            }
          },
          "response": {
            "perkw": {
              "opening": 7500,
              "mutual_close": 3750,
              "unilateral_close": 11000,
              "unilateral_anchor_close": 3750,
              "penalty": 7500,
              "min_acceptable": 1875,
              "max_acceptable": 150000,
              "floor": 253,
              "estimates": [
                {
                  "blockcount": 2,
                  "feerate": 15000,
                  "smoothed_feerate": 15000
                },
                {
                  "blockcount": 6,
                  "feerate": 11000,
                  "smoothed_feerate": 11000
                },
                {
                  "blockcount": 12,
                  "feerate": 7500,
                  "smoothed_feerate": 7500
                },
                {
                  "blockcount": 100,
                  "feerate": 3750,
                  "smoothed_feerate": 3750
                }
              ]
            },
            "onchain_fee_estimates": {
              "opening_channel_satoshis": 5265,
              "mutual_close_satoshis": 2523,
              "unilateral_close_satoshis": 4170,
              "unilateral_close_nonanchor_satoshis": 6578,
              "htlc_timeout_satoshis": 7293,
              "htlc_success_satoshis": 7733
            }
          }
        },
        {
          "request": {
            "id": "example:feerates#2",
            "method": "feerates",
            "params": {
              "style": "perkb"
            }
          },
          "response": {
            "perkb": {
              "opening": 30000,
              "mutual_close": 15000,
              "unilateral_close": 44000,
              "unilateral_anchor_close": 15000,
              "penalty": 30000,
              "min_acceptable": 7500,
              "max_acceptable": 600000,
              "floor": 1012,
              "estimates": [
                {
                  "blockcount": 2,
                  "feerate": 60000,
                  "smoothed_feerate": 60000
                },
                {
                  "blockcount": 6,
                  "feerate": 44000,
                  "smoothed_feerate": 44000
                },
                {
                  "blockcount": 12,
                  "feerate": 30000,
                  "smoothed_feerate": 30000
                },
                {
                  "blockcount": 100,
                  "feerate": 15000,
                  "smoothed_feerate": 15000
                }
              ]
            },
            "onchain_fee_estimates": {
              "opening_channel_satoshis": 5265,
              "mutual_close_satoshis": 2523,
              "unilateral_close_satoshis": 4170,
              "unilateral_close_nonanchor_satoshis": 6578,
              "htlc_timeout_satoshis": 7293,
              "htlc_success_satoshis": 7733
            }
          }
        }
      ]
    },
    "fetchbip353.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v25.09",
      "rpc": "fetchbip353",
      "title": "Fetch BIP-353 payment instructions",
      "description": [
        "Fetches BIP-353 payment instructions and the DNSSEC proof."
      ],
      "request": {
        "additionalProperties": false,
        "properties": {
          "address": {
            "type": "string",
            "description": [
              "The BIP-353 address to fetch payment instructions for."
            ]
          }
        },
        "required": [
          "address"
        ]
      },
      "response": {
        "additionalProperties": false,
        "properties": {
          "proof": {
            "type": "string",
            "description": [
              "The hex-encoded DNSSEC proof for the BIP-353 address."
            ]
          },
          "instructions": {
            "type": "array",
            "description": [
              "A list of processed payment instruction objects. Each object either contains information about an onchain or an offchain payment. Both can have an optional amount for fixed amount payments aswell as an optional description provided by the recipient."
            ],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "description": {
                  "type": "string",
                  "description": [
                    "Optional description of the payment instruction."
                  ]
                },
                "offer": {
                  "type": "string",
                  "description": [
                    "An offer string for a bolt12 payment."
                  ]
                },
                "onchain": {
                  "type": "string",
                  "description": [
                    "A bitcoin onchain address."
                  ]
                },
                "offchain_amount_msat": {
                  "type": "u64",
                  "description": [
                    "Optional lightning payment amount in millisatoshis, present only if offer is specified."
                  ]
                },
                "onchain_amount_sat": {
                  "type": "u64",
                  "description": [
                    "Optional onchain payment amount in satoshis, present only if onchain is specified."
                  ]
                }
              }
            }
          }
        },
        "required": [
          "proof",
          "instructions"
        ]
      },
      "errors": [
        "On failure, the following error code may be returned:",
        "",
        "- -32700: Description of the error."
      ],
      "author": [
        "daywalker90 is mainly responsible."
      ],
      "examples": [
        {
          "description": [
            "Example of fetching BIP-353 payment details."
          ],
          "request": {
            "id": "example:fetchbip353#1",
            "method": "fetchbip353",
            "params": {
              "address": "send.some@satsto.me"
            }
          },
          "response": {
            "instructions": [
              {
                "onchain": "bc1qztwy6xen3zdtt7z0vrgapmjtfz8acjkfp5fp7l"
              },
              {
                "offer": "lno1zr5qyugqgskrk70kqmuq7v3dnr2fnmhukps9n8hut48vkqpqnskt2svsqwjakp7k6pyhtkuxw7y2kqmsxlwruhzqv0zsnhh9q3t9xhx39suc6qsr07ekm5esdyum0w66mnx8vdquwvp7dp5jp7j3v5cp6aj0w329fnkqqv60q96sz5nkrc5r95qffx002q53tqdk8x9m2tmt85jtpmcycvfnrpx3lr45h2g7na3sec7xguctfzzcm8jjqtj5ya27te60j03vpt0vq9tm2n9yxl2hngfnmygesa25s4u4zlxewqpvp94xt7rur4rhxunwkthk9vly3lm5hh0pqv4aymcqejlgssnlpzwlggykkajp7yjs5jvr2agkyypcdlj280cy46jpynsezrcj2kwa2lyr8xvd6lfkph4xrxtk2xc3lpq"
              }
            ],
            "proof": "0473656e64proof00001proof00001proof00001proof00001proof00001proof00001proof00001proof00001proof00001proof00001"
          }
        }
      ]
    },
    "fetchinvoice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "fetchinvoice",
      "title": "Command for fetch an invoice for an offer",
      "description": [
        "The **fetchinvoice** RPC command contacts the issuer of an *offer* to get an actual invoice that can be paid. It highlights any changes between the offer and the returned invoice.",
        "",
        "If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`."
      ],
      "request": {
        "required": [
          "offer"
        ],
        "additionalProperties": false,
        "properties": {
          "offer": {
            "type": "string",
            "description": [
              "Offer string to get an actual invoice that can be paid."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Required if the offer does not specify an amount at all, otherwise it is optional (but presumably if you set it to less than the offer, you will get an error from the issuer)."
            ]
          },
          "quantity": {
            "type": "u64",
            "description": [
              "Required if the offer specifies quantity_max, otherwise it is not allowed."
            ]
          },
          "recurrence_counter": {
            "type": "u64",
            "description": [
              "Required if the offer specifies recurrence, otherwise it is not allowed. recurrence_counter should first be set to 0, and incremented for each successive invoice in a given series."
            ]
          },
          "recurrence_start": {
            "type": "number",
            "description": [
              "Indicates what period number to start at (usually 0)."
            ]
          },
          "recurrence_label": {
            "type": "string",
            "description": [
              "Required if recurrence_counter is set, and otherwise is not allowed. It must be the same as prior fetchinvoice calls for the same recurrence, as it is used to link them together."
            ]
          },
          "timeout": {
            "type": "number",
            "description": [
              "If we don't get a reply before this we fail (default, 60 seconds)."
            ]
          },
          "payer_note": {
            "type": "string",
            "description": [
              "To ask the issuer to include in the fetched invoice."
            ]
          },
          "payer_metadata": {
            "type": "string",
            "description": [
              "Derive the payer_id from the specified payer_metadata. Please be sure that `payer_metdata` can not be derived by anyone, so put some secret into it."
            ],
            "added": "v24.11"
          },
          "bip353": {
            "type": "string",
            "description": [
              "BIP353 string (optionally with \u20bf) indicating where we fetched the offer from"
            ],
            "added": "v25.02"
          },
          "dev_reply_path": {
            "hidden": true
          },
          "dev_path_use_scidd": {
            "hidden": true
          }
        }
      },
      "response": {
        "required": [
          "invoice",
          "changes"
        ],
        "additionalProperties": false,
        "properties": {
          "invoice": {
            "type": "string",
            "description": [
              "The BOLT12 invoice we fetched."
            ]
          },
          "changes": {
            "type": "object",
            "description": [
              "Summary of changes from offer."
            ],
            "additionalProperties": false,
            "required": [],
            "properties": {
              "description_appended": {
                "type": "string",
                "description": [
                  "Extra characters appended to the *description* field."
                ]
              },
              "description": {
                "type": "string",
                "description": [
                  "A completely replaced *description* field."
                ]
              },
              "vendor_removed": {
                "type": "string",
                "description": [
                  "The *vendor* from the offer, which is missing in the invoice."
                ]
              },
              "vendor": {
                "type": "string",
                "description": [
                  "A completely replaced *vendor* field."
                ]
              },
              "amount_msat": {
                "type": "msat",
                "description": [
                  "The amount, if different from the offer amount multiplied by any *quantity* (or the offer had no amount, or was not in BTC)."
                ]
              }
            }
          },
          "next_period": {
            "type": "object",
            "description": [
              "Only for recurring invoices if the next period is under the *recurrence_limit*."
            ],
            "additionalProperties": false,
            "required": [
              "counter",
              "starttime",
              "endtime",
              "paywindow_start",
              "paywindow_end"
            ],
            "properties": {
              "counter": {
                "type": "u64",
                "description": [
                  "The index of the next period to fetchinvoice."
                ]
              },
              "starttime": {
                "type": "u64",
                "description": [
                  "UNIX timestamp that the next period starts."
                ]
              },
              "endtime": {
                "type": "u64",
                "description": [
                  "UNIX timestamp that the next period ends."
                ]
              },
              "paywindow_start": {
                "type": "u64",
                "description": [
                  "UNIX timestamp of the earliest time that the next invoice can be fetched."
                ]
              },
              "paywindow_end": {
                "type": "u64",
                "description": [
                  "UNIX timestamp of the latest time that the next invoice can be fetched."
                ]
              }
            }
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error.",
        "- 1002: Offer has expired.",
        "- 1003: Cannot find a route to the node making the offer.",
        "- 1004: The node making the offer returned an error message.",
        "- 1005: We timed out trying to fetch an invoice."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-sendinvoice(7)",
        "lightning-pay(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:fetchinvoice#1",
            "method": "fetchinvoice",
            "params": {
              "offer": "lno1qgsq000bolt210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000",
              "payer_note": "Thanks for the fish!"
            }
          },
          "response": {
            "invoice": "lni1qqg0qe01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
            "changes": {}
          }
        },
        {
          "request": {
            "id": "example:fetchinvoice#2",
            "method": "fetchinvoice",
            "params": {
              "offer": "lno1qgsq000bolt220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000",
              "amount_msat": 2000000,
              "quantity": 2
            }
          },
          "response": {
            "invoice": "lni1qqg0qe02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202",
            "changes": {}
          }
        }
      ]
    },
    "fundchannel.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "fundchannel",
      "title": "Command for establishing a lightning channel",
      "description": [
        "The **fundchannel** RPC command opens a payment channel with a peer by committing a funding transaction to the blockchain as defined in BOLT #2.",
        "",
        "If not already connected, **fundchannel** will automatically attempt to connect if Core Lightning knows a way to contact the node (either from normal gossip, or from a previous **connect** call).",
        "",
        "This auto-connection can fail if Core Lightning does not know how to contact the target node; see lightning-connect(7).",
        "",
        "Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel."
      ],
      "request": {
        "required": [
          "id",
          "amount"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "Id is the peer id obtained from connect."
            ]
          },
          "amount": {
            "type": "sat_or_all",
            "description": [
              "The amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency- msat` as change). The string *all* can be used to specify all available funds (may be restricted by the `utxos` parameter, and limited to 16777215 satoshi if large channels were not negotiated with the peer). Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently set to 546, nor more than 16777215 satoshi (unless large channels were negotiated with the peer)."
            ]
          },
          "feerate": {
            "type": "feerate",
            "description": [
              "Used for the opening transaction and (unless *option_anchors* is negotiated), as initial feerate for commitment and HTLC transactions (see NOTES in lightning-feerates(7))."
            ],
            "default": "*normal*"
          },
          "announce": {
            "type": "boolean",
            "description": [
              "Whether to announce this channel or not. An unannounced channel is considered private."
            ],
            "default": "True"
          },
          "minconf": {
            "type": "u32",
            "description": [
              "The minimum number of confirmations that used outputs should have."
            ],
            "default": "1"
          },
          "push_msat": {
            "type": "msat",
            "description": [
              "The amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed."
            ]
          },
          "close_to": {
            "type": "string",
            "description": [
              "A Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated."
            ]
          },
          "request_amt": {
            "type": "sat",
            "description": [
              "An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*."
            ]
          },
          "compact_lease": {
            "type": "string",
            "description": [
              "A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel."
            ]
          },
          "utxos": {
            "type": "array",
            "description": [
              "The utxos to be used to fund the channel, as an array of `txid:vout`."
            ],
            "items": {
              "type": "outpoint"
            }
          },
          "mindepth": {
            "description": [
              "Number of confirmations required before we consider the channel active."
            ],
            "type": "u32"
          },
          "reserve": {
            "type": "sat",
            "description": [
              "The amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*."
            ],
            "default": "1% of the funding amount"
          },
          "channel_type": {
            "added": "v24.02",
            "type": "array",
            "items": {
              "type": "u32",
              "description": [
                "Represents the explicit channel type to request. There is currently no sanity checking on this value so if you use strange values and your channel breaks, you get to keep both pieces. BOLT 2 defines the following value types:",
                "```",
                "The currently defined basic types are:",
                "  - `option_static_remotekey` (bit 12).",
                "  - `option_anchors` and `option_static_remotekey` (bits 22 and 12).",
                "",
                "Each basic type has the following variations allowed:",
                "  - `option_scid_alias` (bit 46).",
                "  - `option_zeroconf` (bit 50).",
                "```"
              ]
            }
          }
        }
      },
      "response": {
        "required": [
          "tx",
          "txid",
          "outnum",
          "channel_type",
          "channel_id"
        ],
        "additionalProperties": false,
        "properties": {
          "tx": {
            "type": "hex",
            "description": [
              "The raw transaction which funded the channel."
            ]
          },
          "txid": {
            "type": "txid",
            "description": [
              "The txid of the transaction which funded the channel."
            ]
          },
          "outnum": {
            "type": "u32",
            "description": [
              "The 0-based output index showing which output funded the channel."
            ]
          },
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel_id of the resulting channel."
            ]
          },
          "channel_type": {
            "type": "object",
            "description": [
              "Channel_type as negotiated with peer."
            ],
            "added": "v24.02",
            "additionalProperties": false,
            "required": [
              "bits",
              "names"
            ],
            "properties": {
              "bits": {
                "type": "array",
                "description": [
                  "Each bit set in this channel_type."
                ],
                "added": "v24.02",
                "items": {
                  "type": "u32",
                  "description": [
                    "Bit number."
                  ]
                }
              },
              "names": {
                "type": "array",
                "description": [
                  "Feature name for each bit set in this channel_type. Note that *anchors_zero_fee_htlc_tx* is a deprecated synonym for *anchors*."
                ],
                "added": "v24.02",
                "items": {
                  "type": "string",
                  "enum": [
                    "static_remotekey/even",
                    "anchor_outputs/even",
                    "anchors_zero_fee_htlc_tx/even",
                    "anchors/even",
                    "scid_alias/even",
                    "zeroconf/even"
                  ],
                  "description": [
                    "Name of feature bit."
                  ]
                }
              }
            }
          },
          "close_to": {
            "type": "hex",
            "description": [
              "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`."
            ]
          },
          "mindepth": {
            "type": "u32",
            "description": [
              "Number of confirmations before we consider the channel active."
            ]
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error.",
        "- 300: The maximum allowed funding amount is exceeded.",
        "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.",
        "- 302: The output amount is too small, and would be considered dust.",
        "- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.",
        "- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).",
        "",
        "Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.)."
      ],
      "see_also": [
        "lightning-connect(7)",
        "lightning-listfunds()",
        "lightning-listpeers(7)",
        "lightning-feerates(7)",
        "lightning-multifundchannel(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:fundchannel#1",
            "method": "fundchannel",
            "params": {
              "id": "nodeid050505050505050505050505050505050505050505050505050505050505",
              "amount": 1000000,
              "announce": true
            }
          },
          "response": {
            "tx": "020000000000305fundchanneltx350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000350003500035000",
            "txid": "channeltxid350000350000350000350000350000350000350000350000350000",
            "channel_id": "channelid0350000350000350000350000350000350000350000350000350000",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "outnum": 1
          }
        },
        {
          "description": [
            "This example shows how to to open new channel with peer 1 from one whole utxo (you can use **listfunds** command to get txid and vout):"
          ],
          "request": {
            "id": "example:fundchannel#2",
            "method": "fundchannel",
            "params": {
              "id": "nodeid010101010101010101010101010101010101010101010101010101010101",
              "amount": "all",
              "feerate": "normal",
              "push_msat": 100000,
              "utxos": [
                "channeltxid350000350000350000350000350000350000350000350000350000:1"
              ]
            }
          },
          "response": {
            "tx": "020000000000401fundchanneltx410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000410004100041000",
            "txid": "channeltxid410000410000410000410000410000410000410000410000410000",
            "channel_id": "channelid0410000410000410000410000410000410000410000410000410000",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "outnum": 1
          }
        }
      ]
    },
    "fundchannel_cancel.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "fundchannel_cancel",
      "title": "Command for completing channel establishment",
      "description": [
        "`fundchannel_cancel` is a lower level RPC command. It allows channel opener to cancel a channel before funding broadcast with a connected peer.",
        "",
        "Note that the funding transaction MUST NOT be broadcast before `fundchannel_cancel`. Broadcasting transaction before `fundchannel_cancel` WILL lead to unrecoverable loss of funds.",
        "",
        "If `fundchannel_cancel` is called after `fundchannel_complete`, the remote peer may disconnect when command succeeds. In this case, user need to connect to remote peer again before opening channel."
      ],
      "request": {
        "required": [
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "Node id of the remote peer with which to cancel."
            ]
          }
        }
      },
      "response": {
        "required": [
          "cancelled"
        ],
        "additionalProperties": false,
        "properties": {
          "cancelled": {
            "type": "string",
            "description": [
              "A message indicating it was cancelled by RPC."
            ]
          }
        }
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- 306: Unknown peer id.",
        "- 307: No channel currently being funded that can be cancelled.",
        "- 308: It is unsafe to cancel the channel: the funding transaction has been broadcast, or there are HTLCs already in the channel, or the peer was the initiator and not us."
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-connect(7)",
        "lightning-fundchannel(7)",
        "lightning-multifundchannel(7)",
        "lightning-fundchannel_start(7)",
        "lightning-fundchannel_complete(7)",
        "lightning-openchannel_init(7)",
        "lightning-openchannel_update(7)",
        "lightning-openchannel_signed(7)",
        "lightning-openchannel_abort(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:fundchannel_cancel#1",
            "method": "fundchannel_cancel",
            "params": [
              "nodeid101010101010101010101010101010101010101010101010101010101010"
            ]
          },
          "response": {
            "cancelled": "Channel open canceled by RPC"
          }
        },
        {
          "request": {
            "id": "example:fundchannel_cancel#2",
            "method": "fundchannel_cancel",
            "params": {
              "id": "nodeid101010101010101010101010101010101010101010101010101010101010"
            }
          },
          "response": {
            "cancelled": "Channel open canceled by RPC"
          }
        }
      ]
    },
    "fundchannel_complete.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "fundchannel_complete",
      "title": "Command for completing channel establishment",
      "description": [
        "`fundchannel_complete` is a lower level RPC command. It allows a user to complete an initiated channel establishment with a connected peer.",
        "",
        "Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed, as the commitment transactions for this channel are not secured until this command successfully completes. Broadcasting transaction before can lead to unrecoverable loss of funds."
      ],
      "request": {
        "required": [
          "id",
          "psbt"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "Node id of the remote peer."
            ]
          },
          "psbt": {
            "type": "string",
            "description": [
              "Transaction to use for funding (does not need to be signed but must be otherwise complete)."
            ]
          },
          "withhold": {
            "type": "boolean",
            "added": "v25.12",
            "description": [
              "Mark this channel 'withheld' so we know we haven't broadcast the funding transaction.  If the channel is closed before we call `sendpsbt` on this psbt, it will simply be closed immediately."
            ]
          }
        }
      },
      "response": {
        "required": [
          "channel_id",
          "commitments_secured"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel_id of the resulting channel."
            ]
          },
          "commitments_secured": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": [
              "Indication that channel is safe to use."
            ]
          }
        }
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: Catchall nonspecific error.",
        "- 305: Peer is not connected.",
        "- 306: Unknown peer id.",
        "- 309: PSBT does not have a unique, correct output to fund the channel."
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-connect(7)",
        "lightning-fundchannel(7)",
        "lightning-multifundchannel(7)",
        "lightning-fundchannel_start(7)",
        "lightning-fundchannel_cancel(7)",
        "lightning-openchannel_init(7)",
        "lightning-openchannel_update(7)",
        "lightning-openchannel_signed(7)",
        "lightning-openchannel_bump(7)",
        "lightning-openchannel_abort(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:fundchannel_complete#1",
            "method": "fundchannel_complete",
            "params": [
              "nodeid101010101010101010101010101010101010101010101010101010101010",
              "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000"
            ]
          },
          "response": {
            "channel_id": "channelid0910109101091010910109101091010910109101091010910109101",
            "commitments_secured": true
          }
        },
        {
          "request": {
            "id": "example:fundchannel_complete#2",
            "method": "fundchannel_complete",
            "params": {
              "id": "nodeid101010101010101010101010101010101010101010101010101010101010",
              "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000401000"
            }
          },
          "response": {
            "channel_id": "channelid0910209102091020910209102091020910209102091020910209102",
            "commitments_secured": true
          }
        }
      ]
    },
    "fundchannel_start.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "fundchannel_start",
      "title": "Command for initiating channel establishment for a lightning channel",
      "description": [
        "`fundchannel_start` is a lower level RPC command. It allows a user to initiate channel establishment with a connected peer.",
        "",
        "Note that the funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`, as the commitment transactions for this channel are not secured until the complete command succeeds. Broadcasting transaction before that can lead to unrecoverable loss of funds."
      ],
      "request": {
        "required": [
          "id",
          "amount"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "The peer id obtained from connect."
            ]
          },
          "amount": {
            "type": "sat",
            "description": [
              "Satoshi value that the channel will be funded at. This value MUST be accurate, otherwise the negotiated commitment transactions will not encompass the correct channel value."
            ]
          },
          "feerate": {
            "type": "feerate",
            "description": [
              "Feerate for subsequent commitment transactions: see **fundchannel**. Note that this is ignored for channels with *option_anchors* (we always use a low commitment fee for these)."
            ]
          },
          "announce": {
            "type": "boolean",
            "description": [
              "Whether or not to announce this channel."
            ]
          },
          "close_to": {
            "type": "string",
            "description": [
              "Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`. Returns `close_to` set to closing script iff is negotiated."
            ]
          },
          "push_msat": {
            "type": "msat",
            "description": [
              "Amount of millisatoshis to push to the channel peer at open. Note that this is a gift to the peer -- these satoshis are added to the initial balance of the peer at channel start and are largely unrecoverable once pushed."
            ]
          },
          "mindepth": {
            "type": "u32",
            "description": [
              "Number of confirmations required before we consider the channel active."
            ]
          },
          "reserve": {
            "type": "sat",
            "description": [
              "The amount we want the peer to maintain on its side."
            ]
          },
          "channel_type": {
            "type": "array",
            "description": [
              "Each bit set in this channel_type."
            ],
            "items": {
              "type": "u32",
              "description": [
                "Bit number."
              ]
            }
          }
        },
        "pairedWith": [
          [
            "feerate",
            "announce",
            "close_to",
            "push_msat",
            "channel_type",
            "mindepth",
            "reserve"
          ]
        ]
      },
      "response": {
        "required": [
          "funding_address",
          "scriptpubkey",
          "warning_usage"
        ],
        "additionalProperties": false,
        "properties": {
          "funding_address": {
            "type": "string",
            "description": [
              "The address to send funding to for the channel. DO NOT SEND COINS TO THIS ADDRESS YET."
            ]
          },
          "scriptpubkey": {
            "type": "hex",
            "description": [
              "The raw scriptPubkey for the address."
            ]
          },
          "channel_type": {
            "type": "object",
            "description": [
              "Channel_type as negotiated with peer."
            ],
            "added": "v24.02",
            "additionalProperties": false,
            "required": [
              "bits",
              "names"
            ],
            "properties": {
              "bits": {
                "type": "array",
                "added": "v24.02",
                "description": [
                  "Each bit set in this channel_type."
                ],
                "items": {
                  "type": "u32",
                  "description": [
                    "Bit number."
                  ]
                }
              },
              "names": {
                "type": "array",
                "description": [
                  "Feature name for each bit set in this channel_type. Note that *anchors_zero_fee_htlc_tx* is a deprecated synonym for *anchors*."
                ],
                "added": "v24.02",
                "items": {
                  "type": "string",
                  "enum": [
                    "static_remotekey/even",
                    "anchor_outputs/even",
                    "anchors_zero_fee_htlc_tx/even",
                    "anchors/even",
                    "scid_alias/even",
                    "zeroconf/even"
                  ],
                  "description": [
                    "Name of feature bit."
                  ]
                }
              }
            }
          },
          "close_to": {
            "type": "hex",
            "description": [
              "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`."
            ]
          },
          "warning_usage": {
            "type": "string",
            "description": [
              "A warning not to prematurely broadcast the funding transaction (always present!)."
            ]
          },
          "mindepth": {
            "type": "u32",
            "description": [
              "Number of confirmations before we consider the channel active."
            ]
          }
        }
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: Catchall nonspecific error.",
        "- 300: The amount exceeded the maximum configured funding amount.",
        "- 301: The provided `push_msat` is greater than the provided `amount`.",
        "- 304: Still syncing with bitcoin network",
        "- 305: Peer is not connected.",
        "- 306: Unknown peer id.",
        "- 312: Peer negotiated `option_dual_fund`, must use `openchannel_init` not `fundchannel_start`. (Only if ``experimental-dual-fund` is enabled)"
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-connect(7)",
        "lightning-fundchannel(7)",
        "lightning-multifundchannel(7)",
        "lightning-fundchannel_complete(7)",
        "lightning-fundchannel_cancel(7)",
        "lightning-openchannel_init(7)",
        "lightning-openchannel_update(7)",
        "lightning-openchannel_signed(7)",
        "lightning-openchannel_bump(7)",
        "lightning-openchannel_abort(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:fundchannel_start#1",
            "method": "fundchannel_start",
            "params": [
              "nodeid101010101010101010101010101010101010101010101010101010101010",
              16777216
            ]
          },
          "response": {
            "funding_address": "bcrt1p0002020202020202020202020202020202020202020202020202020202",
            "scriptpubkey": "scriptpubkey01010101010101010101010101010101010101010101010101010101",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`"
          }
        },
        {
          "request": {
            "id": "example:fundchannel_start#2",
            "method": "fundchannel_start",
            "params": {
              "id": "nodeid101010101010101010101010101010101010101010101010101010101010",
              "amount": 16777216
            }
          },
          "response": {
            "funding_address": "bcrt1p0003030303030303030303030303030303030303030303030303030303",
            "scriptpubkey": "scriptpubkey02020202020202020202020202020202020202020202020202020202",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "warning_usage": "The funding transaction MUST NOT be broadcast until after channel establishment has been successfully completed by running `fundchannel_complete`"
          }
        }
      ]
    },
    "funderupdate.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "funderupdate",
      "title": "Command for adjusting node funding v2 channels",
      "description": [
        "NOTE: Must have --experimental-dual-fund enabled for these settings to take effect.",
        "",
        "For channel open requests using dual funding.",
        "",
        "Note: to maximize channel leases, best policy setting is (match, 100).",
        "",
        "Setting any of the 5 options from *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat* and, *channel_fee_max_proportional_thousandths* will activate channel leases for this node, and advertise these values via the lightning gossip network. If any one is set, the other values will be the default."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "policy": {
            "type": "string",
            "enum": [
              "match",
              "available",
              "fixed"
            ],
            "description": [
              "Funder plugin will use to decide how much capital to commit to a v2 open channel request.",
              "There are three policy options, detailed below:",
              "    * `match` -- Contribute *policy_mod* percent of their requested funds. Valid *policy_mod* values are 0 to 200. If this is a channel lease request, we match based on their requested funds. If it is not a channel lease request (and *lease_only* is false), then we match their funding amount. Note: any lease match less than 100 will likely fail, as clients will not accept a lease less than their request.",
              "    * `available` -- Contribute *policy_mod* percent of our available node wallet funds. Valid *policy_mod* values are 0 to 100.",
              "    * `fixed` -- Contributes a fixed  *policy_mod* sats to v2 channel open requests."
            ],
            "default": "fixed"
          },
          "policy_mod": {
            "type": "msat",
            "description": [
              "Number or 'modification' to apply to the policy."
            ],
            "default": "0sats"
          },
          "leases_only": {
            "type": "boolean",
            "description": [
              "Only contribute funds to `option_will_fund` requests which pay to lease funds. It will fund any v2 open request using *policy* even if it's they're not seeking to lease funds. Note that `option_will_fund` commits funds for 4032 blocks (~1mo). Must also set *lease_fee_base_msat*, *lease_fee_basis*, *funding_weight*, *channel_fee_max_base_msat*, and *channel_fee_max_proportional_thousandths* to advertise available channel leases."
            ],
            "default": "False"
          },
          "min_their_funding_msat": {
            "type": "msat",
            "description": [
              "Minimum funding sats that we require in order to activate our contribution policy to the v2 open."
            ],
            "default": "10k sats"
          },
          "max_their_funding_msat": {
            "type": "msat",
            "description": [
              "Maximum funding sats that we will consider to activate our contribution policy to the v2 open. Any channel open above this will not be funded."
            ],
            "default": "no max (`UINT_MAX`)"
          },
          "per_channel_min_msat": {
            "type": "msat",
            "description": [
              "Minimum amount that we will contribute to a channel open."
            ],
            "default": "10k sats"
          },
          "per_channel_max_msat": {
            "type": "msat",
            "description": [
              "Maximum amount that we will contribute to a channel open."
            ],
            "default": "no max (`UINT_MAX`)"
          },
          "reserve_tank_msat": {
            "type": "msat",
            "description": [
              "Amount of sats to leave available in the node wallet."
            ],
            "default": "zero sats"
          },
          "fuzz_percent": {
            "type": "u32",
            "description": [
              "A percentage to fuzz the resulting contribution amount by. Valid values are 0 to 100. Note that turning this on with (match, 100) policy will randomly fail `option_will_fund` leases, as most clients expect an exact or greater match of their `requested_funds`."
            ],
            "default": "0% (no fuzz)"
          },
          "fund_probability": {
            "type": "u32",
            "description": [
              "The percent of v2 channel open requests to apply our policy to. Valid values are integers from 0 (fund 0% of all open requests) to 100 (fund every request). Useful for randomizing opens that receive funds. Useful for randomizing opens that receive funds."
            ],
            "default": "100"
          },
          "lease_fee_base_msat": {
            "type": "msat",
            "description": [
              "Flat fee for a channel lease. Node will receive this much extra added to their channel balance, paid by the opening node. Note that the minimum is 1sat."
            ],
            "default": "2k sats"
          },
          "lease_fee_basis": {
            "type": "u32",
            "description": [
              "A basis fee that's calculated as 1/10k of the total requested funds the peer is asking for. Node will receive the total of *lease_fee_basis* times requested funds / 10k satoshis added to their channel balance, paid by the opening node."
            ],
            "default": "0.65% (65 basis points)"
          },
          "funding_weight": {
            "type": "u32",
            "description": [
              "To calculate the fee the peer will compensate your node for its contributing inputs to the funding transaction. The total fee is calculated as the `open_channel2`.`funding_feerate_perkw` times this *funding_weight* divided by 1000. Node will have this funding fee added to their channel balance, paid by the opening node."
            ],
            "default": "2 inputs + 1 P2WPKH output"
          },
          "channel_fee_max_base_msat": {
            "type": "msat",
            "description": [
              "A commitment to a maximum `channel_fee_base_msat` that your node will charge for routing payments over this leased channel during the lease duration."
            ],
            "default": "5k sats"
          },
          "channel_fee_max_proportional_thousandths": {
            "type": "u32",
            "description": [
              "A commitment to a maximum `channel_fee_proportional_millionths` that your node will charge for routing payments over this leased channel during the lease duration. Note that it's denominated in 'thousandths'. A setting of `1` is equal to 1k ppm; `5` is 5k ppm, etc."
            ],
            "default": "100 (100k ppm)"
          },
          "compact_lease": {
            "type": "hex",
            "description": [
              "A compact description of the channel lease params. When opening a channel, passed in to `fundchannel` to indicate the terms we expect from the peer."
            ]
          }
        }
      },
      "response": {
        "required": [
          "summary",
          "policy",
          "policy_mod",
          "leases_only",
          "min_their_funding_msat",
          "max_their_funding_msat",
          "per_channel_min_msat",
          "per_channel_max_msat",
          "reserve_tank_msat",
          "fuzz_percent",
          "fund_probability"
        ],
        "additionalProperties": false,
        "properties": {
          "summary": {
            "type": "string",
            "description": [
              "Summary of the current funding policy e.g. (match 100)."
            ]
          },
          "policy": {
            "type": "string",
            "enum": [
              "match",
              "available",
              "fixed"
            ],
            "description": [
              "Policy funder plugin will use to decide how much capital to commit to a v2 open channel request."
            ]
          },
          "policy_mod": {
            "type": "u32",
            "description": [
              "The *policy_mod* is the number or 'modification' to apply to the policy."
            ]
          },
          "leases_only": {
            "type": "boolean",
            "description": [
              "Only contribute funds to `option_will_fund` lease requests."
            ]
          },
          "min_their_funding_msat": {
            "type": "msat",
            "description": [
              "The minimum funding sats that we require from peer to activate our funding policy."
            ]
          },
          "max_their_funding_msat": {
            "type": "msat",
            "description": [
              "The maximum funding sats that we'll allow from peer to activate our funding policy."
            ]
          },
          "per_channel_min_msat": {
            "type": "msat",
            "description": [
              "The minimum amount that we will fund a channel open with."
            ]
          },
          "per_channel_max_msat": {
            "type": "msat",
            "description": [
              "The maximum amount that we will fund a channel open with."
            ]
          },
          "reserve_tank_msat": {
            "type": "msat",
            "description": [
              "Amount of sats to leave available in the node wallet."
            ]
          },
          "fuzz_percent": {
            "type": "u32",
            "description": [
              "Percentage to fuzz our funding amount by."
            ]
          },
          "fund_probability": {
            "type": "u32",
            "description": [
              "Percent of opens to consider funding. 100 means we'll consider funding every requested open channel request."
            ]
          },
          "lease_fee_base_msat": {
            "type": "msat",
            "description": [
              "Flat fee to charge for a channel lease."
            ]
          },
          "lease_fee_basis": {
            "type": "u32",
            "description": [
              "Proportional fee to charge for a channel lease, calculated as 1/10,000th of requested funds."
            ]
          },
          "funding_weight": {
            "type": "u32",
            "description": [
              "Transaction weight the channel opener will pay us for a leased funding transaction."
            ]
          },
          "channel_fee_max_base_msat": {
            "type": "msat",
            "description": [
              "Maximum channel_fee_base_msat we'll charge for routing funds leased on this channel."
            ]
          },
          "channel_fee_max_proportional_thousandths": {
            "type": "u32",
            "description": [
              "Maximum channel_fee_proportional_millitionths we'll charge for routing funds leased on this channel, in thousandths."
            ]
          },
          "compact_lease": {
            "type": "hex",
            "description": [
              "Compact description of the channel lease parameters."
            ]
          }
        }
      },
      "errors": [
        "The following error code may occur:",
        "",
        "- -32602: If the given parameters are invalid."
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-fundchannel(7)",
        "lightning-listfunds(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:funderupdate#1",
            "method": "funderupdate",
            "params": {}
          },
          "response": {
            "summary": "fixed (0sat)",
            "policy": "fixed",
            "policy_mod": 0,
            "leases_only": true,
            "min_their_funding_msat": 10000000,
            "max_their_funding_msat": 4294967295000,
            "per_channel_min_msat": 10000000,
            "per_channel_max_msat": 4294967295000,
            "reserve_tank_msat": 0,
            "fuzz_percent": 0,
            "fund_probability": 100
          }
        },
        {
          "request": {
            "id": "example:funderupdate#2",
            "method": "funderupdate",
            "params": {
              "policy": "fixed",
              "policy_mod": "50000sat",
              "min_their_funding_msat": 1000,
              "per_channel_min_msat": "1000sat",
              "per_channel_max_msat": "500000sat",
              "fund_probability": 100,
              "fuzz_percent": 0,
              "leases_only": false
            }
          },
          "response": {
            "summary": "fixed (50000sat)",
            "policy": "fixed",
            "policy_mod": 50000,
            "leases_only": false,
            "min_their_funding_msat": 1000,
            "max_their_funding_msat": 4294967295000,
            "per_channel_min_msat": 1000000,
            "per_channel_max_msat": 500000000,
            "reserve_tank_msat": 0,
            "fuzz_percent": 0,
            "fund_probability": 100
          }
        }
      ]
    },
    "fundpsbt.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "fundpsbt",
      "title": "Command to populate PSBT inputs from the wallet",
      "description": [
        "`fundpsbt` is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well."
      ],
      "request": {
        "required": [
          "satoshi",
          "feerate",
          "startweight"
        ],
        "additionalProperties": false,
        "properties": {
          "satoshi": {
            "type": "sat_or_all",
            "description": [
              "The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*."
            ]
          },
          "feerate": {
            "type": "feerate",
            "description": [
              "Used for the transaction as initial feerate."
            ],
            "default": "*normal*"
          },
          "startweight": {
            "type": "u32",
            "description": [
              "The weight of the transaction before *fundpsbt* has added any inputs."
            ]
          },
          "minconf": {
            "type": "u32",
            "description": [
              "The minimum number of confirmations that used outputs should have."
            ],
            "default": "1"
          },
          "reserve": {
            "type": "u32",
            "description": [
              "If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks."
            ],
            "default": "72 blocks"
          },
          "locktime": {
            "type": "u32",
            "description": [
              "The locktime of the transaction. if not set, it is set to a recent block height."
            ]
          },
          "min_witness_weight": {
            "type": "u32",
            "description": [
              "Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used."
            ]
          },
          "excess_as_change": {
            "type": "boolean",
            "description": [
              "Flag to add a change output for the excess sats."
            ]
          },
          "nonwrapped": {
            "added": "v23.02",
            "type": "boolean",
            "description": [
              "To signal to filter out any p2sh-wrapped inputs from funding this PSBT."
            ]
          },
          "opening_anchor_channel": {
            "added": "v23.08",
            "type": "boolean",
            "description": [
              "To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels."
            ]
          }
        }
      },
      "response": {
        "required": [
          "psbt",
          "feerate_per_kw",
          "estimated_final_weight",
          "excess_msat"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "Unsigned PSBT which fulfills the parameters given."
            ]
          },
          "feerate_per_kw": {
            "type": "u32",
            "description": [
              "The feerate used to create the PSBT, in satoshis-per-kiloweight."
            ]
          },
          "estimated_final_weight": {
            "type": "u32",
            "description": [
              "The estimated weight of the transaction once fully signed."
            ]
          },
          "excess_msat": {
            "type": "msat",
            "description": [
              "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned."
            ]
          },
          "change_outnum": {
            "type": "u32",
            "description": [
              "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)."
            ]
          },
          "reservations": {
            "type": "array",
            "description": [
              "If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)."
            ],
            "items": {
              "type": "object",
              "required": [
                "txid",
                "vout",
                "was_reserved",
                "reserved",
                "reserved_to_block"
              ],
              "additionalProperties": false,
              "properties": {
                "txid": {
                  "type": "txid",
                  "description": [
                    "The txid of the transaction."
                  ]
                },
                "vout": {
                  "type": "u32",
                  "description": [
                    "The 0-based output number."
                  ]
                },
                "was_reserved": {
                  "type": "boolean",
                  "enum": [
                    false
                  ],
                  "description": [
                    "Whether this output was previously reserved."
                  ]
                },
                "reserved": {
                  "type": "boolean",
                  "enum": [
                    true
                  ],
                  "description": [
                    "Whether this output is now reserved."
                  ]
                },
                "reserved_to_block": {
                  "type": "u32",
                  "description": [
                    "The blockheight the reservation will expire."
                  ]
                }
              }
            }
          }
        },
        "post_return_value_notes": [
          "If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output."
        ]
      },
      "usage": [
        "Let's assume the caller is trying to produce a 100,000 satoshi output.",
        "",
        "First, the caller estimates the weight of the core (typically 42) and known outputs of the transaction (typically (9 + scriptlen) * 4). For a simple P2WPKH it's a 22 byte scriptpubkey, so that's 124 weight.",
        "",
        "It calls \"*fundpsbt* 100000sat slow 166\", which succeeds, and returns the *psbt* and *feerate_per_kw* it used, the *estimated_final_weight* and any *excess_msat*.",
        "",
        "If *excess_msat* is greater than the cost of adding a change output, the caller adds a change output randomly to position 0 or 1 in the PSBT. Say *feerate_per_kw* is 253, and the change output is a P2WPKH (weight 124), the cost is around 31 sats. With the dust limit disallowing payments below 546 satoshis, we would only create a change output if *excess_msat* was greater or equal to 31 + 546."
      ],
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: Catchall nonspecific error.",
        "- 301: Insufficient UTXOs to meet *satoshi* value."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-utxopsbt(7)",
        "lightning-reserveinputs(7)",
        "lightning-unreserveinputs(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:fundpsbt#1",
            "method": "fundpsbt",
            "params": {
              "satoshi": 1000000,
              "feerate": "253perkw",
              "startweight": 250,
              "reserve": 0
            }
          },
          "response": {
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000",
            "feerate_per_kw": 253,
            "estimated_final_weight": 652,
            "excess_msat": 196962518000,
            "change_outnum": 0
          }
        },
        {
          "request": {
            "id": "example:fundpsbt#2",
            "method": "fundpsbt",
            "params": {
              "satoshi": 500000,
              "feerate": "urgent",
              "startweight": 166,
              "reserve": 0,
              "excess_as_change": true,
              "min_witness_weight": 110
            }
          },
          "response": {
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000",
            "feerate_per_kw": 11000,
            "estimated_final_weight": 613,
            "excess_msat": 0,
            "change_outnum": 0
          }
        }
      ]
    },
    "getemergencyrecoverdata.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "getemergencyrecoverdata",
      "title": "Command to fetch data from the emergency.recover file",
      "description": [
        "The **getemergencyrecoverdata** RPC command is used to fetch data from the emergency.recover file, which contains encrypted data."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "response": {
        "required": [
          "filedata"
        ],
        "additionalProperties": false,
        "properties": {
          "filedata": {
            "type": "hex",
            "description": [
              "The raw, hex-encoded, emergency.recover file"
            ]
          }
        }
      },
      "author": [
        "Aditya [aditya.sharma20111@gmail.com](mailto:aditya.sharma20111@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-getsharedsecret(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:getemergencyrecoverdata#1",
            "method": "getemergencyrecoverdata",
            "params": {}
          },
          "response": "emergencyrecoverdata0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
        }
      ]
    },
    "getinfo.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "getinfo",
      "title": "Command to receive all information about the Core Lightning node.",
      "description": [
        "The **getinfo** gives a summary of the current running node."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "response": {
        "required": [
          "id",
          "alias",
          "color",
          "num_peers",
          "num_pending_channels",
          "num_active_channels",
          "num_inactive_channels",
          "version",
          "blockheight",
          "network",
          "fees_collected_msat",
          "lightning-dir",
          "address"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "The public key unique to this node."
            ]
          },
          "alias": {
            "type": "string",
            "description": [
              "The fun alias this node will advertize."
            ],
            "maxLength": 32
          },
          "color": {
            "type": "hex",
            "description": [
              "The favorite RGB color this node will advertize."
            ],
            "minLength": 6,
            "maxLength": 6
          },
          "num_peers": {
            "type": "u32",
            "description": [
              "The total count of peers, connected or with channels."
            ]
          },
          "num_pending_channels": {
            "type": "u32",
            "description": [
              "The total count of channels being opened."
            ]
          },
          "num_active_channels": {
            "type": "u32",
            "description": [
              "The total count of channels in normal state."
            ]
          },
          "num_inactive_channels": {
            "type": "u32",
            "description": [
              "The total count of channels waiting for opening or closing transactions to be mined."
            ]
          },
          "version": {
            "type": "string",
            "description": [
              "Identifies what bugs you are running into."
            ]
          },
          "lightning-dir": {
            "type": "string",
            "description": [
              "Identifies where you can find the configuration and other related files."
            ]
          },
          "our_features": {
            "type": "object",
            "description": [
              "Our BOLT #9 feature bits (as hexstring) for various contexts."
            ],
            "additionalProperties": true,
            "required": [
              "init",
              "node",
              "channel",
              "invoice"
            ],
            "properties": {
              "init": {
                "type": "hex",
                "description": [
                  "Features (incl. globalfeatures) in our init message, these also restrict what we offer in open_channel or accept in accept_channel."
                ]
              },
              "node": {
                "type": "hex",
                "description": [
                  "Features in our node_announcement message."
                ]
              },
              "channel": {
                "type": "hex",
                "description": [
                  "Negotiated channel features we (as channel initiator) publish in the channel_announcement message."
                ]
              },
              "invoice": {
                "type": "hex",
                "description": [
                  "Features in our BOLT11 invoices."
                ]
              }
            }
          },
          "blockheight": {
            "type": "u32",
            "description": [
              "The highest block height we've learned."
            ]
          },
          "network": {
            "type": "string",
            "description": [
              "Represents the type of network on the node are working (e.g: `bitcoin`, `testnet`, or `regtest`)."
            ]
          },
          "fees_collected_msat": {
            "type": "msat",
            "description": [
              "Total routing fees collected by this node."
            ]
          },
          "address": {
            "type": "array",
            "description": [
              "The addresses we announce to the world."
            ],
            "items": {
              "type": "object",
              "required": [
                "type",
                "port"
              ],
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "dns",
                    "ipv4",
                    "ipv6",
                    "torv2",
                    "torv3"
                  ],
                  "description": [
                    "Type of connection (until 23.08, `websocket` was also allowed)."
                  ]
                },
                "port": {
                  "type": "u16",
                  "description": [
                    "Port number."
                  ]
                }
              },
              "if": {
                "additionalProperties": true,
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "dns",
                      "ipv4",
                      "ipv6",
                      "torv2",
                      "torv3"
                    ]
                  }
                }
              },
              "then": {
                "required": [
                  "type",
                  "address",
                  "port"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {},
                  "port": {},
                  "address": {
                    "type": "string",
                    "description": [
                      "Address in expected format for **type**."
                    ]
                  }
                }
              },
              "else": {
                "required": [
                  "type",
                  "port"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {},
                  "port": {}
                }
              }
            }
          },
          "binding": {
            "type": "array",
            "description": [
              "The addresses we are listening on."
            ],
            "items": {
              "type": "object",
              "required": [
                "type"
              ],
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "local socket",
                    "websocket",
                    "ipv4",
                    "ipv6",
                    "torv2",
                    "torv3"
                  ],
                  "description": [
                    "Type of connection."
                  ]
                },
                "address": {
                  "type": "string",
                  "description": [
                    "Address in expected format for **type**."
                  ]
                },
                "port": {
                  "type": "u16",
                  "description": [
                    "Port number."
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "local socket"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "type",
                      "socket"
                    ],
                    "properties": {
                      "type": {},
                      "socket": {
                        "type": "string",
                        "description": [
                          "Socket filename."
                        ]
                      }
                    }
                  },
                  "else": {
                    "additionalProperties": false,
                    "required": [
                      "type",
                      "address",
                      "port"
                    ],
                    "properties": {
                      "type": {},
                      "address": {},
                      "port": {},
                      "subtype": {}
                    }
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "websocket"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "type",
                      "address",
                      "port",
                      "subtype"
                    ],
                    "properties": {
                      "type": {},
                      "address": {},
                      "port": {},
                      "subtype": {
                        "type": "string",
                        "description": [
                          "Type of address."
                        ]
                      }
                    }
                  },
                  "else": {
                    "additionalProperties": false,
                    "required": [
                      "type"
                    ],
                    "properties": {
                      "type": {},
                      "address": {},
                      "port": {},
                      "socket": {}
                    }
                  }
                }
              ]
            }
          },
          "warning_bitcoind_sync": {
            "type": "string",
            "description": [
              "Bitcoind is not up-to-date with network."
            ]
          },
          "warning_lightningd_sync": {
            "type": "string",
            "description": [
              "Lightningd is still loading latest blocks from bitcoind."
            ]
          }
        }
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters or some error happened during the command process."
      ],
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) wrote the initial version of this man page,",
        "but many others did the hard work of actually implementing this rpc command."
      ],
      "see_also": [
        "lightning-connect(7)",
        "lightning-fundchannel(7)",
        "lightning-listconfigs(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:getinfo#1",
            "method": "getinfo",
            "params": {}
          },
          "response": {
            "id": "nodeid020202020202020202020202020202020202020202020202020202020202",
            "alias": "SILENTARTIST",
            "color": "022d22",
            "num_peers": 0,
            "num_pending_channels": 0,
            "num_active_channels": 0,
            "num_inactive_channels": 0,
            "address": [],
            "binding": [
              {
                "type": "ipv4",
                "address": "127.0.0.1",
                "port": 19735
              }
            ],
            "version": "v25.05",
            "blockheight": 110,
            "network": "regtest",
            "fees_collected_msat": 0,
            "lightning-dir": "/tmp/.lightning/regtest",
            "our_features": {
              "init": "0898882a8a59a1",
              "node": "8898882a8a59a1",
              "channel": "",
              "invoice": "02000002024100"
            }
          }
        }
      ]
    },
    "getlog.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "getlog",
      "title": "Command to show recent logs.",
      "description": [
        "The **getlog** the RPC command to show logs, with optional log *level*."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "level": {
            "type": "string",
            "enum": [
              "broken",
              "unusual",
              "info",
              "debug",
              "trace",
              "io"
            ],
            "description": [
              "A string that represents the log level."
            ],
            "default": "*info*"
          }
        }
      },
      "response": {
        "required": [
          "created_at",
          "bytes_used",
          "bytes_max",
          "log"
        ],
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "type": "string",
            "description": [
              "UNIX timestamp with 9 decimal places, when logging was initialized."
            ]
          },
          "bytes_used": {
            "type": "u32",
            "description": [
              "The number of bytes used by logging records."
            ]
          },
          "bytes_max": {
            "type": "u32",
            "description": [
              "The bytes_used values at which records will be trimmed ."
            ]
          },
          "log": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "type"
              ],
              "additionalProperties": true,
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "SKIPPED",
                    "BROKEN",
                    "UNUSUAL",
                    "INFO",
                    "DEBUG",
                    "TRACE",
                    "IO_IN",
                    "IO_OUT"
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "type": {
                        "enum": [
                          "SKIPPED"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "num_skipped"
                    ],
                    "properties": {
                      "type": {},
                      "num_skipped": {
                        "type": "u32",
                        "description": [
                          "Number of unprinted log entries (deleted or below *level* parameter)."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "type": {
                        "enum": [
                          "BROKEN",
                          "UNUSUAL",
                          "INFO",
                          "DEBUG",
                          "TRACE"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "time",
                      "source",
                      "log"
                    ],
                    "properties": {
                      "type": {},
                      "time": {
                        "type": "string",
                        "description": [
                          "UNIX timestamp with 9 decimal places after **created_at**."
                        ]
                      },
                      "source": {
                        "type": "string",
                        "description": [
                          "The particular logbook this was found in."
                        ]
                      },
                      "log": {
                        "type": "string",
                        "description": [
                          "The actual log message."
                        ]
                      },
                      "node_id": {
                        "type": "pubkey",
                        "description": [
                          "The peer this is associated with."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "type": {
                        "enum": [
                          "IO_IN",
                          "IO_OUT"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "time",
                      "source",
                      "log"
                    ],
                    "properties": {
                      "type": {},
                      "time": {
                        "type": "string",
                        "description": [
                          "Seconds after **created_at**, with 9 decimal places."
                        ]
                      },
                      "source": {
                        "type": "string",
                        "description": [
                          "The particular logbook this was found in."
                        ]
                      },
                      "log": {
                        "type": "string",
                        "description": [
                          "The associated log message."
                        ]
                      },
                      "node_id": {
                        "type": "pubkey",
                        "description": [
                          "The peer this is associated with."
                        ]
                      },
                      "data": {
                        "type": "hex",
                        "description": [
                          "The IO which occurred."
                        ]
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters."
      ],
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) wrote the initial version of this man page,",
        "but many others did the hard work of actually implementing this rpc command."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:getlog#1",
            "method": "getlog",
            "params": {
              "level": "unusual"
            }
          },
          "response": {
            "created_at": 1738000000,
            "bytes_used": 1630000,
            "bytes_max": 10485760,
            "log": [
              {
                "type": "SKIPPED",
                "num_skipped": 144
              },
              {
                "type": "UNUSUAL",
                "time": "71.800000000",
                "source": "plugin-bookkeeper",
                "log": "topic 'utxo_deposit' is not a known notification topic"
              },
              {
                "type": "UNUSUAL",
                "time": "72.800000000",
                "source": "plugin-bookkeeper",
                "log": "topic 'utxo_spend' is not a known notification topic"
              },
              {
                "type": "SKIPPED",
                "num_skipped": 147
              },
              {
                "type": "UNUSUAL",
                "time": "74.800000000",
                "node_id": "nodeid010101010101010101010101010101010101010101010101010101010101",
                "source": "chan#1",
                "log": "No peer channel with scid=228x1x1"
              }
            ]
          }
        }
      ]
    },
    "getroute.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "getroute",
      "title": "Command for routing a payment (low-level)",
      "description": [
        "The **getroute** RPC command attempts to find the best route for the payment of *amount_msat* to lightning node *id*, such that the payment will arrive at *id* with *cltv*.",
        "",
        "There are two considerations for how good a route is: how low the fees are, and how long your payment will get stuck in a delayed output if a node goes down during the process. ."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [
          "id",
          "amount_msat",
          "riskfactor"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "Node pubkey to find the best route for the payment."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. The 0 value is special: it ignores any *htlc_minimum_msat* setting on channels, and simply returns a possible route (if any) which is useful for simple probing."
            ]
          },
          "riskfactor": {
            "type": "u64",
            "description": [
              "A non-negative floating-point field controls this tradeoff; it is the annual cost of your funds being stuck (as a percentage). For example, if you thought the convenience of keeping your funds liquid (not stuck) was worth 20% per annum interest, *riskfactor* would be 20. If you didn't care about risk, *riskfactor* would be zero."
            ]
          },
          "cltv": {
            "type": "u32",
            "description": [
              "Cltv-blocks to spare."
            ],
            "default": "9"
          },
          "fromid": {
            "type": "pubkey",
            "description": [
              "The node to start the route from."
            ],
            "default": "this node"
          },
          "fuzzpercent": {
            "type": "u32",
            "description": [
              "Used to distort fees to provide some randomization to the route generated, but it was not properly implemented and is ignored."
            ]
          },
          "exclude": {
            "type": "array",
            "description": [
              "A JSON array of short-channel-id/direction (e.g. ['564334x877x1/0', '564195x1292x0/1' ]) or node-id which should be excluded from consideration for routing. Note if the source or destination is excluded, the command result is undefined."
            ],
            "default": "not to exclude any channels or nodes",
            "items": {
              "type": "string"
            }
          },
          "maxhops": {
            "type": "u32",
            "description": [
              "The maximum number of channels to return."
            ],
            "default": "20"
          }
        }
      },
      "response": {
        "required": [
          "route"
        ],
        "additionalProperties": false,
        "properties": {
          "route": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "direction",
                "channel",
                "amount_msat",
                "delay",
                "style"
              ],
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "pubkey",
                  "description": [
                    "The node at the end of this hop."
                  ]
                },
                "channel": {
                  "type": "short_channel_id",
                  "description": [
                    "The channel joining these nodes."
                  ]
                },
                "direction": {
                  "type": "u32",
                  "description": [
                    "0 if this channel is traversed from lesser to greater **id**, otherwise 1."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount expected by the node at the end of this hop."
                  ]
                },
                "delay": {
                  "type": "u32",
                  "description": [
                    "The total CLTV expected by the node at the end of this hop."
                  ]
                },
                "style": {
                  "type": "string",
                  "description": [
                    "The features understood by the destination node."
                  ],
                  "enum": [
                    "tlv"
                  ]
                }
              }
            }
          }
        },
        "post_return_value_notes": [
          "The final *id* will be the destination *id* given in the input. The difference between the first *amount_msat* minus the *amount_msat* given in the input is the fee (assuming the first hop is free). The first *delay* is the very worst case timeout for the payment failure, in blocks."
        ]
      },
      "riskfactor_effect_on_routing": [
        "The risk factor is treated as if it were an additional fee on the route, for the purposes of comparing routes.",
        "",
        "The formula used is the following approximation:",
        "",
        "    risk-fee = amount x blocks-timeout x per-block-cost",
        "",
        "We are given a *riskfactor* expressed as a percentage. There are 52596 blocks per year, thus *per-block-cost* is *riskfactor* divided by 5,259,600.",
        "",
        "The final result is:",
        "",
        "    risk-fee = amount x blocks-timeout x riskfactor / 5259600",
        "",
        "Here are the risk fees in millisatoshis, using various parameters. I assume a channel charges the default of 1000 millisatoshis plus 1 part-per-million. Common to_self_delay values on the network at 14 and 144 blocks.",
        "",
        "| Amount (msat)          | Riskfactor         | Delay         | Risk Fee         | Route fee         |",
        "|------------------------|--------------------|---------------|------------------|-------------------|",
        "| 10,000                 | 1                  | 14            | 0                | 1001              |",
        "| 10,000                 | 10                 | 14            | 0                | 1001              |",
        "| 10,000                 | 100                | 14            | 2                | 1001              |",
        "| 10,000                 | 1000               | 14            | 26               | 1001              |",
        "| 1,000,000              | 1                  | 14            | 2                | 1001              |",
        "| 1,000,000              | 10                 | 14            | 26               | 1001              |",
        "| 1,000,000              | 100                | 14            | 266              | 1001              |",
        "| 1,000,000              | 1000               | 14            | 2661             | 1001              |",
        "| 100,000,000            | 1                  | 14            | 266              | 1100              |",
        "| 100,000,000            | 10                 | 14            | 2661             | 1100              |",
        "| 100,000,000            | 100                | 14            | 26617            | 1100              |",
        "| 100,000,000            | 1000               | 14            | 266179           | 1100              |",
        "| 10,000                 | 1                  | 144           | 0                | 1001              |",
        "| 10,000                 | 10                 | 144           | 2                | 1001              |",
        "| 10,000                 | 100                | 144           | 27               | 1001              |",
        "| 10,000                 | 1000               | 144           | 273              | 1001              |",
        "| 1,000,000              | 1                  | 144           | 27               | 1001              |",
        "| 1,000,000              | 10                 | 144           | 273              | 1001              |",
        "| 1,000,000              | 100                | 144           | 2737             | 1001              |",
        "| 1,000,000              | 1000               | 144           | 27378            | 1001              |",
        "| 100,000,000            | 1                  | 144           | 2737             | 1100              |",
        "| 100,000,000            | 10                 | 144           | 27378            | 1100              |",
        "| 100,000,000            | 100                | 144           | 273785           | 1100              |",
        "| 100,000,000            | 1000               | 144           | 2737850          | 1100              |",
        ""
      ],
      "recommended_riskfactor_values": [
        "The default *fuzz* factor is 5%, so as you can see from the table above, that tends to overwhelm the effect of *riskfactor* less than about 5.",
        "",
        "1 is a conservative value for a stable lightning network with very few failures.",
        "",
        "1000 is an aggressive value for trying to minimize timeouts at all costs.",
        "",
        "The default for lightning-pay(7) is 10, which starts to become a major factor for larger amounts, and is basically ignored for tiny ones."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-pay(7)",
        "lightning-sendpay(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:getroute#1",
            "method": "getroute",
            "params": {
              "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "amount_msat": 10000,
              "riskfactor": 1
            }
          },
          "response": {
            "route": [
              {
                "id": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "channel": "109x1x1",
                "direction": 1,
                "amount_msat": 10001,
                "delay": 15,
                "style": "tlv"
              },
              {
                "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "channel": "111x1x1",
                "direction": 0,
                "amount_msat": 10000,
                "delay": 9,
                "style": "tlv"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:getroute#2",
            "method": "getroute",
            "params": {
              "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
              "amount_msat": 500000,
              "riskfactor": 10,
              "cltv": 9
            }
          },
          "response": {
            "route": [
              {
                "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "channel": "111x1x1",
                "direction": 0,
                "amount_msat": 500006,
                "delay": 15,
                "style": "tlv"
              },
              {
                "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
                "channel": "125x1x1",
                "direction": 0,
                "amount_msat": 500000,
                "delay": 9,
                "style": "tlv"
              }
            ]
          }
        }
      ]
    },
    "getroutes.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "getroutes",
      "title": "Command for routing a payment",
      "added": "v24.08",
      "description": [
        "The **getroutes** RPC command attempts to find the best set of paths for the payment from *source* to *destination* of *amount_msat*, using the given *layers* on top of the gossip information.  The result is constrained by *maxfee*, and will arrive at the destination with *final_cltv*.",
        "",
        "NOTE: The returned paths are a different format then *getroute*, being more appropriate for creating intermediary onion layers.",
        "",
        "Layers are generally maintained by plugins, either to contain persistent information about capacities which have been discovered, or to contain transient information for this particular payment (such as blinded paths or routehints).",
        "",
        "There are four automatic layers: *auto.localchans* contains information on local channels from this node (including non-public ones), and their exact current spendable capacities. *auto.sourcefree* overrides all channels (including those from previous layers) leading out of the *source* to be zero fee and zero delay.  These are both useful in the case where the source is the current node.  *auto.no_mpp_support* forces getroutes to return a single path solution which is useful for payments for which MPP is not supported. And *auto.include_fees* that fixes the send amount and deducts fee from there, ie. the receiver pays for fees instead of the sender."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [
          "source",
          "destination",
          "amount_msat",
          "layers",
          "maxfee_msat",
          "final_cltv"
        ],
        "additionalProperties": false,
        "properties": {
          "source": {
            "type": "pubkey",
            "description": [
              "Node pubkey to start the paths"
            ]
          },
          "destination": {
            "type": "pubkey",
            "description": [
              "Node pubkey to end the paths"
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Amount to send. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*."
            ]
          },
          "layers": {
            "type": "array",
            "items": {
              "type": "string",
              "description": [
                "Layer to apply to the gossip map before attempting to find routes."
              ]
            }
          },
          "maxfee_msat": {
            "type": "msat",
            "description": [
              "Maximum fee to spend: we will never return a set of routes more expensive than this. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*."
            ]
          },
          "final_cltv": {
            "type": "u32",
            "description": [
              "Number of blocks for the final node.  We need to know this because no HTLC is allowed to have a CLTV delay more than 2016 blocks."
            ]
          },
          "maxdelay": {
            "type": "u32",
            "added": "v25.02",
            "description": [
              "Maximum number of blocks of delay for the route. Cannot be bigger than 2016."
            ],
            "default": "2016"
          },
          "maxparts": {
            "type": "u32",
            "added": "v25.09",
            "description": [
              "Maximum number of routes in the solution."
            ],
            "default": "100"
          }
        }
      },
      "response": {
        "required": [
          "probability_ppm",
          "routes"
        ],
        "additionalProperties": false,
        "properties": {
          "probability_ppm": {
            "type": "u64",
            "description": [
              "The estimated probability of success using these routes, in millionths."
            ]
          },
          "routes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "probability_ppm",
                "amount_msat",
                "final_cltv",
                "path"
              ],
              "properties": {
                "probability_ppm": {
                  "type": "u64",
                  "description": [
                    "The estimated probability of success using this route, in millionths."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount delivered to the *destination* by this path."
                  ]
                },
                "final_cltv": {
                  "type": "u32",
                  "description": [
                    "Number of blocks required by the final node (set by caller)"
                  ]
                },
                "path": {
                  "type": "array",
                  "description": [
                    "The hops to get from *source* to *destination*."
                  ],
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "short_channel_id_dir",
                      "next_node_id",
                      "amount_msat",
                      "delay"
                    ],
                    "properties": {
                      "short_channel_id_dir": {
                        "type": "short_channel_id_dir",
                        "description": [
                          "The channel and direction joining these nodes."
                        ]
                      },
                      "amount_msat": {
                        "type": "msat",
                        "description": [
                          "The amount to send into this hop."
                        ]
                      },
                      "next_node_id": {
                        "type": "pubkey",
                        "description": [
                          "The peer id at the end of this hop."
                        ]
                      },
                      "delay": {
                        "type": "u32",
                        "description": [
                          "The total CLTV expected by the node at the start of this hop."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "author": [
        "[lagrang3@protonmail.com](mailto:lagrang3@protonmail.com) wrote the minimum-cost-flow solver, Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) wrote the API and this documentation."
      ],
      "see_also": [
        "lightning-askrene-reserve(7)",
        "lightning-askrene-unreserve(7)",
        "lightning-askrene-disable-node(7)",
        "lightning-askrene-create-channel(7)",
        "lightning-askrene-inform-channel(7)",
        "lightning-askrene-report(7)",
        "lightning-askrene-age(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:getroutes#1",
            "method": "getroutes",
            "params": {
              "source": "nodeid010101010101010101010101010101010101010101010101010101010101",
              "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "amount_msat": 1250000,
              "layers": [],
              "maxfee_msat": 125000,
              "final_cltv": 0
            }
          },
          "response": {
            "probability_ppm": 997501,
            "routes": [
              {
                "probability_ppm": 997501,
                "amount_msat": 1250000,
                "final_cltv": 0,
                "path": [
                  {
                    "short_channel_id_dir": "109x1x1/1",
                    "next_node_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
                    "amount_msat": 1250026,
                    "delay": 12
                  },
                  {
                    "short_channel_id_dir": "123x1x1/0",
                    "next_node_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                    "amount_msat": 1250013,
                    "delay": 6
                  }
                ]
              }
            ]
          }
        }
      ]
    },
    "help.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "help",
      "title": "Command to return all information about RPC commands.",
      "description": [
        "The **help** is a RPC command which is possible consult all information about the RPC commands, or a specific command if *command* is given.",
        "",
        "Note that the lightning-cli(1) tool will prefer to list a man page when a specific *command* is specified, and will only return the JSON if the man page is not found."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "command": {
            "type": "string",
            "description": [
              "Command to get information about."
            ]
          }
        }
      },
      "response": {
        "required": [
          "help"
        ],
        "additionalProperties": false,
        "properties": {
          "help": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "command"
              ],
              "properties": {
                "command": {
                  "type": "string",
                  "description": [
                    "The command."
                  ]
                }
              }
            }
          },
          "format-hint": {
            "type": "string",
            "enum": [
              "simple"
            ],
            "description": [
              "Prints the help in human-readable flat form."
            ]
          }
        }
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters."
      ],
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) wrote the initial version of this man page,",
        "but many others did the hard work of actually implementing this rpc command."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:help#1",
            "method": "help",
            "params": {
              "command": "pay"
            }
          },
          "response": {
            "help": [
              {
                "command": "pay bolt11 [amount_msat] [label] [riskfactor] [maxfeepercent] [retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] [maxfee] [description] [partial_msat] [dev_use_shadow]"
              }
            ],
            "format-hint": "simple"
          }
        },
        {
          "request": {
            "id": "example:help#2",
            "method": "help",
            "params": {
              "command": "dev"
            }
          },
          "response": {
            "help": [
              {
                "command": "dev subcommand=crash|rhash|slowcmd"
              }
            ],
            "format-hint": "simple"
          }
        }
      ]
    },
    "injectonionmessage.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "rpc": "injectonionmessage",
      "title": "Send an onion message, as if we'd just received it",
      "added": "v24.11",
      "description": [
        "The **injectonionmessage** RPC command causes the node to receive an onion message, similar to the way it would receive one from a peer.  The onion packet is unwrapped, then handled normally: either received locally, or forwarded to the next peer.",
        "NOTE: injectonionmessage was actually introduced (but not documented) in v24.08, with a different API"
      ],
      "request": {
        "required": [
          "path_key",
          "message"
        ],
        "properties": {
          "path_key": {
            "type": "pubkey",
            "description": [
              "The point that the local node can use to decode the message"
            ]
          },
          "message": {
            "type": "hex",
            "description": [
              "Hex-encoded blob, less than 65536 bytes long, containing the message.  See to [BOLT 04][bolt04] for further details."
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)",
        "",
        "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md"
      ],
      "examples": [
        {
          "request": {
            "id": "example:injectonionmessage#1",
            "method": "injectonionmessage",
            "params": {
              "message": "0002cb7cd2001e3c670d64135542dcefdf4a3f590eb142cee9277b317848471906caeabe4afeae7f4e31f6ca9c119b643d5369c5e55f892f205469a185f750697124a2bb7ccea1245ec12d76340bcf7371ba6d1c9ddfe09b4153fce524417c14a594fdbb5e7c698a5daffe77db946727a38711be2ecdebdd347d2a9f990810f2795b3c39b871d7c72a11534bd388ca2517630263d96d8cc72d146bae800638066175c85a8e8665160ea332ed7d27efc31c960604d61c3f83801c25cbb69ae3962c2ef13b1fa9adc8dcbe3dc8d9a5e27ff5669e076b02cafef8f2c88fc548e03642180d57606386ad6ce27640339747d40f26eb5b9e93881fc8c16d5896122032b64bb5f1e4be6f41f5fa4dbd7851989aeccd80b2d5f6f25427f171964146185a8eaa57891d91e49a4d378743231e19edd5994c3118c9a415958a5d9524a6ecc78c0205f5c0059a7fbcf1abad706a189b712476d112521c9a4650d0ff09890536acae755a2b07d00811044df28b288d3dc2d5ae3f8bf3cf7a2950e2167105dfad0fb8398ef08f36abcdb1bfd6aca3241c33810f0750f35bdfb7c60b1759275b7704ab1bc8f3ea375b3588eab10e4f948f12fe0a3c77b67bebeedbcced1de0f0715f9959e5497cda5f8f6ab76c15b3dcc99956465de1bf2855338930650f8e8e8c391d9bb8950125dd60d8289dade0556d9dc443761983e26adcc223412b756e2fd9ad64022859b6cab20e8ffc3cf39ae6045b2c3338b1145ee3719a098e58c425db764d7f9a5034dbb730c20202f79bc3c53fab78ecd530aa0e8f7698c9ea53cb96dc9c639282c362d31177c5b81979f46f2db6090b8e171db47287523f28c462e35ef489b51426387f2709c342083968153b5f8a51cd5716b38106bb0f21c5ccfc28dd7c74b71c8367ae8ca348f66a7996bbc535076a1f65d9109658ec042257ca7523488fb1807dc8bec42739ccae066739cf58083b4e2c65e52e1747a6ec2aa26338bb6f2c3195a2b160e26dec70a2cfde269fa7c10c45d346a8bcc313bb618324edadc0291d15f4dc00ca3a7ad7131045fdf6978ba52178f4699525efcb8d96561630e2f28eaa97c66c38c66301b6c6f0124b550db620b09f35b9d45d1441cab7d93be5e3c39b9becfab7f8d05dd3a7a6e27a1d3f23f1dd01e967f5206600619f75439181848f7f4148216c11314b4eaf64c28c268ad4b33ea821d57728e9a9e9e1b6c4bcf35d14958295fc5f92bd6846f33c46f5fa20f569b25bc916b94e554f27a37448f873497e13baef8c740a7587828cc4136dd21b8584e6983e376e91663f8f91559637738b400fb49940fc2df299dfd448604b63c2f5d1f1ec023636f3baf2be5730364afd38191726a7c0d9477b1f231da4d707aabc6ad8036488181dbdb16b48500f2333036629004504d3524f87ece6afb04c4ba03ea6fce069e98b1ab7bf51f237d7c0f40756744dd703c6023b6461b90730f701404e8dddfaff40a9a60e670be7729556241fc9cc8727a586e38b71616bff8772c873b37d920d51a6ad31219a24b12f268545e2cfeb9e662236ab639fd4ecf865612678471ff7b320c934a13ca1f2587fc6a90f839c3c81c0ff84b51330820431418918e8501844893b53c1e0de46d51a64cb769974a996c58ff06683ebdc46fd4bb8e857cecebab785a351c64fd486fb648d25936cb09327b70d22c243035d4343fa3d2d148e2df5cd928010e34ae42b0333e698142050d9405b39f3aa69cecf8a388afbc7f199077b911cb829480f0952966956fe57d815f0d2467f7b28af11f8820645b601c0e1ad72a4684ebc60287d23ec3502f4c65ca44f5a4a0d79e3a5718cd23e7538cb35c57673fb9a1173e5526e767768117c7fefc2e3718f44f790b27e61995fecc6aef05107e75355be301ebe1500c147bb655a159f",
              "path_key": "03ccf3faa19e8d124f27d495e3359f4002a6622b9a02df9a51b609826d354cda52"
            }
          },
          "response": {}
        }
      ]
    },
    "injectpaymentonion.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "injectpaymentonion",
      "title": "Send a payment with a custom onion packet",
      "description": [
        "The **injectpaymentonion** RPC command causes the node to receive a payment attempt similar to the way it would receive one from a peer. The onion packet is unwrapped, then handled normally: either as a local payment, or forwarded to the next peer.",
        "Compared to lightning-sendonion(7): the handling of blinded paths and self-payments is trivial, and the interface blocks until the payment succeeds or fails.  The call also fails if this payment_hash has already been successfully paid."
      ],
      "request": {
        "additionalProperties": false,
        "required": [
          "onion",
          "payment_hash",
          "amount_msat",
          "cltv_expiry",
          "partid",
          "groupid"
        ],
        "properties": {
          "onion": {
            "type": "hex",
            "description": [
              "Hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "Specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount for the first HTLC in millisatoshis.  This is also the amount which will be forwarded to the first peer (if any) as we do not charge fees on our own payments.  Note: this is shown in listsendpays as `amount_sent_msat`."
            ]
          },
          "cltv_expiry": {
            "type": "u16",
            "description": [
              "The cltv_expiry for the first HTLC in blocks.  This must be greater than the current blockheight."
            ]
          },
          "partid": {
            "type": "u64",
            "description": [
              "The non-zero identifier for multiple parallel partial payments with the same *payment_hash*."
            ]
          },
          "groupid": {
            "type": "u64",
            "description": [
              "Grouping key to disambiguate multiple attempts to pay the same *payment_hash*.  All payments in other groups must be completed before starting a new group."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "Can be used to provide a human readable reference to retrieve the payment at a later time."
            ]
          },
          "invstring": {
            "type": "string",
            "description": [
              "Usually a bolt11 or bolt12 string, which, it will be returned in *waitsendpay* and *listsendpays* results."
            ]
          },
          "localinvreqid": {
            "type": "hash",
            "description": [
              "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)."
            ]
          },
          "destination_msat": {
            "type": "msat",
            "added": "v24.11.1",
            "description": [
              "Amount that is actually delivered to the destination (i.e. `amount_msat` minus fees), for showing in listsendpays (confusingly, as `amount_msat`)."
            ]
          }
        }
      },
      "response": {
        "additionalProperties": false,
        "required": [
          "created_index",
          "created_at",
          "completed_at",
          "payment_preimage"
        ],
        "properties": {
          "created_at": {
            "type": "u64",
            "description": [
              "The UNIX timestamp showing when this payment was initiated."
            ]
          },
          "completed_at": {
            "type": "u64",
            "description": [
              "The UNIX timestamp showing when this payment was completed."
            ]
          },
          "created_index": {
            "type": "u64",
            "description": [
              "1-based index indicating order this payment was created in."
            ]
          },
          "payment_preimage": {
            "added": "v24.11",
            "type": "secret",
            "description": [
              "The proof of payment: SHA256 of this is the invoice's **payment_hash**."
            ]
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- 218: injectpaymentonion failed",
        "",
        "The *onionreply* is returned in the error *data*, which can be unwrapped to discover the error",
        "",
        "- 219: injectpaymentonion already succeeded",
        "",
        "The *data* object contains the previous success, as per lightning-sendpay."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-createonion(7)",
        "lightning-sendonion(7)",
        "lightning-listsendpays(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)",
        "",
        "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md"
      ],
      "examples": [
        {
          "request": {
            "id": "example:injectpaymentonion#1",
            "method": "injectpaymentonion",
            "params": {
              "onion": "onion30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030",
              "payment_hash": "paymenthashinvl0270027002700270027002700270027002700270027002700",
              "amount_msat": 1000,
              "cltv_expiry": 144,
              "partid": 1,
              "groupid": 0
            }
          },
          "response": {
            "created_index": 12,
            "created_at": 1738000000,
            "completed_at": 1739000000,
            "payment_preimage": "paymentpreimgio1030303030303030303030303030303030303030303030303"
          }
        }
      ]
    },
    "invoice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "invoice",
      "title": "Command for accepting payments",
      "description": [
        "The **invoice** RPC command creates the expectation of a payment of a given amount of milli-satoshi: it returns a unique token which another lightning daemon can use to pay this invoice. This token includes a *route hint* description of an incoming channel with capacity to pay the invoice, if any exists."
      ],
      "request": {
        "required": [
          "amount_msat",
          "label",
          "description"
        ],
        "additionalProperties": false,
        "properties": {
          "amount_msat": {
            "type": "msat_or_any",
            "description": [
              "The string `any`, which creates an invoice that can be paid with any amount. Otherwise it is a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*."
            ]
          },
          "label": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ],
            "description": [
              "A unique string or number (which is treated as a string, so `01` is different from `1`); it is never revealed to other nodes on the lightning network, but it can be used to query the status of this invoice."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "A short description of purpose of payment, e.g. *1 cup of coffee*. This value is encoded into the BOLT11 invoice and is viewable by any node you send this invoice to (unless *deschashonly* is true as described below). It must be UTF-8, and cannot use *\\u* JSON escape codes."
            ]
          },
          "expiry": {
            "type": "u64",
            "description": [
              "The time the invoice is valid for, in seconds. If no value is provided the default of 604800 (1 week) is used."
            ]
          },
          "fallbacks": {
            "type": "array",
            "description": [
              "One or more fallback addresses to include in the invoice (in order from most- preferred to least): note that these arrays are not currently tracked to fulfill the invoice."
            ],
            "items": {
              "type": "string"
            }
          },
          "preimage": {
            "type": "hex",
            "description": [
              "A 64-digit hex string to be used as payment preimage for the created invoice. By default, if unspecified, lightningd will generate a secure pseudorandom preimage seeded from an appropriate entropy source on your system. **IMPORTANT**: if you specify the *preimage*, you are responsible, to ensure appropriate care for generating using a secure pseudorandom generator seeded with sufficient entropy, and keeping the preimage secret. This parameter is an advanced feature intended for use with cutting-edge cryptographic protocols and should not be used unless explicitly needed."
            ]
          },
          "exposeprivatechannels": {
            "description": [
              "If specified, it overrides the default route hint logic, which will use unpublished channels only if there are no published channels."
            ],
            "oneOf": [
              {
                "type": "boolean",
                "description": [
                  "If *True* unpublished channels are always considered as a route hint candidate; if *False*, never."
                ]
              },
              {
                "type": "array",
                "description": [
                  "Array of short channel ids (or a remote alias), only those specific channels will be considered candidates, even if they are public or dead-ends."
                ],
                "items": {
                  "type": "short_channel_id"
                }
              },
              {
                "type": "short_channel_id",
                "description": [
                  "If it is a short channel id (e.g. *1x1x3*), only this specific channel will be considered candidate, even if it is public or dead-end."
                ]
              }
            ]
          },
          "cltv": {
            "type": "u32",
            "description": [
              "If specified, sets the *min_final_cltv_expiry* for the invoice. Otherwise, it's set to the parameter **cltv-final**."
            ]
          },
          "deschashonly": {
            "type": "boolean",
            "description": [
              "If True, then the bolt11 returned contains a hash of the *description*, rather than the *description* itself: this allows much longer descriptions, but they must be communicated via some other mechanism."
            ],
            "default": "False"
          }
        }
      },
      "response": {
        "required": [
          "payment_hash",
          "expires_at",
          "created_index",
          "bolt11",
          "payment_secret"
        ],
        "additionalProperties": false,
        "properties": {
          "bolt11": {
            "type": "string",
            "description": [
              "The bolt11 string."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "payment_secret": {
            "type": "secret",
            "description": [
              "The *payment_secret* to place in the onion."
            ]
          },
          "expires_at": {
            "type": "u64",
            "description": [
              "UNIX timestamp of when invoice expires."
            ]
          },
          "created_index": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "1-based index indicating order this invoice was created in."
            ]
          },
          "warning_capacity": {
            "type": "string",
            "description": [
              "Even using all possible channels, there's not enough incoming capacity to pay this invoice."
            ]
          },
          "warning_offline": {
            "type": "string",
            "description": [
              "There would be enough incoming capacity, but some channels are offline, so there isn't."
            ]
          },
          "warning_deadends": {
            "type": "string",
            "description": [
              "There would be enough incoming capacity, but some channels are dead-ends (no other public channels from those peers), so there isn't."
            ]
          },
          "warning_private_unused": {
            "type": "string",
            "description": [
              "There would be enough incoming capacity, but some channels are unannounced and *exposeprivatechannels* is *false*, so there isn't."
            ]
          },
          "warning_mpp": {
            "type": "string",
            "description": [
              "There is sufficient capacity, but not in a single channel, so the payer will have to use multi-part payments."
            ]
          }
        }
      },
      "errors": [
        "On failure, an error is returned and no invoice is created. If the",
        "lightning process fails before responding, the caller should use",
        "lightning-listinvoices(7) to query whether this invoice was created or",
        "not.",
        "",
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error.",
        "- 900: An invoice with the given *label* already exists.",
        "- 901: An invoice with the given *preimage* already exists.",
        "- 902: None of the specified *exposeprivatechannels* were usable."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listinvoices(7)",
        "lightning-delinvoice(7)",
        "lightning-pay(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:invoice#1",
            "method": "invoice",
            "params": {
              "amount_msat": 10000,
              "label": "lbl_l31",
              "description": "Invoice description l31"
            }
          },
          "response": {
            "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
            "expires_at": 1739000000,
            "bolt11": "lnbcrt100n1pnt2bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000",
            "payment_secret": "paymentsecretinvl00310003100031000310003100031000310003100031000",
            "created_index": 2
          }
        },
        {
          "request": {
            "id": "example:invoice#2",
            "method": "invoice",
            "params": {
              "amount_msat": "50000msat",
              "label": "lbl_l32",
              "description": "l32 description"
            }
          },
          "response": {
            "payment_hash": "paymenthashinvl0320032003200320032003200320032003200320032003200",
            "expires_at": 1739000000,
            "bolt11": "lnbcrt100n1pnt2bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000",
            "payment_secret": "paymentsecretinvl00032003200320032003200320032003200320032003200",
            "created_index": 3
          }
        }
      ]
    },
    "invoicerequest.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v22.11",
      "rpc": "invoicerequest",
      "title": "Command for offering payments",
      "description": [
        "The **invoicerequest** RPC command creates an `invoice_request` to send payments: it automatically enables the processing of an incoming invoice, and payment of it. The reader of the resulting `invoice_request` can use lightning-sendinvoice(7) to collect their payment."
      ],
      "request": {
        "required": [
          "amount",
          "description"
        ],
        "additionalProperties": false,
        "properties": {
          "amount": {
            "type": "msat",
            "description": [
              "A positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "A short description of purpose of the payment, e.g. *ATM withdrawl*. This value is encoded into the resulting `invoice_request` and is viewable by anyone you expose it to. It must be UTF-8, and cannot use *\\u* JSON escape codes."
            ]
          },
          "issuer": {
            "type": "string",
            "description": [
              "Who is issuing it (i.e. you) if appropriate."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "An internal-use name for the offer, which can be any UTF-8 string."
            ]
          },
          "absolute_expiry": {
            "type": "u64",
            "description": [
              "The time the offer is valid until, in seconds since the first day of 1970 UTC. If not set, the `invoice_request` remains valid (though it can be deactivated by the issuer of course). This is encoded in the `invoice_request`."
            ]
          },
          "single_use": {
            "type": "boolean",
            "description": [
              "Indicates that the `invoice_request` is only valid once; we may attempt multiple payments, but as soon as one is successful no more invoices are accepted (i.e. only one person can take the money)."
            ],
            "default": "True"
          }
        }
      },
      "response": {
        "required": [
          "invreq_id",
          "single_use",
          "active",
          "bolt12",
          "used"
        ],
        "additionalProperties": false,
        "properties": {
          "invreq_id": {
            "type": "hash",
            "description": [
              "The SHA256 hash of all invoice_request fields less than 160."
            ]
          },
          "active": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": [
              "Whether the invoice_request is currently active."
            ]
          },
          "single_use": {
            "type": "boolean",
            "description": [
              "Whether the invoice_request will become inactive after we pay an invoice for it."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The bolt12 string starting with lnr."
            ]
          },
          "used": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": [
              "Whether the invoice_request has already been used."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "The label provided when creating the invoice_request."
            ]
          }
        }
      },
      "errors": [
        "On failure, an error is returned and no `invoice_request` is created. If the lightning process fails before responding, the caller should use lightning-listinvoicerequests(7) to query whether it was created or not.",
        "",
        "- -1: Catchall nonspecific error."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listinvoicerequests(7)",
        "lightning-disableinvoicerequest(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:invoicerequest#1",
            "method": "invoicerequest",
            "params": {
              "amount": 1000000,
              "description": "Simple test"
            }
          },
          "response": {
            "invreq_id": "invreqid01010101010101010101010101010101010101010101010101010101",
            "active": true,
            "single_use": true,
            "bolt12": "lno1qgsq000bolt210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000",
            "used": false
          }
        },
        {
          "request": {
            "id": "example:invoicerequest#2",
            "method": "invoicerequest",
            "params": {
              "amount": "10000sat",
              "description": "Requesting for invoice",
              "issuer": "clightning store"
            }
          },
          "response": {
            "invreq_id": "invreqid02020202020202020202020202020202020202020202020202020202",
            "active": true,
            "single_use": true,
            "bolt12": "lno1qgsq000bolt240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000",
            "used": false
          }
        }
      ]
    },
    "keysend.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "keysend",
      "title": "Send funds to a node without an invoice",
      "description": [
        "The **keysend** RPC command attempts to find a route to the given destination, and send the specified amount to it. Unlike the `pay` RPC command the `keysend` command does not require an invoice, instead it uses the `destination` node ID, and `amount` to find a route to the specified node.",
        "",
        "In order for the destination to be able to claim the payment, the `payment_key` is randomly generated by the sender and included in the encrypted payload for the destination. As a consequence there is not proof-of-payment, like there is with an invoice where the `payment_key` is generated on the destination, and the only way sender could have it is by sending a payment. Please ensure that this matches your use-case when using `keysend`.",
        "",
        "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name."
      ],
      "request": {
        "required": [
          "destination",
          "amount_msat"
        ],
        "additionalProperties": false,
        "properties": {
          "destination": {
            "type": "pubkey",
            "description": [
              "The 33 byte, hex-encoded, node ID of the node that the payment should go to."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "A whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)."
            ]
          },
          "maxfeepercent": {
            "type": "number",
            "description": [
              "Limits the money paid in fees as percentage of the total amount that is to be transferred."
            ],
            "default": "0.5"
          },
          "retry_for": {
            "type": "u32",
            "description": [
              "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment. However, a payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case."
            ],
            "default": "60 seconds"
          },
          "maxdelay": {
            "type": "u32",
            "description": [
              "Number of blocks the payment may be delayed."
            ]
          },
          "exemptfee": {
            "type": "msat",
            "description": [
              "Used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the `maxfeepercent` check to be skipped on fees that are smaller than *exemptfee*."
            ],
            "default": "5000 millisatoshi"
          },
          "routehints": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "scid",
                  "feebase",
                  "feeprop",
                  "expirydelta"
                ],
                "properties": {
                  "id": {
                    "type": "pubkey"
                  },
                  "scid": {
                    "type": "short_channel_id"
                  },
                  "feebase": {
                    "type": "msat"
                  },
                  "feeprop": {
                    "type": "u32"
                  },
                  "expirydelta": {
                    "type": "u16"
                  }
                }
              }
            }
          },
          "extratlvs": {
            "type": "object",
            "additionalProperties": true,
            "required": [],
            "description": [
              "Dictionary of additional fields to insert into the final tlv. The format is 'fieldnumber': 'hexstring'."
            ]
          },
          "maxfee": {
            "added": "v24.11",
            "type": "msat",
            "description": [
              "*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here."
            ]
          }
        }
      },
      "response": {
        "required": [
          "payment_preimage",
          "payment_hash",
          "created_at",
          "parts",
          "amount_msat",
          "amount_sent_msat",
          "status"
        ],
        "additionalProperties": false,
        "properties": {
          "payment_preimage": {
            "type": "secret",
            "description": [
              "The proof of payment: SHA256 of this **payment_hash**."
            ]
          },
          "destination": {
            "type": "pubkey",
            "description": [
              "The final destination of the payment."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "created_at": {
            "type": "number",
            "description": [
              "The UNIX timestamp showing when this payment was initiated."
            ]
          },
          "parts": {
            "type": "u32",
            "description": [
              "How many attempts this took."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Amount the recipient received."
            ]
          },
          "amount_sent_msat": {
            "type": "msat",
            "description": [
              "Total amount we sent (including fees)."
            ]
          },
          "warning_partial_completion": {
            "type": "string",
            "description": [
              "Not all parts of a multi-part payment have completed."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "complete"
            ],
            "description": [
              "Status of payment."
            ]
          }
        },
        "post_return_value_notes": [
          "You can monitor the progress and retries of a payment using the lightning-paystatus(7) command."
        ]
      },
      "randomization": [
        "To protect user privacy, the payment algorithm performs some randomization.",
        "",
        "1: Route Randomization",
        "",
        "Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.",
        "",
        "2: Shadow Route",
        "",
        "Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.",
        "",
        "Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*."
      ],
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error.",
        "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.",
        "- 205: Unable to find a route.",
        "- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.",
        "- 210: Payment timed out without a payment in progress.",
        "",
        "A routing failure object has the fields below:",
        "",
        "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.",
        "*erring_node*: The hex string of the pubkey id of the node that reported the error.",
        "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.",
        "*failcode*: The failure code, as per BOLT #4.",
        "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the `UPDATE` bit set, as per BOLT #4."
      ],
      "author": [
        "Christian Decker [decker@blockstream.com](mailto:decker@blockstream.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-listpays(7)",
        "lightning-decode(7)",
        "lightning-listinvoices(7)",
        "lightning-delinvoice(7)",
        "lightning-getroute(7)",
        "lightning-invoice(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:keysend#1",
            "method": "keysend",
            "params": {
              "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "amount_msat": 10000
            }
          },
          "response": {
            "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
            "payment_hash": "paymenthashkey01k101k101k101k101k101k101k101k101k101k101k101k101",
            "created_at": 1738000000,
            "parts": 1,
            "amount_msat": 10000,
            "amount_sent_msat": 10001,
            "payment_preimage": "paymentpreimage1010101010101010101010101010101010101010101010101",
            "status": "complete"
          }
        },
        {
          "request": {
            "id": "example:keysend#2",
            "method": "keysend",
            "params": {
              "destination": "nodeid040404040404040404040404040404040404040404040404040404040404",
              "amount_msat": 10000000,
              "extratlvs": {
                "133773310": "68656c6c6f776f726c64",
                "133773312": "66696c7465726d65"
              }
            }
          },
          "response": {
            "destination": "nodeid040404040404040404040404040404040404040404040404040404040404",
            "payment_hash": "paymenthashkey02k201k201k201k201k201k201k201k201k201k201k201k201",
            "created_at": 1738000000,
            "parts": 1,
            "amount_msat": 10000000,
            "amount_sent_msat": 10000202,
            "payment_preimage": "paymentpreimage2020202020202020202020202020202020202020202020202",
            "status": "complete"
          }
        },
        {
          "request": {
            "id": "example:keysend#3",
            "method": "keysend",
            "params": {
              "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "amount_msat": 10000,
              "routehints": [
                [
                  {
                    "scid": "111x1x1",
                    "id": "nodeid020202020202020202020202020202020202020202020202020202020202",
                    "feebase": "1msat",
                    "feeprop": 10,
                    "expirydelta": 9
                  }
                ]
              ]
            }
          },
          "response": {
            "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
            "payment_hash": "paymenthashkey03k301k301k301k301k301k301k301k301k301k301k301k301",
            "created_at": 1738000000,
            "parts": 2,
            "amount_msat": 10000,
            "amount_sent_msat": 10001,
            "payment_preimage": "paymentpreimage3030303030303030303030303030303030303030303030303",
            "status": "complete"
          }
        }
      ]
    },
    "listaddresses.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v24.11",
      "rpc": "listaddresses",
      "title": "Command to list all addresses issued by the node to date",
      "description": [
        "The **listaddresses** RPC command provides a detailed list of all Bitcoin addresses that have been generated and issued by the Core Lightning node up to the current date."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "address": {
            "type": "string",
            "description": [
              "A Bitcoin accepted type, including a bech32, address for lookup in the list of addresses issued to date."
            ]
          },
          "start": {
            "type": "u64",
            "description": [
              "Starting key index for listing addresses or searching for a particular address."
            ],
            "default": 1
          },
          "limit": {
            "type": "u32",
            "description": [
              "The maximum number of addresses to return or search for."
            ],
            "default": "Total number of addresses issued"
          }
        }
      },
      "response": {
        "required": [
          "addresses"
        ],
        "additionalProperties": false,
        "properties": {
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "keyidx"
              ],
              "properties": {
                "keyidx": {
                  "type": "u64",
                  "description": [
                    "The key index of the address issued."
                  ]
                },
                "bech32": {
                  "type": "string",
                  "description": [
                    "The bech32 (native segwit) address."
                  ]
                },
                "p2tr": {
                  "type": "string",
                  "description": [
                    "The taproot address."
                  ]
                }
              }
            }
          }
        }
      },
      "author": [
        "Shahana Farooqui [sfarooqui@blockstream.com](mailto:sfarooqui@blockstream.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-newaddr(7)",
        "lightning-withdraw(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listaddresses#1",
            "method": "listaddresses",
            "params": [
              "bcrt1p2gppccw6ywewmg74qqxxmqfdpjds3rpr0mf22y9tm9xcc0muggwsea9nkf"
            ]
          },
          "response": {
            "addresses": [
              {
                "keyidx": 14,
                "p2tr": "bcrt1p2gppccw6ywewmg74qqxxmqfdpjds3rpr0mf22y9tm9xcc0muggwsea9nkf"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listaddresses#2",
            "method": "listaddresses",
            "params": {
              "start": 6,
              "limit": 2
            }
          },
          "response": {
            "addresses": [
              {
                "keyidx": 6,
                "bech32": "bcrt1qkpw662yvzdy5ttdg8nw4eh4el0uc7m2ythw0h3"
              },
              {
                "keyidx": 7,
                "p2tr": "bcrt1pn45xgkyj54usdu98plm4zgcp4c5jvvfxmyexwcm5kc3gyfsrjmasd6ctsf"
              }
            ]
          }
        }
      ]
    },
    "listchainmoves.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listchainmoves",
      "title": "Command to get the audit list of all onchain coin movements.",
      "added": "v25.09",
      "description": [
        "The **listchainmoves** command returns the confirmed balance changes onchain over time."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "index": {
            "type": "string",
            "enum": [
              "created"
            ],
            "description": [
              "How to interpret `start` and `limit`"
            ]
          },
          "start": {
            "type": "u64",
            "description": [
              "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)."
            ]
          },
          "limit": {
            "type": "u32",
            "description": [
              "If `index` is specified, `limit` can be used to specify the maximum number of entries to return."
            ]
          }
        },
        "dependentUpon": {
          "index": [
            "start",
            "limit"
          ]
        }
      },
      "response": {
        "required": [
          "chainmoves"
        ],
        "additionalProperties": false,
        "properties": {
          "chainmoves": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "created_index",
                "account_id",
                "primary_tag",
                "extra_tags",
                "credit_msat",
                "debit_msat",
                "timestamp",
                "utxo",
                "output_msat",
                "blockheight"
              ],
              "properties": {
                "created_index": {
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this move was created in."
                  ]
                },
                "account_id": {
                  "type": "string",
                  "description": [
                    "This is either the channel_id corresponding to the channel involved, or a string such as `wallet` for the internal wallet, or `external` for some other external source."
                  ]
                },
                "credit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount credited (one of this or debit_msat is zero)"
                  ]
                },
                "debit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount debited (one of this or credit_msat is zero)"
                  ]
                },
                "timestamp": {
                  "type": "u64",
                  "description": [
                    "Time of this event in seconds since January 1 1970 UTC"
                  ]
                },
                "primary_tag": {
                  "type": "string",
                  "enum": [
                    "deposit",
                    "withdrawal",
                    "penalty",
                    "channel_open",
                    "channel_close",
                    "delayed_to_us",
                    "htlc_tx",
                    "htlc_timeout",
                    "htlc_fulfill",
                    "to_wallet",
                    "anchor",
                    "to_them",
                    "penalized",
                    "stolen",
                    "ignored",
                    "to_miner"
                  ],
                  "description": [
                    "A set of one or more tags defining the nature of the change"
                  ]
                },
                "extra_tags": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "opener",
                      "leased",
                      "stealable",
                      "splice",
                      "foreign"
                    ]
                  },
                  "description": [
                    "A set of additional tags expanding on the details"
                  ]
                },
                "peer_id": {
                  "type": "pubkey",
                  "description": [
                    "The lightning peer associated with this onchain event"
                  ]
                },
                "originating_account": {
                  "type": "string",
                  "description": [
                    "This is either a channel_id corresponding to the source channel involved, or a string such as `wallet` for the internal wallet."
                  ]
                },
                "spending_txid": {
                  "type": "txid",
                  "description": [
                    "The transaction ID which did the spending."
                  ]
                },
                "utxo": {
                  "type": "outpoint",
                  "description": [
                    "The txid and outpoint number spent for this balance change."
                  ]
                },
                "payment_hash": {
                  "type": "hash",
                  "description": [
                    "The payment hash associated with this balance change."
                  ]
                },
                "output_msat": {
                  "type": "msat",
                  "description": [
                    "The output amount (always a whole number of sats).  Note that in some cases (e.g. channel opens), not all these belong to us."
                  ]
                },
                "output_count": {
                  "type": "u32",
                  "description": [
                    "The number of outputs in the `txid` (so you can tell once you've seen events for all of them)."
                  ]
                },
                "blockheight": {
                  "type": "u32",
                  "description": [
                    "The block number where `txid` appeared (alternately, where `utxo` was spent)."
                  ]
                }
              }
            }
          }
        }
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listchainmoves#1",
            "method": "listchainmoves",
            "params": {}
          },
          "response": {
            "chainmoves": [
              {
                "created_index": 1,
                "account_id": "wallet",
                "credit_msat": 200000000000,
                "debit_msat": 0,
                "timestamp": 1758192762,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "994185cba7723715c0aa1d1859ce2781116776cea917035c90f8f04c9f4e095e:1",
                "output_msat": 200000000000,
                "blockheight": 104
              },
              {
                "created_index": 2,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 0,
                "debit_msat": 0,
                "timestamp": 1758192777,
                "primary_tag": "channel_open",
                "extra_tags": [],
                "utxo": "542906c8a9d90596592459a9484f4286a3200f6540599c83b43af2ac4166c6ca:1",
                "peer_id": "nodeid010101010101010101010101010101010101010101010101010101010101",
                "output_msat": 1000000000,
                "blockheight": 109
              },
              {
                "created_index": 3,
                "account_id": "wallet",
                "credit_msat": 2000000000,
                "debit_msat": 0,
                "timestamp": 1758192780,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "19e9e42f2f2097ea1dc18d7eb670bc53c90cbe31bb1daba8e94abf3c6b60d2dc:1",
                "output_msat": 2000000000,
                "blockheight": 110
              },
              {
                "created_index": 4,
                "account_id": "wallet",
                "credit_msat": 0,
                "debit_msat": 200000000000,
                "timestamp": 1738530000,
                "primary_tag": "withdrawal",
                "extra_tags": [],
                "utxo": "994185cba7723715c0aa1d1859ce2781116776cea917035c90f8f04c9f4e095e:1",
                "spending_txid": "94418b652c9a0d79129552d317dcc37cb55afda1387257a22c7f16aa3981b7bc",
                "output_msat": 200000000000,
                "blockheight": 111
              },
              {
                "created_index": 5,
                "account_id": "wallet",
                "credit_msat": 198995073000,
                "debit_msat": 0,
                "timestamp": 1738530000,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "94418b652c9a0d79129552d317dcc37cb55afda1387257a22c7f16aa3981b7bc:1",
                "output_msat": 198995073000,
                "blockheight": 111
              },
              {
                "created_index": 6,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 1000000000,
                "debit_msat": 0,
                "timestamp": 1738530000,
                "primary_tag": "channel_open",
                "extra_tags": [
                  "opener"
                ],
                "utxo": "94418b652c9a0d79129552d317dcc37cb55afda1387257a22c7f16aa3981b7bc:0",
                "peer_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "output_msat": 1000000000,
                "blockheight": 111
              },
              {
                "created_index": 7,
                "account_id": "wallet",
                "credit_msat": 2000000000,
                "debit_msat": 0,
                "timestamp": 1758192792,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "b6d0090efbeb347fa59f90b321d6906cdf86779c15477582979fa427249f71f5:1",
                "output_msat": 2000000000,
                "blockheight": 114
              },
              {
                "created_index": 8,
                "account_id": "wallet",
                "credit_msat": 0,
                "debit_msat": 198995073000,
                "timestamp": 1758192795,
                "primary_tag": "withdrawal",
                "extra_tags": [],
                "utxo": "94418b652c9a0d79129552d317dcc37cb55afda1387257a22c7f16aa3981b7bc:1",
                "spending_txid": "32de3d1592062670eb8630875a28705cc1988b7f83f8c712bf9d39be2152efec",
                "output_msat": 198995073000,
                "blockheight": 115
              },
              {
                "created_index": 9,
                "account_id": "wallet",
                "credit_msat": 197990453000,
                "debit_msat": 0,
                "timestamp": 1758192795,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "32de3d1592062670eb8630875a28705cc1988b7f83f8c712bf9d39be2152efec:0",
                "output_msat": 197990453000,
                "blockheight": 115
              },
              {
                "created_index": 10,
                "account_id": "f8fc83a432cbfb2fffe222cc06727fdd977b5dd10ebd6707158e799e6f522d9f",
                "credit_msat": 1000000000,
                "debit_msat": 0,
                "timestamp": 1758192795,
                "primary_tag": "channel_open",
                "extra_tags": [
                  "opener"
                ],
                "utxo": "32de3d1592062670eb8630875a28705cc1988b7f83f8c712bf9d39be2152efec:1",
                "peer_id": "nodeid050505050505050505050505050505050505050505050505050505050505",
                "output_msat": 1000000000,
                "blockheight": 115
              },
              {
                "created_index": 11,
                "account_id": "wallet",
                "credit_msat": 486914000,
                "debit_msat": 0,
                "timestamp": 1738520000,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "874b26d4c523a902fdc44b88ec000eb5c3fe8754c9d44190a140561e24e77781:0",
                "output_msat": 486914000,
                "blockheight": 121
              },
              {
                "created_index": 12,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 489809898,
                "timestamp": 1738520000,
                "primary_tag": "channel_close",
                "extra_tags": [],
                "utxo": "94418b652c9a0d79129552d317dcc37cb55afda1387257a22c7f16aa3981b7bc:0",
                "spending_txid": "txid010101010101010101010101010101010101010101010101010101010101",
                "output_msat": 1000000000,
                "output_count": 2,
                "blockheight": 121
              },
              {
                "created_index": 13,
                "account_id": "external",
                "credit_msat": 510190000,
                "debit_msat": 0,
                "timestamp": 1738520000,
                "primary_tag": "to_them",
                "extra_tags": [],
                "utxo": "874b26d4c523a902fdc44b88ec000eb5c3fe8754c9d44190a140561e24e77781:1",
                "originating_account": "channelid0230000230000230000230000230000230000230000230000230000",
                "output_msat": 510190000,
                "blockheight": 121
              },
              {
                "created_index": 14,
                "account_id": "wallet",
                "credit_msat": 2000000000,
                "debit_msat": 0,
                "timestamp": 1758192808,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "c9c9bec064382b6a6fb2a30d8923949b3c9f732465542b96e9ad1b5eebda4c7d:0",
                "output_msat": 2000000000,
                "blockheight": 122
              },
              {
                "created_index": 15,
                "account_id": "wallet",
                "credit_msat": 0,
                "debit_msat": 197990453000,
                "timestamp": 1738500000,
                "primary_tag": "withdrawal",
                "extra_tags": [],
                "utxo": "32de3d1592062670eb8630875a28705cc1988b7f83f8c712bf9d39be2152efec:0",
                "spending_txid": "0137213d852e76d48f0270a78218d2f562ac0a8974f814cab66376537cfd1682",
                "output_msat": 197990453000,
                "blockheight": 123
              },
              {
                "created_index": 16,
                "account_id": "wallet",
                "credit_msat": 196985833000,
                "debit_msat": 0,
                "timestamp": 1738500000,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "0137213d852e76d48f0270a78218d2f562ac0a8974f814cab66376537cfd1682:1",
                "output_msat": 196985833000,
                "blockheight": 123
              },
              {
                "created_index": 17,
                "account_id": "channelid0230200230200230200230200230200230200230200230200230200",
                "credit_msat": 1000000000,
                "debit_msat": 0,
                "timestamp": 1738500000,
                "primary_tag": "channel_open",
                "extra_tags": [
                  "opener"
                ],
                "utxo": "0137213d852e76d48f0270a78218d2f562ac0a8974f814cab66376537cfd1682:0",
                "peer_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "output_msat": 1000000000,
                "blockheight": 123
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listchainmoves#2",
            "method": "listchainmoves",
            "params": {
              "index": "created",
              "start": 10
            }
          },
          "response": {
            "chainmoves": [
              {
                "created_index": 10,
                "account_id": "f8fc83a432cbfb2fffe222cc06727fdd977b5dd10ebd6707158e799e6f522d9f",
                "credit_msat": 1000000000,
                "debit_msat": 0,
                "timestamp": 1758192795,
                "primary_tag": "channel_open",
                "extra_tags": [
                  "opener"
                ],
                "utxo": "32de3d1592062670eb8630875a28705cc1988b7f83f8c712bf9d39be2152efec:1",
                "peer_id": "nodeid050505050505050505050505050505050505050505050505050505050505",
                "output_msat": 1000000000,
                "blockheight": 115
              },
              {
                "created_index": 11,
                "account_id": "wallet",
                "credit_msat": 486914000,
                "debit_msat": 0,
                "timestamp": 1738520000,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "874b26d4c523a902fdc44b88ec000eb5c3fe8754c9d44190a140561e24e77781:0",
                "output_msat": 486914000,
                "blockheight": 121
              },
              {
                "created_index": 12,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 489809898,
                "timestamp": 1738520000,
                "primary_tag": "channel_close",
                "extra_tags": [],
                "utxo": "94418b652c9a0d79129552d317dcc37cb55afda1387257a22c7f16aa3981b7bc:0",
                "spending_txid": "txid010101010101010101010101010101010101010101010101010101010101",
                "output_msat": 1000000000,
                "output_count": 2,
                "blockheight": 121
              },
              {
                "created_index": 13,
                "account_id": "external",
                "credit_msat": 510190000,
                "debit_msat": 0,
                "timestamp": 1738520000,
                "primary_tag": "to_them",
                "extra_tags": [],
                "utxo": "874b26d4c523a902fdc44b88ec000eb5c3fe8754c9d44190a140561e24e77781:1",
                "originating_account": "channelid0230000230000230000230000230000230000230000230000230000",
                "output_msat": 510190000,
                "blockheight": 121
              },
              {
                "created_index": 14,
                "account_id": "wallet",
                "credit_msat": 2000000000,
                "debit_msat": 0,
                "timestamp": 1758192808,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "c9c9bec064382b6a6fb2a30d8923949b3c9f732465542b96e9ad1b5eebda4c7d:0",
                "output_msat": 2000000000,
                "blockheight": 122
              },
              {
                "created_index": 15,
                "account_id": "wallet",
                "credit_msat": 0,
                "debit_msat": 197990453000,
                "timestamp": 1738500000,
                "primary_tag": "withdrawal",
                "extra_tags": [],
                "utxo": "32de3d1592062670eb8630875a28705cc1988b7f83f8c712bf9d39be2152efec:0",
                "spending_txid": "0137213d852e76d48f0270a78218d2f562ac0a8974f814cab66376537cfd1682",
                "output_msat": 197990453000,
                "blockheight": 123
              },
              {
                "created_index": 16,
                "account_id": "wallet",
                "credit_msat": 196985833000,
                "debit_msat": 0,
                "timestamp": 1738500000,
                "primary_tag": "deposit",
                "extra_tags": [],
                "utxo": "0137213d852e76d48f0270a78218d2f562ac0a8974f814cab66376537cfd1682:1",
                "output_msat": 196985833000,
                "blockheight": 123
              },
              {
                "created_index": 17,
                "account_id": "channelid0230200230200230200230200230200230200230200230200230200",
                "credit_msat": 1000000000,
                "debit_msat": 0,
                "timestamp": 1738500000,
                "primary_tag": "channel_open",
                "extra_tags": [
                  "opener"
                ],
                "utxo": "0137213d852e76d48f0270a78218d2f562ac0a8974f814cab66376537cfd1682:0",
                "peer_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "output_msat": 1000000000,
                "blockheight": 123
              }
            ]
          }
        }
      ]
    },
    "listchannelmoves.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listchannelmoves",
      "title": "Command to get the audit list of all channel coin movements.",
      "added": "v25.09",
      "description": [
        "The **listchannelmoves** command returns the confirmed balance changes within lightning channels over time."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "index": {
            "type": "string",
            "enum": [
              "created"
            ],
            "description": [
              "How to interpret `start` and `limit`"
            ]
          },
          "start": {
            "type": "u64",
            "description": [
              "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)."
            ]
          },
          "limit": {
            "type": "u32",
            "description": [
              "If `index` is specified, `limit` can be used to specify the maximum number of entries to return."
            ]
          }
        },
        "dependentUpon": {
          "index": [
            "start",
            "limit"
          ]
        }
      },
      "response": {
        "required": [
          "channelmoves"
        ],
        "additionalProperties": false,
        "properties": {
          "channelmoves": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "created_index",
                "account_id",
                "primary_tag",
                "credit_msat",
                "debit_msat",
                "timestamp",
                "fees_msat"
              ],
              "properties": {
                "created_index": {
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this move was created in."
                  ]
                },
                "account_id": {
                  "type": "string",
                  "description": [
                    "The channel_id corresponding to the channel involved."
                  ]
                },
                "credit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount credited (one of this or debit_msat is zero)"
                  ]
                },
                "debit_msat": {
                  "type": "msat",
                  "description": [
                    "Amount debited (one of this or credit_msat is zero)"
                  ]
                },
                "timestamp": {
                  "type": "u64",
                  "description": [
                    "Time of this event in seconds since January 1 1970 UTC"
                  ]
                },
                "primary_tag": {
                  "type": "string",
                  "enum": [
                    "invoice",
                    "routed",
                    "pushed",
                    "lease_fee",
                    "channel_proposed",
                    "penalty_adj",
                    "journal_entry"
                  ],
                  "description": [
                    "A set of one or more tags defining the nature of the change"
                  ]
                },
                "payment_hash": {
                  "type": "hash",
                  "description": [
                    "The hash associated with this payment (not present for leases or push funding)"
                  ]
                },
                "part_id": {
                  "type": "u64",
                  "description": [
                    "The part_id for the payment (the `payment_hash`, `group_id`, `part_id` tuple will be unique)"
                  ]
                },
                "group_id": {
                  "type": "u64",
                  "description": [
                    "The group_id for the payment (the `payment_hash`, `group_id`, `part_id` tuple will be unique)"
                  ]
                },
                "fees_msat": {
                  "type": "msat",
                  "description": [
                    "The fees paid for this payment"
                  ]
                }
              }
            }
          }
        }
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listchannelmoves#1",
            "method": "listchannelmoves",
            "params": {}
          },
          "response": {
            "channelmoves": [
              {
                "created_index": 1,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 500000000,
                "debit_msat": 0,
                "timestamp": 1738520000,
                "primary_tag": "invoice",
                "payment_hash": "paymenthashdelpay10101010101010101010101010101010101010101010101",
                "fees_msat": 0
              },
              {
                "created_index": 2,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 500000000,
                "timestamp": 1738520000,
                "primary_tag": "invoice",
                "payment_hash": "8a46ab91013146df39e98ad7c89505fbb5419f110e928f7a393e8304f3057df7",
                "part_id": 0,
                "group_id": 1,
                "fees_msat": 0
              },
              {
                "created_index": 3,
                "account_id": "f8fc83a432cbfb2fffe222cc06727fdd977b5dd10ebd6707158e799e6f522d9f",
                "credit_msat": 0,
                "debit_msat": 500000000,
                "timestamp": 1758192801,
                "primary_tag": "invoice",
                "payment_hash": "88969daaf02214a1928e6eb62a237a8ee557f3da93b2c44f3901432c88f4334b",
                "part_id": 0,
                "group_id": 1,
                "fees_msat": 0
              },
              {
                "created_index": 4,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 10000,
                "timestamp": 1758192801,
                "primary_tag": "routed",
                "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
                "fees_msat": 1
              },
              {
                "created_index": 5,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 10001,
                "debit_msat": 0,
                "timestamp": 1758192801,
                "primary_tag": "routed",
                "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
                "fees_msat": 1
              },
              {
                "created_index": 6,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 10000,
                "timestamp": 1758192801,
                "primary_tag": "routed",
                "payment_hash": "paymenthashkey01k101k101k101k101k101k101k101k101k101k101k101k101",
                "fees_msat": 1
              },
              {
                "created_index": 7,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 10001,
                "debit_msat": 0,
                "timestamp": 1758192801,
                "primary_tag": "routed",
                "payment_hash": "paymenthashkey01k101k101k101k101k101k101k101k101k101k101k101k101",
                "fees_msat": 1
              },
              {
                "created_index": 8,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 10000101,
                "timestamp": 1758192802,
                "primary_tag": "routed",
                "payment_hash": "paymenthashkey02k201k201k201k201k201k201k201k201k201k201k201k201",
                "fees_msat": 101
              },
              {
                "created_index": 9,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 10000202,
                "debit_msat": 0,
                "timestamp": 1758192802,
                "primary_tag": "routed",
                "payment_hash": "paymenthashkey02k201k201k201k201k201k201k201k201k201k201k201k201",
                "fees_msat": 101
              },
              {
                "created_index": 10,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 10000,
                "timestamp": 1758192802,
                "primary_tag": "routed",
                "payment_hash": "paymenthashkey03k301k301k301k301k301k301k301k301k301k301k301k301",
                "fees_msat": 1
              },
              {
                "created_index": 11,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 10001,
                "debit_msat": 0,
                "timestamp": 1758192802,
                "primary_tag": "routed",
                "payment_hash": "paymenthashkey03k301k301k301k301k301k301k301k301k301k301k301k301",
                "fees_msat": 1
              },
              {
                "created_index": 12,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 50000,
                "timestamp": 1758192802,
                "primary_tag": "routed",
                "payment_hash": "paymenthashinvl0320032003200320032003200320032003200320032003200",
                "fees_msat": 1
              },
              {
                "created_index": 13,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 50001,
                "debit_msat": 0,
                "timestamp": 1758192802,
                "primary_tag": "routed",
                "payment_hash": "paymenthashinvl0320032003200320032003200320032003200320032003200",
                "fees_msat": 1
              },
              {
                "created_index": 14,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 100000,
                "timestamp": 1758192803,
                "primary_tag": "invoice",
                "payment_hash": "paymenthashinvl0330033003300330033003300330033003300330033003300",
                "part_id": 0,
                "group_id": 1,
                "fees_msat": 0
              },
              {
                "created_index": 15,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 10001,
                "timestamp": 1758192803,
                "primary_tag": "routed",
                "payment_hash": "61b929204f4db4f38e0412b2bd4c3c03668dad3575fb05f4e15a2214046c2bff",
                "fees_msat": 1
              },
              {
                "created_index": 16,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 10002,
                "debit_msat": 0,
                "timestamp": 1758192803,
                "primary_tag": "routed",
                "payment_hash": "61b929204f4db4f38e0412b2bd4c3c03668dad3575fb05f4e15a2214046c2bff",
                "fees_msat": 1
              },
              {
                "created_index": 17,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 0,
                "debit_msat": 1000000,
                "timestamp": 1758192821,
                "primary_tag": "invoice",
                "payment_hash": "paymenthashsdinvsi10si10si10si10si10si10si10si10si10si10si10si10",
                "part_id": 0,
                "group_id": 1,
                "fees_msat": 0
              },
              {
                "created_index": 18,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 1000,
                "debit_msat": 0,
                "timestamp": 1758192821,
                "primary_tag": "invoice",
                "payment_hash": "paymenthashinvl0270027002700270027002700270027002700270027002700",
                "fees_msat": 0
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listchannelmoves#2",
            "method": "listchannelmoves",
            "params": {
              "index": "created",
              "start": 10,
              "limit": 2
            }
          },
          "response": {
            "channelmoves": [
              {
                "created_index": 10,
                "account_id": "a397dd9b3e44afcb67f3f3ce1d649b74a8ade63e35505985e4cc1828634f69a2",
                "credit_msat": 0,
                "debit_msat": 10000,
                "timestamp": 1758192802,
                "primary_tag": "routed",
                "payment_hash": "paymenthashkey03k301k301k301k301k301k301k301k301k301k301k301k301",
                "fees_msat": 1
              },
              {
                "created_index": 11,
                "account_id": "252d1b0a1e57895e84137f28cf19ab2c35847e284c112fefdecc7afeaa5c1de7",
                "credit_msat": 10001,
                "debit_msat": 0,
                "timestamp": 1758192802,
                "primary_tag": "routed",
                "payment_hash": "paymenthashkey03k301k301k301k301k301k301k301k301k301k301k301k301",
                "fees_msat": 1
              }
            ]
          }
        }
      ]
    },
    "listchannels.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listchannels",
      "title": "Command to query active lightning channels in the entire network",
      "description": [
        "The **listchannels** RPC command returns data on channels that are known to the node. Because channels may be bidirectional, up to 2 objects will be returned for each channel (one for each direction).",
        "",
        "Only one of *short_channel_id*, *source* or *destination* can be supplied. If nothing is supplied, data on all lightning channels known to this node, are returned. These can be local channels or public channels broadcast on the gossip network."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "short_channel_id": {
            "type": "short_channel_id",
            "description": [
              "If short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null."
            ]
          },
          "source": {
            "type": "pubkey",
            "description": [
              "If source is a node id, then only channels leading from that node id are returned."
            ]
          },
          "destination": {
            "type": "pubkey",
            "description": [
              "If destination is a node id, then only channels leading to that node id are returned."
            ]
          }
        }
      },
      "response": {
        "required": [
          "channels"
        ],
        "additionalProperties": false,
        "properties": {
          "channels": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "source",
                "destination",
                "short_channel_id",
                "direction",
                "public",
                "amount_msat",
                "message_flags",
                "channel_flags",
                "active",
                "last_update",
                "base_fee_millisatoshi",
                "fee_per_millionth",
                "delay",
                "htlc_minimum_msat",
                "features"
              ],
              "properties": {
                "source": {
                  "type": "pubkey",
                  "description": [
                    "The source node."
                  ]
                },
                "destination": {
                  "type": "pubkey",
                  "description": [
                    "The destination node."
                  ]
                },
                "short_channel_id": {
                  "type": "short_channel_id",
                  "description": [
                    "Short channel id of channel."
                  ]
                },
                "direction": {
                  "type": "u32",
                  "description": [
                    "Direction (0 if source < destination, 1 otherwise)."
                  ]
                },
                "public": {
                  "type": "boolean",
                  "description": [
                    "True if this is announced (from *v24.02*, being false is deprecated)."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The total capacity of this channel (always a whole number of satoshis)."
                  ]
                },
                "message_flags": {
                  "type": "u8",
                  "description": [
                    "As defined by BOLT #7."
                  ]
                },
                "channel_flags": {
                  "type": "u8",
                  "description": [
                    "As defined by BOLT #7."
                  ]
                },
                "active": {
                  "type": "boolean",
                  "description": [
                    "True unless source has disabled it (or (deprecated in *v24.02*) it's a local channel and the peer is disconnected or it's still opening or closing)."
                  ]
                },
                "last_update": {
                  "type": "u32",
                  "description": [
                    "UNIX timestamp on the last channel_update from *source*."
                  ]
                },
                "base_fee_millisatoshi": {
                  "type": "u32",
                  "description": [
                    "Base fee changed by *source* to use this channel."
                  ]
                },
                "fee_per_millionth": {
                  "type": "u32",
                  "description": [
                    "Proportional fee changed by *source* to use this channel, in parts-per-million."
                  ]
                },
                "delay": {
                  "type": "u32",
                  "description": [
                    "The number of blocks delay required by *source* to use this channel."
                  ]
                },
                "htlc_minimum_msat": {
                  "type": "msat",
                  "description": [
                    "The smallest payment *source* will allow via this channel."
                  ]
                },
                "htlc_maximum_msat": {
                  "type": "msat",
                  "description": [
                    "The largest payment *source* will allow via this channel."
                  ]
                },
                "features": {
                  "type": "hex",
                  "description": [
                    "BOLT #9 features bitmap for this channel."
                  ]
                }
              }
            }
          }
        },
        "post_return_value_notes": [
          "If one of *short_channel_id*, *source* or *destination* is supplied and no matching channels are found, a 'channels' object with an empty list is returned."
        ]
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong."
      ],
      "author": [
        "Michael Hawkins [michael.hawkins@protonmail.com](mailto:michael.hawkins@protonmail.com)."
      ],
      "see_also": [
        "lightning-fundchannel(7)",
        "lightning-listnodes(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)",
        "",
        "BOLT #7: [https://github.com/lightning/bolts/blob/master/07-routing-gossip.md](https://github.com/lightning/bolts/blob/master/07-routing-gossip.md)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listchannels#1",
            "method": "listchannels",
            "params": {
              "short_channel_id": "109x1x1"
            }
          },
          "response": {
            "channels": [
              {
                "source": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "destination": "nodeid010101010101010101010101010101010101010101010101010101010101",
                "short_channel_id": "109x1x1",
                "direction": 0,
                "public": true,
                "amount_msat": 1000000000,
                "message_flags": 1,
                "channel_flags": 0,
                "active": true,
                "last_update": 1738500000,
                "base_fee_millisatoshi": 1,
                "fee_per_millionth": 10,
                "delay": 6,
                "htlc_minimum_msat": 0,
                "htlc_maximum_msat": 990000000,
                "features": ""
              },
              {
                "source": "nodeid010101010101010101010101010101010101010101010101010101010101",
                "destination": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "short_channel_id": "109x1x1",
                "direction": 1,
                "public": true,
                "amount_msat": 1000000000,
                "message_flags": 1,
                "channel_flags": 1,
                "active": false,
                "last_update": 1738510000,
                "base_fee_millisatoshi": 1,
                "fee_per_millionth": 10,
                "delay": 6,
                "htlc_minimum_msat": 0,
                "htlc_maximum_msat": 990000000,
                "features": ""
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listchannels#2",
            "method": "listchannels",
            "params": {}
          },
          "response": {
            "channels": [
              {
                "source": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "destination": "nodeid010101010101010101010101010101010101010101010101010101010101",
                "short_channel_id": "109x1x1",
                "direction": 0,
                "public": true,
                "amount_msat": 1000000000,
                "message_flags": 1,
                "channel_flags": 0,
                "active": true,
                "last_update": 1738500000,
                "base_fee_millisatoshi": 1,
                "fee_per_millionth": 10,
                "delay": 6,
                "htlc_minimum_msat": 0,
                "htlc_maximum_msat": 990000000,
                "features": ""
              },
              {
                "source": "nodeid010101010101010101010101010101010101010101010101010101010101",
                "destination": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "short_channel_id": "109x1x1",
                "direction": 1,
                "public": true,
                "amount_msat": 1000000000,
                "message_flags": 1,
                "channel_flags": 1,
                "active": false,
                "last_update": 1738510000,
                "base_fee_millisatoshi": 1,
                "fee_per_millionth": 10,
                "delay": 6,
                "htlc_minimum_msat": 0,
                "htlc_maximum_msat": 990000000,
                "features": ""
              },
              {
                "source": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "short_channel_id": "123x1x1",
                "direction": 0,
                "public": true,
                "amount_msat": 1000000000,
                "message_flags": 1,
                "channel_flags": 2,
                "active": true,
                "last_update": 1738520000,
                "base_fee_millisatoshi": 1,
                "fee_per_millionth": 10,
                "delay": 6,
                "htlc_minimum_msat": 0,
                "htlc_maximum_msat": 990000000,
                "features": ""
              },
              {
                "source": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "destination": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "short_channel_id": "123x1x1",
                "direction": 1,
                "public": true,
                "amount_msat": 1000000000,
                "message_flags": 1,
                "channel_flags": 3,
                "active": false,
                "last_update": 1738530000,
                "base_fee_millisatoshi": 1,
                "fee_per_millionth": 10,
                "delay": 6,
                "htlc_minimum_msat": 0,
                "htlc_maximum_msat": 990000000,
                "features": ""
              },
              {
                "source": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "destination": "nodeid040404040404040404040404040404040404040404040404040404040404",
                "short_channel_id": "130x1x1",
                "direction": 0,
                "public": true,
                "amount_msat": 1000000000,
                "message_flags": 1,
                "channel_flags": 2,
                "active": true,
                "last_update": 1738540000,
                "base_fee_millisatoshi": 1,
                "fee_per_millionth": 10,
                "delay": 6,
                "htlc_minimum_msat": 0,
                "htlc_maximum_msat": 990000000,
                "features": ""
              }
            ]
          }
        }
      ]
    },
    "listclosedchannels.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.05",
      "rpc": "listclosedchannels",
      "title": "Get data on our closed historical channels",
      "description": [
        "The **listclosedchannels** RPC command returns data on channels which are otherwise forgotten (more than 100 blocks after they're completely resolved onchain)."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "If no *id* is supplied, then channel data on all historical channels are given. Supplying *id* will filter the results to only match channels to that peer. Note that prior to v23.05, old peers were forgotten."
            ]
          }
        }
      },
      "response": {
        "required": [
          "closedchannels"
        ],
        "additionalProperties": false,
        "properties": {
          "closedchannels": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "channel_id",
                "opener",
                "private",
                "total_msat",
                "total_local_commitments",
                "total_remote_commitments",
                "total_htlcs_sent",
                "funding_txid",
                "funding_outnum",
                "funding_withheld",
                "leased",
                "final_to_us_msat",
                "min_to_us_msat",
                "max_to_us_msat",
                "close_cause"
              ],
              "properties": {
                "peer_id": {
                  "type": "pubkey",
                  "description": [
                    "Peer public key (can be missing with pre-v23.05 closes!)."
                  ]
                },
                "channel_id": {
                  "type": "hash",
                  "description": [
                    "The full channel_id (funding txid Xored with output number)."
                  ]
                },
                "short_channel_id": {
                  "type": "short_channel_id",
                  "description": [
                    "The short_channel_id."
                  ]
                },
                "alias": {
                  "type": "object",
                  "required": [],
                  "additionalProperties": false,
                  "properties": {
                    "local": {
                      "type": "short_channel_id",
                      "description": [
                        "An alias assigned by this node to this channel, used for outgoing payments."
                      ]
                    },
                    "remote": {
                      "type": "short_channel_id",
                      "description": [
                        "An alias assigned by the remote node to this channel, usable in routehints and invoices."
                      ]
                    }
                  }
                },
                "opener": {
                  "type": "string",
                  "enum": [
                    "local",
                    "remote"
                  ],
                  "description": [
                    "Who initiated the channel."
                  ]
                },
                "closer": {
                  "type": "string",
                  "enum": [
                    "local",
                    "remote"
                  ],
                  "description": [
                    "Who initiated the channel close (only present if closing)."
                  ]
                },
                "private": {
                  "type": "boolean",
                  "description": [
                    "If True, we will not announce this channel."
                  ]
                },
                "channel_type": {
                  "type": "object",
                  "description": [
                    "Channel_type as negotiated with peer."
                  ],
                  "additionalProperties": false,
                  "required": [
                    "bits",
                    "names"
                  ],
                  "properties": {
                    "bits": {
                      "type": "array",
                      "description": [
                        "Each bit set in this channel_type."
                      ],
                      "items": {
                        "type": "u32",
                        "description": [
                          "Bit number."
                        ]
                      }
                    },
                    "names": {
                      "type": "array",
                      "description": [
                        "Feature name for each bit set in this channel_type. Note that *anchors_zero_fee_htlc_tx* is a deprecated synonym for *anchors*."
                      ],
                      "items": {
                        "type": "string",
                        "enum": [
                          "static_remotekey/even",
                          "anchor_outputs/even",
                          "anchors/even",
                          "anchors_zero_fee_htlc_tx/even",
                          "scid_alias/even",
                          "zeroconf/even"
                        ],
                        "description": [
                          "Name of feature bit."
                        ]
                      }
                    }
                  }
                },
                "total_local_commitments": {
                  "type": "u64",
                  "description": [
                    "Number of commitment transaction we made."
                  ]
                },
                "total_remote_commitments": {
                  "type": "u64",
                  "description": [
                    "Number of commitment transaction they made."
                  ]
                },
                "total_htlcs_sent": {
                  "type": "u64",
                  "description": [
                    "Number of HTLCs we ever sent."
                  ]
                },
                "funding_txid": {
                  "type": "txid",
                  "description": [
                    "ID of the funding transaction."
                  ]
                },
                "funding_outnum": {
                  "type": "u32",
                  "description": [
                    "The 0-based output number of the funding transaction which opens the channel."
                  ]
                },
                "funding_psbt": {
                  "type": "string",
                  "added": "v25.12",
                  "description": [
                    "The PSBT (may be non-final or unsigned) we should use to open the channel, if any"
                  ]
                },
                "funding_withheld": {
                  "type": "boolean",
                  "added": "v25.12",
                  "description": [
                    "True if we have not broadcast the funding transaction (see fundchannel_complete)."
                  ]
                },
                "leased": {
                  "type": "boolean",
                  "description": [
                    "Whether this channel was leased from `opener`."
                  ]
                },
                "funding_fee_paid_msat": {
                  "type": "msat",
                  "description": [
                    "How much we paid to lease the channel (iff `leased` is true and `opener` is local)."
                  ]
                },
                "funding_fee_rcvd_msat": {
                  "type": "msat",
                  "description": [
                    "How much they paid to lease the channel (iff `leased` is true and `opener` is remote)."
                  ]
                },
                "funding_pushed_msat": {
                  "type": "msat",
                  "description": [
                    "How much `opener` pushed immediate (if non-zero)."
                  ]
                },
                "total_msat": {
                  "type": "msat",
                  "description": [
                    "Total amount in the channel."
                  ]
                },
                "final_to_us_msat": {
                  "type": "msat",
                  "description": [
                    "Our balance in final commitment transaction."
                  ]
                },
                "min_to_us_msat": {
                  "type": "msat",
                  "description": [
                    "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain."
                  ]
                },
                "max_to_us_msat": {
                  "type": "msat",
                  "description": [
                    "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get."
                  ]
                },
                "last_commitment_txid": {
                  "type": "hash",
                  "description": [
                    "The final commitment tx's txid (or mutual close, if we accepted it). Not present for some very old, small channels pre-0.7.0."
                  ]
                },
                "last_commitment_fee_msat": {
                  "type": "msat",
                  "description": [
                    "The fee on `last_commitment_txid`."
                  ]
                },
                "close_cause": {
                  "type": "string",
                  "enum": [
                    "unknown",
                    "local",
                    "user",
                    "remote",
                    "protocol",
                    "onchain"
                  ],
                  "description": [
                    "What caused the channel to close."
                  ]
                },
                "last_stable_connection": {
                  "type": "u64",
                  "added": "v24.02",
                  "description": [
                    "Last time we reestablished the open channel and stayed connected for 1 minute."
                  ]
                }
              }
            }
          }
        }
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong."
      ],
      "author": [
        "Rusty Russell [rusty@blockstream.com](mailto:rusty@blockstream.com)."
      ],
      "see_also": [
        "lightning-listpeerchannels(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listclosedchannels#1",
            "method": "listclosedchannels",
            "params": {}
          },
          "response": {
            "closedchannels": [
              {
                "peer_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "channel_id": "channelid0230000230000230000230000230000230000230000230000230000",
                "short_channel_id": "111x1x1",
                "alias": {
                  "local": "121x131x141",
                  "remote": "151x161x171"
                },
                "opener": "local",
                "closer": "local",
                "private": false,
                "channel_type": {
                  "bits": [
                    12,
                    22
                  ],
                  "names": [
                    "static_remotekey/even",
                    "anchors/even"
                  ]
                },
                "total_local_commitments": 16,
                "total_remote_commitments": 16,
                "total_htlcs_sent": 8,
                "funding_txid": "fundingtxid00202020202020202020202020202020202020202020202020202",
                "funding_outnum": 1,
                "leased": false,
                "total_msat": 1000000000,
                "final_to_us_msat": 489809898,
                "min_to_us_msat": 489809898,
                "max_to_us_msat": 1000000000,
                "last_commitment_txid": "txidcloselastcommitment00000100001000010000100001000010000100001",
                "last_commitment_fee_msat": 2895000,
                "close_cause": "user",
                "last_stable_connection": 1738500000
              },
              {
                "peer_id": "nodeid050505050505050505050505050505050505050505050505050505050505",
                "channel_id": "channelid0250000250000250000250000250000250000250000250000250000",
                "short_channel_id": "115x1x1",
                "alias": {
                  "local": "122x132x142",
                  "remote": "152x162x172"
                },
                "opener": "local",
                "closer": "local",
                "private": true,
                "channel_type": {
                  "bits": [
                    12,
                    22
                  ],
                  "names": [
                    "static_remotekey/even",
                    "anchors/even"
                  ]
                },
                "total_local_commitments": 2,
                "total_remote_commitments": 2,
                "total_htlcs_sent": 1,
                "funding_txid": "fundingtxid00101010101010101010101010101010101010101010101010101",
                "funding_outnum": 1,
                "leased": false,
                "total_msat": 1000000000,
                "final_to_us_msat": 500000000,
                "min_to_us_msat": 500000000,
                "max_to_us_msat": 1000000000,
                "last_commitment_txid": "txidcloselastcommitment00000200002000020000200002000020000200002",
                "last_commitment_fee_msat": 2896000,
                "close_cause": "user",
                "last_stable_connection": 1738500000
              }
            ]
          }
        }
      ]
    },
    "listconfigs.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listconfigs",
      "title": "Command to list all configuration options.",
      "description": [
        "The **listconfigs** RPC command to list all configuration options, or with *config* only one."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "config": {
            "type": "string",
            "description": [
              "Configuration option name to restrict return."
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "configs": {
            "added": "v23.08",
            "type": "object",
            "comment": "Plugins can add fields to this, so we can't rule out additional properties :(",
            "additionalProperties": true,
            "required": [],
            "properties": {
              "conf": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "cmdline"
                    ],
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "developer": {
                "type": "object",
                "added": "v23.08",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "clear-plugins": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "disable-mpp": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  },
                  "plugin": {
                    "type": "string",
                    "description": [
                      "Plugin which registered this configuration setting."
                    ]
                  }
                }
              },
              "mainnet": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "regtest": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "signet": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "testnet": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "important-plugin": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "values_str",
                  "sources"
                ],
                "properties": {
                  "values_str": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Field from config or cmdline."
                      ]
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Source of configuration setting."
                      ]
                    }
                  }
                }
              },
              "plugin": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "values_str",
                  "sources"
                ],
                "properties": {
                  "values_str": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Field from config or cmdline."
                      ]
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Source of configuration setting."
                      ]
                    }
                  }
                }
              },
              "plugin-dir": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "values_str",
                  "sources"
                ],
                "properties": {
                  "values_str": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Field from config or cmdline."
                      ]
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Source of configuration setting."
                      ]
                    }
                  }
                }
              },
              "lightning-dir": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "network": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default (can also be changed by `testnet`, `signet`, `regtest` options!)."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "allow-deprecated-apis": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_bool",
                  "source"
                ],
                "properties": {
                  "value_bool": {
                    "type": "boolean",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "rpc-file": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "disable-plugin": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "values_str",
                  "sources"
                ],
                "properties": {
                  "values_str": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Field from config or cmdline."
                      ]
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Source of configuration setting."
                      ]
                    }
                  }
                }
              },
              "always-use-proxy": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_bool",
                  "source"
                ],
                "properties": {
                  "value_bool": {
                    "type": "boolean",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "daemon": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "wallet": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "large-channels": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "experimental-dual-fund": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "experimental-splicing": {
                "added": "v23.08",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "experimental-onion-messages": {
                "deprecated": [
                  "v24.08",
                  "v25.02"
                ],
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "experimental-offers": {
                "type": "object",
                "additionalProperties": false,
                "deprecated": [
                  "v24.11",
                  "v25.05"
                ],
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "experimental-shutdown-wrong-funding": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "experimental-peer-storage": {
                "added": "v23.02",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "experimental-anchors": {
                "type": "object",
                "added": "v23.08",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "database-upgrade": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_bool",
                  "source"
                ],
                "properties": {
                  "value_bool": {
                    "type": "boolean",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "rgb": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "hex",
                    "description": [
                      "Field from config or cmdline, or default."
                    ],
                    "maxLength": 6,
                    "minLength": 6
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "alias": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "pid-file": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "ignore-fee-limits": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_bool",
                  "source"
                ],
                "properties": {
                  "value_bool": {
                    "type": "boolean",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "watchtime-blocks": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "max-locktime-blocks": {
                "type": "object",
                "deprecated": [
                  "v24.05",
                  "v24.11"
                ],
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "funding-confirms": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "cltv-delta": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "cltv-final": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "commit-time": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "fee-base": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "rescan": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "integer",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "fee-per-satoshi": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "max-concurrent-htlcs": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "htlc-minimum-msat": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_msat",
                  "source"
                ],
                "properties": {
                  "value_msat": {
                    "type": "msat",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "htlc-maximum-msat": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_msat",
                  "source"
                ],
                "properties": {
                  "value_msat": {
                    "type": "msat",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "max-dust-htlc-exposure-msat": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_msat",
                  "source"
                ],
                "properties": {
                  "value_msat": {
                    "type": "msat",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "min-capacity-sat": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u64",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  },
                  "dynamic": {
                    "type": "boolean",
                    "enum": [
                      true
                    ],
                    "description": [
                      "Can this be set by setconfig()."
                    ]
                  }
                }
              },
              "addr": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "values_str",
                  "sources"
                ],
                "properties": {
                  "values_str": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Field from config or cmdline."
                      ]
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Source of configuration setting."
                      ]
                    }
                  }
                }
              },
              "announce-addr": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "values_str",
                  "sources"
                ],
                "properties": {
                  "values_str": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Field from config or cmdline."
                      ]
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Source of configuration setting."
                      ]
                    }
                  }
                }
              },
              "bind-addr": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "values_str",
                  "sources"
                ],
                "properties": {
                  "values_str": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Field from config or cmdline."
                      ]
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Source of configuration setting."
                      ]
                    }
                  }
                }
              },
              "offline": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "autolisten": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_bool",
                  "source"
                ],
                "properties": {
                  "value_bool": {
                    "type": "boolean",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "proxy": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "disable-dns": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "announce-addr-discovered": {
                "added": "v23.02",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "enum": [
                      "true",
                      "false",
                      "auto"
                    ],
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "announce-addr-discovered-port": {
                "added": "v23.02",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "encrypted-hsm": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "rpc-file-mode": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "log-level": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "log-prefix": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "log-file": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "values_str",
                  "sources"
                ],
                "properties": {
                  "values_str": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Field from config or cmdline."
                      ]
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Source of configuration setting."
                      ]
                    }
                  }
                }
              },
              "log-timestamps": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_bool",
                  "source"
                ],
                "properties": {
                  "value_bool": {
                    "type": "boolean",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "force-feerates": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "subdaemon": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "values_str",
                  "sources"
                ],
                "properties": {
                  "values_str": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Field from config or cmdline."
                      ]
                    }
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "description": [
                        "Source of configuration setting."
                      ]
                    }
                  }
                }
              },
              "fetchinvoice-noconnect": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "set",
                  "source"
                ],
                "properties": {
                  "set": {
                    "type": "boolean",
                    "description": [
                      "`true` if set in config or cmdline."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  },
                  "plugin": {
                    "added": "v23.08",
                    "type": "string",
                    "description": [
                      "Plugin which registered this configuration setting."
                    ]
                  }
                }
              },
              "tor-service-password": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_str",
                  "source"
                ],
                "properties": {
                  "value_str": {
                    "type": "string",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "announce-addr-dns": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_bool",
                  "source"
                ],
                "properties": {
                  "value_bool": {
                    "type": "boolean",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "require-confirmed-inputs": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_bool",
                  "source"
                ],
                "properties": {
                  "value_bool": {
                    "type": "boolean",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "commit-fee": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u64",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "commit-feerate-offset": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              },
              "autoconnect-seeker-peers": {
                "added": "v24.11",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "value_int",
                  "source"
                ],
                "properties": {
                  "value_int": {
                    "type": "u32",
                    "added": "v24.11",
                    "description": [
                      "Field from config or cmdline, or default."
                    ]
                  },
                  "source": {
                    "type": "string",
                    "added": "v24.11",
                    "description": [
                      "Source of configuration setting."
                    ]
                  }
                }
              }
            }
          }
        },
        "pre_return_value_notes": [
          "The returned values reflect the current configuration, including showing default values (`dev-` options are not shown unless specified as *config* explicitly).",
          "",
          "Note: as plugins can add options, not all configuration settings are listed here! The format of each entry is as follows:",
          "",
          "- **source** (string): source of configuration setting (`file`:`linenum`)",
          "- **dynamic** (boolean, optional): true if this option is settable via setconfig",
          "- **plugin** (string, optional): set if this is from a plugin",
          "",
          "Depending on the option type, exactly one of the following is present:",
          "",
          "- **set** (boolean, optional): for simple flag options",
          "- **value_str** (string, optional): for string options",
          "- **value_msat** (msat, optional): for msat options",
          "- **value_int** (integer, optional): for integer options",
          "- **value_bool** (boolean, optional): for boolean options"
        ]
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters or field with *config* name doesn't exist."
      ],
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) wrote the initial version of this man page,",
        "but many others did the hard work of actually implementing this rpc command."
      ],
      "see_also": [
        "lightning-getinfo(7)",
        "lightningd-config(5)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listconfigs#1",
            "method": "listconfigs",
            "params": {
              "config": "network"
            }
          },
          "response": {
            "configs": {
              "network": {
                "value_str": "regtest",
                "source": "cmdline"
              }
            }
          }
        },
        {
          "request": {
            "id": "example:listconfigs#2",
            "method": "listconfigs",
            "params": {
              "config": "experimental-dual-fund"
            }
          },
          "response": {
            "configs": {
              "experimental-dual-fund": {
                "set": true,
                "source": "cmdline"
              }
            }
          }
        },
        {
          "request": {
            "id": "example:listconfigs#3",
            "method": "listconfigs",
            "params": {}
          },
          "response": {
            "configs": {
              "accept-htlc-tlv-type": {
                "values_int": [],
                "sources": []
              },
              "addr": {
                "values_str": [
                  "127.0.0.1:19735"
                ],
                "sources": [
                  "cmdline"
                ]
              },
              "alias": {
                "value_str": "SILENTARTIST",
                "source": "default"
              },
              "allow-deprecated-apis": {
                "value_bool": true,
                "source": "cmdline"
              },
              "always-use-proxy": {
                "value_bool": false,
                "source": "default"
              },
              "announce-addr": {
                "values_str": [],
                "sources": []
              },
              "announce-addr-discovered": {
                "value_str": "auto",
                "source": "default"
              },
              "announce-addr-discovered-port": {
                "value_int": 19846,
                "source": "default"
              },
              "autoclean-cycle": {
                "value_int": 3600,
                "source": "default",
                "plugin": "/root/lightning/plugins/autoclean",
                "dynamic": true
              },
              "autoclean-expiredinvoices-age": {
                "value_int": 300,
                "source": "/tmp/.lightning/regtest/config.setconfig:2",
                "plugin": "/root/lightning/plugins/autoclean",
                "dynamic": true
              },
              "autoconnect-seeker-peers": {
                "value_int": 0,
                "source": "cmdline"
              },
              "autolisten": {
                "value_bool": false,
                "source": "default"
              },
              "bind-addr": {
                "values_str": [],
                "sources": []
              },
              "bitcoin-datadir": {
                "value_str": "/tmp/.lightning/",
                "source": "cmdline",
                "plugin": "/root/lightning/plugins/bcli"
              },
              "bitcoin-retry-timeout": {
                "value_int": 60,
                "source": "default",
                "plugin": "/root/lightning/plugins/bcli"
              },
              "bitcoin-rpcclienttimeout": {
                "value_int": 60,
                "source": "default",
                "plugin": "/root/lightning/plugins/bcli"
              },
              "bitcoin-rpcpassword": {
                "value_str": "rpcpass",
                "source": "cmdline",
                "plugin": "/root/lightning/plugins/bcli"
              },
              "bitcoin-rpcport": {
                "value_int": 18332,
                "source": "cmdline",
                "plugin": "/root/lightning/plugins/bcli"
              },
              "bitcoin-rpcuser": {
                "value_str": "rpcuser",
                "source": "cmdline",
                "plugin": "/root/lightning/plugins/bcli"
              },
              "clear-plugins": {
                "set": false,
                "source": "default"
              },
              "cltv-delta": {
                "value_int": 6,
                "source": "cmdline"
              },
              "cltv-final": {
                "value_int": 5,
                "source": "cmdline"
              },
              "commit-fee": {
                "value_int": 100,
                "source": "default"
              },
              "commit-feerate-offset": {
                "value_int": 5,
                "source": "default"
              },
              "commit-time": {
                "value_int": 10,
                "source": "default"
              },
              "daemon": {
                "set": false,
                "source": "default"
              },
              "dev-autoclean-max-batch": {
                "value_int": 100,
                "source": "default",
                "plugin": "/root/lightning/plugins/autoclean",
                "dynamic": true
              },
              "dev-bitcoind-poll": {
                "value_int": 3,
                "source": "cmdline"
              },
              "dev-crash-after": {
                "value_str": "3600",
                "source": "cmdline"
              },
              "dev-fail-on-subdaemon-fail": {
                "set": true,
                "source": "cmdline"
              },
              "dev-fast-gossip": {
                "set": true,
                "source": "cmdline"
              },
              "dev-hsmd-no-preapprove-check": {
                "set": true,
                "source": "cmdline"
              },
              "dev-invoice-bpath-scid": {
                "set": false,
                "source": "default",
                "plugin": "/root/lightning/plugins/offers"
              },
              "dev-no-plugin-checksum": {
                "set": true,
                "source": "cmdline"
              },
              "dev-no-version-checks": {
                "set": true,
                "source": "cmdline"
              },
              "developer": {
                "set": true,
                "source": "cmdline"
              },
              "disable-dns": {
                "set": true,
                "source": "cmdline"
              },
              "disable-mpp": {
                "set": false,
                "source": "default",
                "plugin": "/root/lightning/plugins/pay"
              },
              "disable-plugin": {
                "values_str": [],
                "sources": []
              },
              "encrypted-hsm": {
                "set": false,
                "source": "default"
              },
              "experimental-dual-fund": {
                "set": true,
                "source": "cmdline"
              },
              "experimental-quiesce": {
                "set": false,
                "source": "default"
              },
              "experimental-shutdown-wrong-funding": {
                "set": false,
                "source": "default"
              },
              "experimental-splicing": {
                "set": false,
                "source": "default"
              },
              "exposesecret-passphrase": {
                "value_str": "...",
                "source": "default",
                "plugin": "/root/lightning/plugins/exposesecret"
              },
              "fee-base": {
                "value_int": 1,
                "source": "default"
              },
              "fee-per-satoshi": {
                "value_int": 10,
                "source": "default"
              },
              "fetchinvoice-noconnect": {
                "set": false,
                "source": "default",
                "plugin": "/root/lightning/plugins/offers"
              },
              "funder-fund-probability": {
                "value_int": 100,
                "source": "default",
                "plugin": "/root/lightning/plugins/funder"
              },
              "funder-fuzz-percent": {
                "value_int": 0,
                "source": "default",
                "plugin": "/root/lightning/plugins/funder"
              },
              "funder-lease-requests-only": {
                "value_bool": true,
                "source": "default",
                "plugin": "/root/lightning/plugins/funder"
              },
              "funder-max-their-funding": {
                "value_str": "4294967295sat",
                "source": "default",
                "plugin": "/root/lightning/plugins/funder"
              },
              "funder-min-their-funding": {
                "value_str": "10000sat",
                "source": "default",
                "plugin": "/root/lightning/plugins/funder"
              },
              "funder-per-channel-max": {
                "value_str": "4294967295sat",
                "source": "default",
                "plugin": "/root/lightning/plugins/funder"
              },
              "funder-per-channel-min": {
                "value_str": "10000sat",
                "source": "default",
                "plugin": "/root/lightning/plugins/funder"
              },
              "funder-policy": {
                "value_str": "fixed",
                "source": "default",
                "plugin": "/root/lightning/plugins/funder"
              },
              "funder-policy-mod": {
                "value_str": "0",
                "source": "default",
                "plugin": "/root/lightning/plugins/funder"
              },
              "funder-reserve-tank": {
                "value_str": "0sat",
                "source": "default",
                "plugin": "/root/lightning/plugins/funder"
              },
              "funding-confirms": {
                "value_int": 1,
                "source": "default"
              },
              "grpc-host": {
                "value_str": "127.0.0.1",
                "source": "default",
                "plugin": "/root/lightning/plugins/cln-grpc"
              },
              "grpc-msg-buffer-size": {
                "value_int": 1024,
                "source": "default",
                "plugin": "/root/lightning/plugins/cln-grpc"
              },
              "grpc-port": {
                "value_int": 9736,
                "source": "cmdline",
                "plugin": "/root/lightning/plugins/cln-grpc"
              },
              "htlc-maximum-msat": {
                "value_msat": 18446744073709552000,
                "source": "default"
              },
              "htlc-minimum-msat": {
                "value_msat": 0,
                "source": "default"
              },
              "i-promise-to-fix-broken-api-user": {
                "values_str": [],
                "sources": []
              },
              "ignore-fee-limits": {
                "value_bool": false,
                "source": "cmdline"
              },
              "important-plugin": {
                "values_str": [],
                "sources": []
              },
              "invoices-onchain-fallback": {
                "set": false,
                "source": "default"
              },
              "lightning-dir": {
                "value_str": "/tmp/.lightning/",
                "source": "cmdline"
              },
              "log-file": {
                "values_str": [
                  "-",
                  "/tmp/.lightning/log"
                ],
                "sources": [
                  "cmdline",
                  "cmdline"
                ]
              },
              "log-level": {
                "value_str": "debug",
                "source": "cmdline"
              },
              "log-prefix": {
                "value_str": "lightningd-2 ",
                "source": "cmdline"
              },
              "log-timestamps": {
                "value_bool": true,
                "source": "default"
              },
              "mainnet": {
                "set": false,
                "source": "default"
              },
              "max-concurrent-htlcs": {
                "value_int": 483,
                "source": "default"
              },
              "max-dust-htlc-exposure-msat": {
                "value_msat": 50000000,
                "source": "default"
              },
              "min-capacity-sat": {
                "value_int": 500000,
                "source": "/tmp/.lightning/regtest/config.setconfig:3",
                "dynamic": true
              },
              "min-emergency-msat": {
                "value_msat": 25000000,
                "source": "default"
              },
              "network": {
                "value_str": "regtest",
                "source": "cmdline"
              },
              "offline": {
                "set": false,
                "source": "default"
              },
              "pid-file": {
                "value_str": "/tmp/.lightning/lightningd-regtest.pid",
                "source": "default"
              },
              "plugin": {
                "values_str": [],
                "sources": []
              },
              "plugin-dir": {
                "values_str": [],
                "sources": []
              },
              "regtest": {
                "set": false,
                "source": "default"
              },
              "renepay-debug-mcf": {
                "set": false,
                "source": "default",
                "plugin": "/root/lightning/plugins/cln-renepay"
              },
              "renepay-debug-payflow": {
                "set": false,
                "source": "default",
                "plugin": "/root/lightning/plugins/cln-renepay"
              },
              "require-confirmed-inputs": {
                "value_bool": false,
                "source": "default"
              },
              "rescan": {
                "value_int": 1,
                "source": "cmdline"
              },
              "rgb": {
                "value_str": "022d22",
                "source": "default"
              },
              "rpc-file": {
                "value_str": "lightning-rpc",
                "source": "default"
              },
              "rpc-file-mode": {
                "value_str": "0600",
                "source": "default"
              },
              "signet": {
                "set": false,
                "source": "default"
              },
              "subdaemon": {
                "values_str": [],
                "sources": []
              },
              "testnet": {
                "set": false,
                "source": "default"
              },
              "testnet4": {
                "set": false,
                "source": "default"
              },
              "watchtime-blocks": {
                "value_int": 5,
                "source": "cmdline"
              },
              "xpay-handle-pay": {
                "value_bool": false,
                "source": "default",
                "plugin": "/root/lightning/plugins/cln-xpay",
                "dynamic": true
              },
              "xpay-slow-mode": {
                "value_bool": false,
                "source": "default",
                "plugin": "/root/lightning/plugins/cln-xpay",
                "dynamic": true
              }
            }
          }
        }
      ]
    },
    "listdatastore.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listdatastore",
      "title": "Command for listing (plugin) data",
      "description": [
        "The **listdatastore** RPC command allows plugins to fetch data which was stored in the Core Lightning database."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "key": {
            "oneOf": [
              {
                "type": "array",
                "description": [
                  "All immediate children of the *key* (or root children) are returned.",
                  "    Using the first element of the key as the plugin name (e.g. `[ 'summary' ]`) is recommended.",
                  "    An array of values to form a hierarchy (though a single value is treated as a one-element array)."
                ],
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              }
            ]
          }
        }
      },
      "response": {
        "required": [
          "datastore"
        ],
        "additionalProperties": false,
        "properties": {
          "datastore": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "key"
              ],
              "properties": {
                "key": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": [
                      "Part of the key added to the datastore."
                    ]
                  }
                },
                "generation": {
                  "type": "u64",
                  "description": [
                    "The number of times this has been updated."
                  ]
                },
                "hex": {
                  "type": "hex",
                  "description": [
                    "The hex data from the datastore."
                  ]
                },
                "string": {
                  "type": "string",
                  "description": [
                    "The data as a string, if it's valid utf-8."
                  ]
                }
              }
            }
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -32602: invalid parameters."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-datastore(7)",
        "lightning-deldatastore(7)",
        "lightning-datastoreusage(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listdatastore#1",
            "method": "listdatastore",
            "params": {
              "key": [
                "employee"
              ]
            }
          },
          "response": {
            "datastore": [
              {
                "key": [
                  "employee",
                  "index"
                ],
                "generation": 0,
                "hex": "736176696e6720656d706c6f796565206b65797320746f207468652073746f7265",
                "string": "saving employee keys to the store"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listdatastore#2",
            "method": "listdatastore",
            "params": {
              "key": "somekey"
            }
          },
          "response": {
            "datastore": [
              {
                "key": [
                  "somekey"
                ],
                "generation": 0,
                "hex": "61",
                "string": "a"
              }
            ]
          }
        }
      ]
    },
    "listforwards.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listforwards",
      "title": "Command showing all htlcs and their information",
      "description": [
        "The **listforwards** RPC command displays all htlcs that have been attempted to be forwarded by the Core Lightning node."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "status": {
            "type": "string",
            "description": [
              "If specified, then only the forwards with the given status are returned."
            ],
            "enum": [
              "offered",
              "settled",
              "local_failed",
              "failed"
            ]
          },
          "in_channel": {
            "type": "short_channel_id",
            "description": [
              "Only the matching forwards on the given inbound channel are returned."
            ]
          },
          "out_channel": {
            "type": "short_channel_id",
            "description": [
              "Only the matching forwards on the given outbount channel are returned."
            ]
          },
          "index": {
            "type": "string",
            "added": "v23.11",
            "enum": [
              "created",
              "updated"
            ],
            "description": [
              "If neither *in_channel* nor *out_channel* is specified, it controls ordering."
            ],
            "default": "`created`"
          },
          "start": {
            "type": "u64",
            "added": "v23.11",
            "description": [
              "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)."
            ]
          },
          "limit": {
            "type": "u32",
            "added": "v23.11",
            "description": [
              "If `index` is specified, `limit` can be used to specify the maximum number of entries to return."
            ]
          }
        },
        "dependentUpon": {
          "index": [
            "start",
            "limit"
          ]
        }
      },
      "response": {
        "required": [
          "forwards"
        ],
        "additionalProperties": false,
        "properties": {
          "forwards": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "created_index",
                "in_channel",
                "in_msat",
                "status",
                "received_time"
              ],
              "properties": {
                "created_index": {
                  "added": "v23.11",
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this forward was created in."
                  ]
                },
                "in_channel": {
                  "type": "short_channel_id",
                  "description": [
                    "The channel that received the HTLC."
                  ]
                },
                "in_htlc_id": {
                  "type": "u64",
                  "description": [
                    "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)."
                  ]
                },
                "in_msat": {
                  "type": "msat",
                  "description": [
                    "The value of the incoming HTLC."
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "offered",
                    "settled",
                    "local_failed",
                    "failed"
                  ],
                  "description": [
                    "Still ongoing, completed, failed locally, or failed after forwarding."
                  ]
                },
                "received_time": {
                  "type": "number",
                  "description": [
                    "The UNIX timestamp when this was received (may be zero for old forwards)."
                  ]
                },
                "out_channel": {
                  "type": "short_channel_id",
                  "description": [
                    "The channel that the HTLC (trying to) forward to."
                  ]
                },
                "out_htlc_id": {
                  "type": "u64",
                  "description": [
                    "The unique HTLC id we gave this when sending (may be missing even if out_channel is present, for old forwards before v22.11)."
                  ]
                },
                "updated_index": {
                  "added": "v23.11",
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this forward was changed (only present if it has changed since creation)."
                  ]
                },
                "style": {
                  "type": "string",
                  "enum": [
                    "legacy",
                    "tlv"
                  ],
                  "description": [
                    "Either a legacy onion format or a modern tlv format."
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "required": [
                      "out_msat"
                    ]
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "fee_msat",
                      "out_msat",
                      "out_channel"
                    ],
                    "properties": {
                      "created_index": {},
                      "updated_index": {},
                      "in_channel": {},
                      "in_htlc_id": {},
                      "in_msatoshi": {},
                      "in_msat": {},
                      "status": {},
                      "style": {},
                      "received_time": {},
                      "resolved_time": {},
                      "out_channel": {},
                      "out_htlc_id": {},
                      "failcode": {},
                      "failreason": {},
                      "fee_msat": {
                        "type": "msat",
                        "description": [
                          "The amount this paid in fees."
                        ]
                      },
                      "out_msat": {
                        "type": "msat",
                        "description": [
                          "The amount we sent out the *out_channel*."
                        ]
                      }
                    }
                  },
                  "else": {
                    "additionalProperties": false,
                    "required": [],
                    "properties": {
                      "created_index": {},
                      "updated_index": {},
                      "in_channel": {},
                      "in_htlc_id": {},
                      "in_msatoshi": {},
                      "in_msat": {},
                      "status": {},
                      "style": {},
                      "received_time": {},
                      "resolved_time": {},
                      "failcode": {},
                      "failreason": {},
                      "out_channel": {}
                    }
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "settled",
                          "failed"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "resolved_time"
                    ],
                    "properties": {
                      "created_index": {},
                      "updated_index": {},
                      "in_channel": {},
                      "in_htlc_id": {},
                      "in_msatoshi": {},
                      "in_msat": {},
                      "status": {},
                      "style": {},
                      "received_time": {},
                      "out_channel": {},
                      "out_htlc_id": {},
                      "fee": {},
                      "fee_msat": {},
                      "out_msatoshi": {},
                      "out_msat": {},
                      "failcode": {},
                      "failreason": {},
                      "resolved_time": {
                        "type": "number",
                        "description": [
                          "The UNIX timestamp when this was resolved."
                        ]
                      }
                    }
                  },
                  "else": {
                    "additionalProperties": false,
                    "properties": {
                      "created_index": {},
                      "updated_index": {},
                      "in_channel": {},
                      "in_htlc_id": {},
                      "in_msatoshi": {},
                      "in_msat": {},
                      "status": {},
                      "style": {},
                      "received_time": {},
                      "out_channel": {},
                      "out_htlc_id": {},
                      "fee": {},
                      "fee_msat": {},
                      "failcode": {},
                      "failreason": {},
                      "out_msatoshi": {},
                      "out_msat": {}
                    }
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "local_failed",
                          "failed"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [],
                    "properties": {
                      "created_index": {},
                      "updated_index": {},
                      "in_channel": {},
                      "in_htlc_id": {},
                      "in_msatoshi": {},
                      "in_msat": {},
                      "status": {},
                      "style": {},
                      "received_time": {},
                      "out_channel": {},
                      "out_htlc_id": {},
                      "fee": {},
                      "fee_msat": {},
                      "out_msatoshi": {},
                      "out_msat": {},
                      "resolved_time": {},
                      "failcode": {
                        "type": "u32",
                        "description": [
                          "The numeric onion code returned."
                        ]
                      },
                      "failreason": {
                        "type": "string",
                        "description": [
                          "The name of the onion code returned."
                        ]
                      }
                    }
                  },
                  "else": {
                    "additionalProperties": false,
                    "required": [],
                    "properties": {
                      "created_index": {},
                      "updated_index": {},
                      "in_channel": {},
                      "in_htlc_id": {},
                      "in_msatoshi": {},
                      "in_msat": {},
                      "status": {},
                      "style": {},
                      "received_time": {},
                      "out_channel": {},
                      "out_htlc_id": {},
                      "fee": {},
                      "fee_msat": {},
                      "out_msatoshi": {},
                      "out_msat": {},
                      "resolved_time": {}
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "author": [
        "Rene Pickhardt [r.pickhardt@gmail.com](mailto:r.pickhardt@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-autoclean-status(7)",
        "lightning-getinfo(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listforwards#1",
            "method": "listforwards",
            "params": {
              "in_channel": "109x1x1",
              "out_channel": "123x1x1",
              "status": "settled"
            }
          },
          "response": {
            "forwards": [
              {
                "created_index": 12,
                "updated_index": 7,
                "in_channel": "109x1x1",
                "in_htlc_id": 19,
                "out_channel": "123x1x1",
                "out_htlc_id": 2,
                "in_msat": 50000501,
                "out_msat": 50000000,
                "fee_msat": 501,
                "status": "settled",
                "style": "tlv",
                "received_time": 1738000000,
                "resolved_time": 1738500000
              },
              {
                "created_index": 13,
                "updated_index": 8,
                "in_channel": "109x1x1",
                "in_htlc_id": 20,
                "out_channel": "123x1x1",
                "out_htlc_id": 3,
                "in_msat": 50000501,
                "out_msat": 50000000,
                "fee_msat": 501,
                "status": "settled",
                "style": "tlv",
                "received_time": 1738010000,
                "resolved_time": 1738510000
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listforwards#2",
            "method": "listforwards",
            "params": {}
          },
          "response": {
            "forwards": [
              {
                "created_index": 1,
                "updated_index": 1,
                "in_channel": "109x1x1",
                "in_htlc_id": 1,
                "out_channel": "111x1x1",
                "out_htlc_id": 1,
                "in_msat": 10001,
                "out_msat": 10000,
                "fee_msat": 1,
                "status": "settled",
                "style": "tlv",
                "received_time": 1738000000,
                "resolved_time": 1738500000
              },
              {
                "created_index": 2,
                "updated_index": 2,
                "in_channel": "109x1x1",
                "in_htlc_id": 2,
                "out_channel": "111x1x1",
                "out_htlc_id": 2,
                "in_msat": 10001,
                "out_msat": 10000,
                "fee_msat": 1,
                "status": "settled",
                "style": "tlv",
                "received_time": 1738010000,
                "resolved_time": 1738510000
              },
              {
                "created_index": 3,
                "updated_index": 3,
                "in_channel": "109x1x1",
                "in_htlc_id": 3,
                "out_channel": "111x1x1",
                "out_htlc_id": 3,
                "in_msat": 10000202,
                "out_msat": 10000101,
                "fee_msat": 101,
                "status": "settled",
                "style": "tlv",
                "received_time": 1738020000,
                "resolved_time": 1738520000
              },
              {
                "created_index": 5,
                "updated_index": 4,
                "in_channel": "109x1x1",
                "in_htlc_id": 5,
                "out_channel": "111x1x1",
                "out_htlc_id": 4,
                "in_msat": 10001,
                "out_msat": 10000,
                "fee_msat": 1,
                "status": "settled",
                "style": "tlv",
                "received_time": 1738030000,
                "resolved_time": 1738530000
              },
              {
                "created_index": 6,
                "updated_index": 5,
                "in_channel": "109x1x1",
                "in_htlc_id": 6,
                "out_channel": "111x1x1",
                "out_htlc_id": 5,
                "in_msat": 50001,
                "out_msat": 50000,
                "fee_msat": 1,
                "status": "settled",
                "style": "tlv",
                "received_time": 1738040000,
                "resolved_time": 1738540000
              }
            ]
          }
        }
      ]
    },
    "listfunds.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listfunds",
      "title": "Command showing all funds currently managed by the Core Lightning node",
      "description": [
        "The **listfunds** RPC command displays all funds available, either in unspent outputs (UTXOs) in the internal wallet or funds locked in currently open channels."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "spent": {
            "type": "boolean",
            "description": [
              "If True, then the *outputs* will include spent outputs in addition to the unspent ones."
            ],
            "default": "False"
          }
        }
      },
      "response": {
        "required": [
          "outputs",
          "channels"
        ],
        "additionalProperties": false,
        "properties": {
          "outputs": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "txid",
                "output",
                "amount_msat",
                "scriptpubkey",
                "status",
                "reserved"
              ],
              "properties": {
                "txid": {
                  "type": "txid",
                  "description": [
                    "The ID of the spendable transaction."
                  ]
                },
                "output": {
                  "type": "u32",
                  "description": [
                    "The index within *txid*."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount of the output."
                  ]
                },
                "scriptpubkey": {
                  "type": "hex",
                  "description": [
                    "The scriptPubkey of the output."
                  ]
                },
                "address": {
                  "type": "string",
                  "description": [
                    "The bitcoin address of the output."
                  ]
                },
                "redeemscript": {
                  "type": "hex",
                  "description": [
                    "The redeemscript, only if it's p2sh-wrapped."
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "unconfirmed",
                    "confirmed",
                    "spent",
                    "immature"
                  ]
                },
                "reserved": {
                  "type": "boolean",
                  "description": [
                    "Whether this UTXO is currently reserved for an in-flight tx."
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "confirmed"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "blockheight"
                    ],
                    "properties": {
                      "txid": {},
                      "output": {},
                      "amount_msat": {},
                      "scriptpubkey": {},
                      "address": {},
                      "value": {},
                      "redeemscript": {},
                      "status": {},
                      "reserved": {},
                      "reserved_to_block": {},
                      "blockheight": {
                        "type": "u32",
                        "description": [
                          "Block height where it was confirmed."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "reserved": {
                        "type": "boolean",
                        "enum": [
                          "true"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "reserved_to_block"
                    ],
                    "properties": {
                      "txid": {},
                      "output": {},
                      "amount_msat": {},
                      "scriptpubkey": {},
                      "address": {},
                      "value": {},
                      "redeemscript": {},
                      "status": {},
                      "blockheight": {},
                      "reserved": {},
                      "reserved_to_block": {
                        "type": "u32",
                        "description": [
                          "Block height where reservation will expire."
                        ]
                      }
                    }
                  }
                }
              ]
            }
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "peer_id",
                "our_amount_msat",
                "amount_msat",
                "funding_txid",
                "funding_output",
                "connected",
                "state",
                "channel_id"
              ],
              "properties": {
                "peer_id": {
                  "type": "pubkey",
                  "description": [
                    "The peer with which the channel is opened."
                  ]
                },
                "our_amount_msat": {
                  "type": "msat",
                  "description": [
                    "Available satoshis on our node's end of the channel."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "Total channel value."
                  ]
                },
                "funding_txid": {
                  "type": "txid",
                  "description": [
                    "Funding transaction id."
                  ]
                },
                "funding_output": {
                  "type": "u32",
                  "description": [
                    "The 0-based index of the output in the funding transaction."
                  ]
                },
                "connected": {
                  "type": "boolean",
                  "description": [
                    "Whether the channel peer is connected."
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "OPENINGD",
                    "CHANNELD_AWAITING_LOCKIN",
                    "CHANNELD_NORMAL",
                    "CHANNELD_SHUTTING_DOWN",
                    "CLOSINGD_SIGEXCHANGE",
                    "CLOSINGD_COMPLETE",
                    "AWAITING_UNILATERAL",
                    "FUNDING_SPEND_SEEN",
                    "ONCHAIN",
                    "DUALOPEND_OPEN_INIT",
                    "DUALOPEND_AWAITING_LOCKIN",
                    "CHANNELD_AWAITING_SPLICE",
                    "DUALOPEND_OPEN_COMMITTED",
                    "DUALOPEND_OPEN_COMMIT_READY"
                  ],
                  "description": [
                    "The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally."
                  ]
                },
                "channel_id": {
                  "type": "hash",
                  "description": [
                    "The full channel_id (funding txid Xored with output number)."
                  ],
                  "added": "v23.05"
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "state": {
                        "type": "string",
                        "enum": [
                          "CHANNELD_NORMAL"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "short_channel_id"
                    ],
                    "properties": {
                      "peer_id": {},
                      "our_amount_msat": {},
                      "channel_sat": {},
                      "amount_msat": {},
                      "channel_total_sat": {},
                      "funding_txid": {},
                      "funding_output": {},
                      "connected": {},
                      "state": {},
                      "channel_id": {},
                      "short_channel_id": {
                        "type": "short_channel_id",
                        "description": [
                          "Short channel id of channel."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "state": {
                        "type": "string",
                        "enum": [
                          "CHANNELD_SHUTTING_DOWN",
                          "CLOSINGD_SIGEXCHANGE",
                          "CLOSINGD_COMPLETE",
                          "AWAITING_UNILATERAL",
                          "FUNDING_SPEND_SEEN",
                          "ONCHAIN"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [],
                    "properties": {
                      "peer_id": {},
                      "our_amount_msat": {},
                      "channel_sat": {},
                      "amount_msat": {},
                      "channel_total_sat": {},
                      "funding_txid": {},
                      "funding_output": {},
                      "connected": {},
                      "state": {},
                      "channel_id": {},
                      "short_channel_id": {
                        "type": "short_channel_id",
                        "description": [
                          "Short channel id of channel (only if funding reached lockin depth before closing)."
                        ]
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "author": [
        "Felix [fixone@gmail.com](mailto:fixone@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-newaddr(7)",
        "lightning-fundchannel(7)",
        "lightning-withdraw(7)",
        "lightning-listtransactions(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listfunds#1",
            "method": "listfunds",
            "params": {}
          },
          "response": {
            "outputs": [
              {
                "txid": "txid000010000100001000010000100001000010000100001000010000100001",
                "output": 2,
                "amount_msat": 26000000,
                "scriptpubkey": "scriptpubkey01010101010101010101010101010101010101010101010101010101",
                "address": "bcrt1p0004040404040404040404040404040404040404040404040404040404",
                "status": "confirmed",
                "blockheight": 160,
                "reserved": false
              },
              {
                "txid": "txid000020000200002000020000200002000020000200002000020000200002",
                "output": 3,
                "amount_msat": 27000000,
                "scriptpubkey": "scriptpubkey02020202020202020202020202020202020202020202020202020202",
                "address": "bcrt1p0004040404040404040404040404040404040404040404040404040404",
                "status": "confirmed",
                "blockheight": 160,
                "reserved": false
              },
              {
                "txid": "txid000030000300003000030000300003000030000300003000030000300003",
                "output": 4,
                "amount_msat": 28000000,
                "scriptpubkey": "scriptpubkey03030303030303030303030303030303030303030303030303030303",
                "address": "bcrt1p0004040404040404040404040404040404040404040404040404040404",
                "status": "confirmed",
                "blockheight": 160,
                "reserved": false
              }
            ],
            "channels": [
              {
                "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "connected": true,
                "state": "CHANNELD_NORMAL",
                "channel_id": "channelid0120000120000120000120000120000120000120000120000120000",
                "short_channel_id": "109x1x1",
                "our_amount_msat": 36000000,
                "amount_msat": 11000000,
                "funding_txid": "txid010010100101001010010100101001010010100101001010010100101001",
                "funding_output": 1
              },
              {
                "peer_id": "nodeid050505050505050505050505050505050505050505050505050505050505",
                "connected": false,
                "state": "ONCHAIN",
                "channel_id": "channelid1300013000130001300013000130001300013000130001300013000",
                "our_amount_msat": 37000000,
                "amount_msat": 12000000,
                "funding_txid": "txid010020100201002010020100201002010020100201002010020100201002",
                "funding_output": 2
              },
              {
                "peer_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "connected": false,
                "state": "ONCHAIN",
                "channel_id": "channelid1100011000110001100011000110001100011000110001100011000",
                "our_amount_msat": 38000000,
                "amount_msat": 13000000,
                "funding_txid": "txid010030100301003010030100301003010030100301003010030100301003",
                "funding_output": 3
              }
            ]
          }
        }
      ]
    },
    "listhtlcs.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listhtlcs",
      "title": "Command for querying HTLCs",
      "description": [
        "The **listhtlcs** RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed long ago)."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": [
              "A short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)."
            ]
          },
          "index": {
            "type": "string",
            "added": "v25.05",
            "enum": [
              "created",
              "updated"
            ],
            "description": [
              "This controls the ordering of results."
            ],
            "default": "`created`"
          },
          "start": {
            "type": "u64",
            "added": "v25.05",
            "description": [
              "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)."
            ]
          },
          "limit": {
            "type": "u32",
            "added": "v25.05",
            "description": [
              "If `index` is specified, `limit` can be used to specify the maximum number of entries to return."
            ]
          }
        }
      },
      "response": {
        "required": [
          "htlcs"
        ],
        "additionalProperties": false,
        "properties": {
          "htlcs": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "created_index",
                "short_channel_id",
                "id",
                "expiry",
                "direction",
                "amount_msat",
                "payment_hash",
                "state"
              ],
              "properties": {
                "short_channel_id": {
                  "type": "short_channel_id",
                  "description": [
                    "The channel that contains/contained the HTLC."
                  ]
                },
                "created_index": {
                  "added": "v25.05",
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this htlc was created in."
                  ]
                },
                "updated_index": {
                  "added": "v25.05",
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this htlc was changed (only present if it has changed since creation)."
                  ]
                },
                "id": {
                  "type": "u64",
                  "description": [
                    "The unique, incrementing HTLC id the creator gave this."
                  ]
                },
                "expiry": {
                  "type": "u32",
                  "description": [
                    "The block number where this HTLC expires/expired."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The value of the HTLC."
                  ]
                },
                "direction": {
                  "type": "string",
                  "enum": [
                    "out",
                    "in"
                  ],
                  "description": [
                    "Out if we offered this to the peer, in if they offered it."
                  ]
                },
                "payment_hash": {
                  "type": "hash",
                  "description": [
                    "Payment hash sought by HTLC."
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "SENT_ADD_HTLC",
                    "SENT_ADD_COMMIT",
                    "RCVD_ADD_REVOCATION",
                    "RCVD_ADD_ACK_COMMIT",
                    "SENT_ADD_ACK_REVOCATION",
                    "RCVD_REMOVE_HTLC",
                    "RCVD_REMOVE_COMMIT",
                    "SENT_REMOVE_REVOCATION",
                    "SENT_REMOVE_ACK_COMMIT",
                    "RCVD_REMOVE_ACK_REVOCATION",
                    "RCVD_ADD_HTLC",
                    "RCVD_ADD_COMMIT",
                    "SENT_ADD_REVOCATION",
                    "SENT_ADD_ACK_COMMIT",
                    "RCVD_ADD_ACK_REVOCATION",
                    "SENT_REMOVE_HTLC",
                    "SENT_REMOVE_COMMIT",
                    "RCVD_REMOVE_REVOCATION",
                    "RCVD_REMOVE_ACK_COMMIT",
                    "SENT_REMOVE_ACK_REVOCATION"
                  ],
                  "description": [
                    "The first 10 states are for `out`, the next 10 are for `in`."
                  ]
                }
              }
            }
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listforwards(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listhtlcs#1",
            "method": "listhtlcs",
            "params": [
              "109x1x1"
            ]
          },
          "response": {
            "htlcs": [
              {
                "created_index": 1,
                "updated_index": 9,
                "short_channel_id": "109x1x1",
                "id": 0,
                "expiry": 126,
                "direction": "out",
                "amount_msat": 500000000,
                "payment_hash": "paymenthashdelpay10101010101010101010101010101010101010101010101",
                "state": "RCVD_REMOVE_ACK_REVOCATION"
              },
              {
                "created_index": 2,
                "updated_index": 18,
                "short_channel_id": "109x1x1",
                "id": 1,
                "expiry": 135,
                "direction": "out",
                "amount_msat": 10001,
                "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
                "state": "RCVD_REMOVE_ACK_REVOCATION"
              },
              {
                "created_index": 3,
                "updated_index": 27,
                "short_channel_id": "109x1x1",
                "id": 2,
                "expiry": 149,
                "direction": "out",
                "amount_msat": 10001,
                "payment_hash": "paymenthashkey01k101k101k101k101k101k101k101k101k101k101k101k101",
                "state": "RCVD_REMOVE_ACK_REVOCATION"
              },
              {
                "created_index": 4,
                "updated_index": 36,
                "short_channel_id": "109x1x1",
                "id": 3,
                "expiry": 155,
                "direction": "out",
                "amount_msat": 10000202,
                "payment_hash": "paymenthashkey02k201k201k201k201k201k201k201k201k201k201k201k201",
                "state": "RCVD_REMOVE_ACK_REVOCATION"
              },
              {
                "created_index": 5,
                "updated_index": 44,
                "short_channel_id": "109x1x1",
                "id": 4,
                "expiry": 152,
                "direction": "out",
                "amount_msat": 10001,
                "payment_hash": "paymenthashkey03k301k301k301k301k301k301k301k301k301k301k301k301",
                "state": "RCVD_REMOVE_ACK_REVOCATION"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listhtlcs#2",
            "method": "listhtlcs",
            "params": {
              "index": "created",
              "start": 4,
              "limit": 1
            }
          },
          "response": {
            "htlcs": [
              {
                "created_index": 4,
                "updated_index": 36,
                "short_channel_id": "109x1x1",
                "id": 3,
                "expiry": 155,
                "direction": "out",
                "amount_msat": 10000202,
                "payment_hash": "paymenthashkey02k201k201k201k201k201k201k201k201k201k201k201k201",
                "state": "RCVD_REMOVE_ACK_REVOCATION"
              }
            ]
          }
        }
      ]
    },
    "listinvoicerequests.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v22.11",
      "rpc": "listinvoicerequests",
      "title": "Command for querying invoice_request status",
      "description": [
        "The **listinvoicerequests** RPC command gets the status of a specific `invoice_request`, if it exists, or the status of all `invoice_requests` if given no argument."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "invreq_id": {
            "type": "string",
            "description": [
              "A specific invoice can be queried by providing the `invreq_id`, which is presented by lightning-invoicerequest(7), or can be calculated from a bolt12 invoice."
            ]
          },
          "active_only": {
            "type": "boolean",
            "description": [
              "If it is *True* then only active invoice requests are returned."
            ],
            "default": "*False*"
          }
        }
      },
      "response": {
        "required": [
          "invoicerequests"
        ],
        "additionalProperties": false,
        "properties": {
          "invoicerequests": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "invreq_id",
                "single_use",
                "active",
                "bolt12",
                "used"
              ],
              "properties": {
                "invreq_id": {
                  "type": "hash",
                  "description": [
                    "The SHA256 hash of all invoice_request fields less than 160."
                  ]
                },
                "active": {
                  "type": "boolean",
                  "description": [
                    "Whether the invoice_request is currently active."
                  ]
                },
                "single_use": {
                  "type": "boolean",
                  "description": [
                    "Whether the invoice_request will become inactive after we pay an invoice for it."
                  ]
                },
                "bolt12": {
                  "type": "string",
                  "description": [
                    "The bolt12 string starting with lnr."
                  ]
                },
                "used": {
                  "type": "boolean",
                  "description": [
                    "Whether the invoice_request has already been used."
                  ]
                },
                "label": {
                  "type": "string",
                  "description": [
                    "The label provided when creating the invoice_request."
                  ]
                }
              }
            }
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-invoicerequests(7)",
        "lightning-disableinvoicerequest(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listinvoicerequests#1",
            "method": "listinvoicerequests",
            "params": [
              "invreqid03030303030303030303030303030303030303030303030303030303"
            ]
          },
          "response": {
            "invoicerequests": [
              {
                "invreq_id": "invreqid02020202020202020202020202020202020202020202020202020202",
                "active": false,
                "single_use": true,
                "bolt12": "lno1qgsq000bolt240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000",
                "used": false
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listinvoicerequests#2",
            "method": "listinvoicerequests",
            "params": {}
          },
          "response": {
            "invoicerequests": [
              {
                "invreq_id": "invreqid02020202020202020202020202020202020202020202020202020202",
                "active": false,
                "single_use": true,
                "bolt12": "lno1qgsq000bolt240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000240002400024000",
                "used": false
              },
              {
                "invreq_id": "invreqid01010101010101010101010101010101010101010101010101010101",
                "active": false,
                "single_use": true,
                "bolt12": "lno1qgsq000bolt210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000",
                "used": true
              }
            ]
          }
        }
      ]
    },
    "listinvoices.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listinvoices",
      "title": "Command for querying invoice status",
      "description": [
        "The **listinvoices** RPC command gets the status of a specific invoice, if it exists, or the status of all invoices if given no argument.",
        "",
        "Only one of the query parameters can be used from *label*, *invstring*, *payment_hash*, or *offer_id*."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "label": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ],
            "description": [
              "A label used a the creation of the invoice to get a specific invoice."
            ]
          },
          "invstring": {
            "type": "string",
            "description": [
              "The string value to query a specific invoice."
            ]
          },
          "payment_hash": {
            "type": "hex",
            "description": [
              "A payment_hash of the invoice to get the details of a specific invoice."
            ]
          },
          "offer_id": {
            "type": "string",
            "description": [
              "A local `offer_id` the invoice was issued for a specific invoice details."
            ]
          },
          "index": {
            "type": "string",
            "added": "v23.08",
            "enum": [
              "created",
              "updated"
            ],
            "description": [
              "If neither *in_channel* nor *out_channel* is specified, it controls ordering."
            ],
            "default": "`created`"
          },
          "start": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)."
            ]
          },
          "limit": {
            "type": "u32",
            "added": "v23.08",
            "description": [
              "If `index` is specified, `limit` can be used to specify the maximum number of entries to return."
            ]
          }
        },
        "dependentUpon": {
          "index": [
            "start",
            "limit"
          ]
        }
      },
      "response": {
        "required": [
          "invoices"
        ],
        "additionalProperties": false,
        "properties": {
          "invoices": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "label",
                "created_index",
                "payment_hash",
                "status",
                "expires_at"
              ],
              "properties": {
                "label": {
                  "type": "string",
                  "description": [
                    "Unique label supplied at invoice creation."
                  ]
                },
                "description": {
                  "type": "string",
                  "description": [
                    "Description used in the invoice."
                  ]
                },
                "payment_hash": {
                  "type": "hash",
                  "description": [
                    "The hash of the *payment_preimage* which will prove payment."
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "unpaid",
                    "paid",
                    "expired"
                  ],
                  "description": [
                    "Whether it's paid, unpaid or unpayable."
                  ]
                },
                "expires_at": {
                  "type": "u64",
                  "description": [
                    "UNIX timestamp of when it will become / became unpayable."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount required to pay this invoice."
                  ]
                },
                "bolt11": {
                  "type": "string",
                  "description": [
                    "The BOLT11 string (always present unless *bolt12* is)."
                  ]
                },
                "bolt12": {
                  "type": "string",
                  "description": [
                    "The BOLT12 string (always present unless *bolt11* is)."
                  ]
                },
                "local_offer_id": {
                  "type": "hash",
                  "description": [
                    "The *id* of our offer which created this invoice."
                  ]
                },
                "invreq_payer_note": {
                  "type": "string",
                  "description": [
                    "The optional *invreq_payer_note* from invoice_request which created this invoice."
                  ]
                },
                "created_index": {
                  "type": "u64",
                  "added": "v23.08",
                  "description": [
                    "1-based index indicating order this invoice was created in."
                  ]
                },
                "updated_index": {
                  "type": "u64",
                  "added": "v23.08",
                  "description": [
                    "1-based index indicating order this invoice was changed (only present if it has changed since creation)."
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "paid"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "pay_index",
                      "amount_received_msat",
                      "paid_at",
                      "payment_preimage"
                    ],
                    "properties": {
                      "label": {},
                      "description": {},
                      "payment_hash": {},
                      "status": {},
                      "msatoshi": {},
                      "amount_msat": {},
                      "bolt11": {},
                      "bolt12": {},
                      "local_offer_id": {},
                      "invreq_payer_note": {},
                      "expires_at": {},
                      "created_index": {},
                      "updated_index": {},
                      "pay_index": {
                        "type": "u64",
                        "description": [
                          "Unique incrementing index for this payment."
                        ]
                      },
                      "amount_received_msat": {
                        "type": "msat",
                        "description": [
                          "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)."
                        ]
                      },
                      "paid_at": {
                        "type": "u64",
                        "description": [
                          "UNIX timestamp of when it was paid."
                        ]
                      },
                      "paid_outpoint": {
                        "type": "object",
                        "description": [
                          "Outpoint this invoice was paid with."
                        ],
                        "added": "v23.11",
                        "additionalProperties": false,
                        "required": [
                          "txid",
                          "outnum"
                        ],
                        "properties": {
                          "txid": {
                            "added": "v23.11",
                            "type": "txid",
                            "description": [
                              "ID of the transaction that paid the invoice."
                            ]
                          },
                          "outnum": {
                            "added": "v23.11",
                            "type": "u32",
                            "description": [
                              "The 0-based output number of the transaction that paid the invoice."
                            ]
                          }
                        }
                      },
                      "payment_preimage": {
                        "type": "secret",
                        "description": [
                          "Proof of payment."
                        ]
                      }
                    }
                  },
                  "else": {
                    "additionalProperties": false,
                    "properties": {
                      "label": {},
                      "description": {},
                      "payment_hash": {},
                      "status": {},
                      "msatoshi": {},
                      "amount_msat": {},
                      "bolt11": {},
                      "bolt12": {},
                      "local_offer_id": {},
                      "invreq_payer_note": {},
                      "created_index": {},
                      "updated_index": {},
                      "expires_at": {}
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-waitinvoice(7)",
        "lightning-delinvoice(7)",
        "lightning-invoice(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listinvoices#1",
            "method": "listinvoices",
            "params": {
              "label": "lbl_l21"
            }
          },
          "response": {
            "invoices": [
              {
                "label": "lbl_l21",
                "bolt11": "lnbcrt100n1pnt2bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000",
                "payment_hash": "paymenthashinvl0210021002100210021002100210021002100210021002100",
                "status": "paid",
                "pay_index": 4,
                "amount_received_msat": 400000,
                "paid_at": 1738500000,
                "payment_preimage": "paymentpreimager010101010101010101010101010101010101010101010101",
                "description": "l21 description",
                "expires_at": 1739000000,
                "created_index": 2,
                "updated_index": 4
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listinvoices#2",
            "method": "listinvoices",
            "params": {}
          },
          "response": {
            "invoices": [
              {
                "label": "lbl balance l1 to l2",
                "bolt11": "lnbcrt222n1pnt3005720bolt114000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
                "payment_hash": "paymenthashdelpay10101010101010101010101010101010101010101010101",
                "amount_msat": 500000000,
                "status": "paid",
                "pay_index": 1,
                "amount_received_msat": 500000000,
                "paid_at": 1738500000,
                "payment_preimage": "paymentpreimgdp1010101010101010101010101010101010101010101010101",
                "description": "description send some sats l1 to l2",
                "expires_at": 1739000000,
                "created_index": 1,
                "updated_index": 1
              },
              {
                "label": "lbl_l21",
                "bolt11": "lnbcrt100n1pnt2bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000",
                "payment_hash": "paymenthashinvl0210021002100210021002100210021002100210021002100",
                "status": "paid",
                "pay_index": 4,
                "amount_received_msat": 400000,
                "paid_at": 1738510000,
                "payment_preimage": "paymentpreimager010101010101010101010101010101010101010101010101",
                "description": "l21 description",
                "expires_at": 1739010000,
                "created_index": 2,
                "updated_index": 4
              },
              {
                "label": "lbl_l22",
                "bolt11": "lnbcrt100n1pnt2bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000bolt11invl020200000000",
                "payment_hash": "paymenthashinvl0220022002200220022002200220022002200220022002200",
                "amount_msat": 200000,
                "status": "unpaid",
                "description": "l22 description",
                "expires_at": 1739020000,
                "created_index": 3,
                "paid_at": 1738520000
              },
              {
                "label": "label inv_l24",
                "bolt11": "lnbcrt100n1pnt2bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000",
                "payment_hash": "paymenthashinvl0240024002400240024002400240024002400240024002400",
                "amount_msat": 123000,
                "status": "unpaid",
                "description": "description inv_l24",
                "expires_at": 1739030000,
                "created_index": 4,
                "paid_at": 1738530000
              },
              {
                "label": "label inv_l25",
                "bolt11": "lnbcrt100n1pnt2bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000",
                "payment_hash": "paymenthashinvl0250025002500250025002500250025002500250025002500",
                "amount_msat": 124000,
                "status": "unpaid",
                "description": "description inv_l25",
                "expires_at": 1739040000,
                "created_index": 5,
                "paid_at": 1738540000
              }
            ]
          }
        }
      ]
    },
    "listnetworkevents.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listnetworkevents",
      "title": "Command for querying network events",
      "added": "v25.12",
      "description": [
        "The **listnetworkevents** RPC command retrieves the log of connections, disconnections and pings on the network.  This can be analyzed to evaluate node reliability and latency.",
        "Note: the `autoclean` plugin deletes network events older than 30 days; you can adjust `autoclean-networkevents-age` to change this"
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": [
              "A node id: if set, only network events for this peer are returned"
            ]
          },
          "index": {
            "type": "string",
            "enum": [
              "created"
            ],
            "description": [
              "This controls the ordering of results."
            ],
            "default": "`created`"
          },
          "start": {
            "type": "u64",
            "description": [
              "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)."
            ]
          },
          "limit": {
            "type": "u32",
            "description": [
              "If `index` is specified, `limit` can be used to specify the maximum number of entries to return."
            ]
          }
        }
      },
      "response": {
        "required": [
          "networkevents"
        ],
        "additionalProperties": false,
        "properties": {
          "networkevents": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "created_index",
                "timestamp",
                "peer_id",
                "type"
              ],
              "properties": {
                "created_index": {
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this network event was created in."
                  ]
                },
                "timestamp": {
                  "type": "u64",
                  "description": [
                    "Time this event was recorded, in seconds since January 1 1970 UTC"
                  ]
                },
                "peer_id": {
                  "type": "pubkey",
                  "description": [
                    "The node the network connection was talking to."
                  ]
                },
                "type": {
                  "type": "string",
                  "description": [
                    "The type of event (currently `ping`, `connect`, `connect_fail` or `disconnect`)"
                  ]
                },
                "reason": {
                  "type": "string",
                  "description": [
                    "The cause of the event (if known)"
                  ]
                },
                "duration_nsec": {
                  "type": "u64",
                  "description": [
                    "The time taken (for ping, the latency, for connect / connect_fail, the time taken to get a result, for disconnect, the time we were connected)"
                  ]
                },
                "connect_attempted": {}
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "connect_fail"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "connect_attempted"
                    ],
                    "properties": {
                      "connect_attempted": {
                        "type": "boolean",
                        "description": [
                          "True if we found an address we could attempt to connect to, e.g. ignoring Tor addresses if we don't have a proxy, and ignoring IPv6 addresses if we don't have IPv6 support."
                        ]
                      },
                      "created_index": {},
                      "timestamp": {},
                      "peer_id": {},
                      "type": {},
                      "reason": {},
                      "duration_nsec": {}
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-autoclean(7)",
        "lightning-listpeers(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ]
    },
    "listnodes.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listnodes",
      "title": "Command to get the list of nodes in the known network.",
      "description": [
        "The **listnodes** command returns nodes the node has learned about via gossip messages, or a single one if the node *id* was specified."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "The public key of the node to list."
            ]
          }
        }
      },
      "response": {
        "required": [
          "nodes"
        ],
        "additionalProperties": false,
        "properties": {
          "nodes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "nodeid"
              ],
              "properties": {
                "nodeid": {
                  "type": "pubkey",
                  "description": [
                    "The public key of the node."
                  ]
                },
                "last_timestamp": {
                  "type": "u32",
                  "description": [
                    "A node_announcement has been received for this node (UNIX timestamp)."
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "required": [
                      "last_timestamp"
                    ]
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "nodeid",
                      "last_timestamp",
                      "alias",
                      "color",
                      "features",
                      "addresses"
                    ],
                    "properties": {
                      "nodeid": {},
                      "last_timestamp": {},
                      "option_will_fund": {},
                      "alias": {
                        "type": "string",
                        "description": [
                          "The fun alias this node advertized."
                        ],
                        "maxLength": 32
                      },
                      "color": {
                        "type": "hex",
                        "description": [
                          "The favorite RGB color this node advertized."
                        ],
                        "minLength": 6,
                        "maxLength": 6
                      },
                      "features": {
                        "type": "hex",
                        "description": [
                          "BOLT #9 features bitmap this node advertized."
                        ]
                      },
                      "addresses": {
                        "type": "array",
                        "description": [
                          "The addresses this node advertized."
                        ],
                        "items": {
                          "type": "object",
                          "required": [
                            "type",
                            "port"
                          ],
                          "additionalProperties": true,
                          "properties": {
                            "type": {
                              "type": "string",
                              "enum": [
                                "dns",
                                "ipv4",
                                "ipv6",
                                "torv2",
                                "torv3"
                              ],
                              "description": [
                                "Type of connection (until 23.08, `websocket` was also allowed)."
                              ]
                            },
                            "port": {
                              "type": "u16",
                              "description": [
                                "Port number."
                              ]
                            }
                          },
                          "if": {
                            "additionalProperties": true,
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "dns",
                                  "ipv4",
                                  "ipv6",
                                  "torv2",
                                  "torv3"
                                ]
                              }
                            }
                          },
                          "then": {
                            "required": [
                              "type",
                              "address",
                              "port"
                            ],
                            "additionalProperties": false,
                            "properties": {
                              "type": {},
                              "port": {},
                              "address": {
                                "type": "string",
                                "description": [
                                  "Address in expected format for **type**."
                                ]
                              }
                            }
                          },
                          "else": {
                            "required": [
                              "type",
                              "port"
                            ],
                            "additionalProperties": false,
                            "properties": {
                              "type": {},
                              "port": {}
                            }
                          }
                        }
                      }
                    }
                  },
                  "else": {
                    "additionalProperties": false,
                    "properties": {
                      "nodeid": {}
                    }
                  }
                },
                {
                  "if": {
                    "required": [
                      "option_will_fund"
                    ]
                  },
                  "then": {
                    "additionalProperties": true,
                    "required": [
                      "option_will_fund"
                    ],
                    "properties": {
                      "option_will_fund": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "lease_fee_base_msat",
                          "lease_fee_basis",
                          "funding_weight",
                          "channel_fee_max_base_msat",
                          "channel_fee_max_proportional_thousandths",
                          "compact_lease"
                        ],
                        "properties": {
                          "lease_fee_base_msat": {
                            "type": "msat",
                            "description": [
                              "The fixed fee for a lease (whole number of satoshis)."
                            ]
                          },
                          "lease_fee_basis": {
                            "type": "u32",
                            "description": [
                              "The proportional fee in basis points (parts per 10,000) for a lease."
                            ]
                          },
                          "funding_weight": {
                            "type": "u32",
                            "description": [
                              "The onchain weight you'll have to pay for a lease."
                            ]
                          },
                          "channel_fee_max_base_msat": {
                            "type": "msat",
                            "description": [
                              "The maximum base routing fee this node will charge during the lease."
                            ]
                          },
                          "channel_fee_max_proportional_thousandths": {
                            "type": "u32",
                            "description": [
                              "The maximum proportional routing fee this node will charge during the lease (in thousandths, not millionths like channel_update)."
                            ]
                          },
                          "compact_lease": {
                            "type": "hex",
                            "description": [
                              "The lease as represented in the node_announcement."
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters."
      ],
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) wrote the initial version of this man page,",
        "but many others did the hard work of actually implementing this rpc command."
      ],
      "see_also": [
        "lightning-listchannels(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listnodes#1",
            "method": "listnodes",
            "params": {
              "id": "nodeid030303030303030303030303030303030303030303030303030303030303"
            }
          },
          "response": {
            "nodes": [
              {
                "nodeid": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "alias": "HOPPINGFIRE",
                "color": "035d2b",
                "last_timestamp": 1738000000,
                "features": "8898882a8a59a1",
                "addresses": []
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listnodes#2",
            "method": "listnodes",
            "params": {}
          },
          "response": {
            "nodes": [
              {
                "nodeid": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "alias": "SILENTARTIST",
                "color": "022d22",
                "last_timestamp": 1738000000,
                "features": "8898882a8a59a1",
                "addresses": []
              },
              {
                "nodeid": "nodeid010101010101010101010101010101010101010101010101010101010101",
                "alias": "JUNIORBEAM",
                "color": "0266e4",
                "last_timestamp": 1738010000,
                "features": "8898882a8a59a1",
                "addresses": []
              },
              {
                "nodeid": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "alias": "HOPPINGFIRE",
                "color": "035d2b",
                "last_timestamp": 1738020000,
                "features": "8898882a8a59a1",
                "addresses": []
              },
              {
                "nodeid": "nodeid040404040404040404040404040404040404040404040404040404040404",
                "alias": "JUNIORFELONY",
                "color": "0382ce",
                "last_timestamp": 1738030000,
                "features": "8898882a8a59a1",
                "addresses": []
              }
            ]
          }
        }
      ]
    },
    "listoffers.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listoffers",
      "title": "Command for listing offers",
      "description": [
        "The **listoffers** RPC command list all offers, or with `offer_id`, only the offer with that offer_id (if it exists)."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "offer_id": {
            "type": "hash",
            "description": [
              "Offer_id to get details for (if it exists)."
            ]
          },
          "active_only": {
            "type": "boolean",
            "description": [
              "If set and is true, only offers with `active` true are returned."
            ]
          }
        }
      },
      "response": {
        "required": [
          "offers"
        ],
        "additionalProperties": false,
        "properties": {
          "offers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "offer_id",
                "active",
                "single_use",
                "bolt12",
                "used"
              ],
              "properties": {
                "offer_id": {
                  "type": "hash",
                  "description": [
                    "The id of this offer (merkle hash of non-signature fields)."
                  ]
                },
                "active": {
                  "type": "boolean",
                  "description": [
                    "Whether this can still be used."
                  ]
                },
                "single_use": {
                  "type": "boolean",
                  "description": [
                    "Whether this expires as soon as it's paid."
                  ]
                },
                "bolt12": {
                  "type": "string",
                  "description": [
                    "The bolt12 encoding of the offer."
                  ]
                },
                "description": {
                  "added": "v26.04",
                  "type": "string",
                  "description": [
                    "The user-specified bolt 12 description."
                  ]
                },
                "used": {
                  "type": "boolean",
                  "description": [
                    "True if an associated invoice has been paid."
                  ]
                },
                "label": {
                  "type": "string",
                  "description": [
                    "The (optional) user-specified label."
                  ]
                }
              }
            }
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-offer(7)",
        "lightning-listoffers(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listoffers#1",
            "method": "listoffers",
            "params": {
              "active_only": true
            }
          },
          "response": {
            "offers": [
              {
                "offer_id": "offeridl21000002100000210000021000002100000210000021000002100000",
                "active": true,
                "single_use": false,
                "bolt12": "lno1qgsq000bolt210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000",
                "description": "Fish sale!",
                "used": false
              },
              {
                "offer_id": "offeridl22000002200000220000022000002200000220000022000002200000",
                "active": true,
                "single_use": false,
                "bolt12": "lno1qgsq000bolt220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000",
                "description": "Coffee",
                "used": false
              },
              {
                "offer_id": "offeridl23000002300000230000023000002300000230000023000002300000",
                "active": true,
                "single_use": false,
                "bolt12": "lno1qgsq000bolt230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000",
                "description": "Movie ticket",
                "used": false
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listoffers#2",
            "method": "listoffers",
            "params": [
              "offeridl23000002300000230000023000002300000230000023000002300000"
            ]
          },
          "response": {
            "offers": [
              {
                "offer_id": "offeridl23000002300000230000023000002300000230000023000002300000",
                "active": true,
                "single_use": false,
                "bolt12": "lno1qgsq000bolt230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000",
                "used": false
              }
            ]
          }
        }
      ]
    },
    "listpays.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listpays",
      "title": "Command for querying payment status",
      "description": [
        "The **listpays** RPC command gets the status of all *pay* commands (by combining results from listsendpays which lists every payment part), or a single one if either *bolt11* or *payment_hash* was specified."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "bolt11": {
            "type": "string",
            "description": [
              "Bolt11 string to get the payment details."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "Payment hash to get the payment details."
            ]
          },
          "status": {
            "type": "string",
            "description": [
              "To filter the payment by status."
            ],
            "enum": [
              "pending",
              "complete",
              "failed"
            ]
          },
          "index": {
            "type": "string",
            "added": "v24.11",
            "enum": [
              "created",
              "updated"
            ],
            "description": [
              "If neither *in_channel* nor *out_channel* is specified, it controls ordering, by `created` or `updated`."
            ]
          },
          "start": {
            "type": "u64",
            "added": "v24.11",
            "description": [
              "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7).",
              "NOTE: if this is used, `amount_sent_msat` and `number_of_parts` fields may be lower than expected, as not all payment parts will be considered"
            ]
          },
          "limit": {
            "type": "u32",
            "added": "v24.11",
            "description": [
              "If `index` is specified, `limit` can be used to specify the maximum number of entries to return.",
              "NOTE: if this is used, `amount_sent_msat` and `number_of_parts` fields may be lower than expected, as not all payment parts will be considered",
              "NOTE: the actual number returned may be less than the limit, as individual payment parts are combined together"
            ]
          }
        }
      },
      "response": {
        "required": [
          "pays"
        ],
        "additionalProperties": false,
        "properties": {
          "pays": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "payment_hash",
                "status",
                "created_at",
                "created_index"
              ],
              "properties": {
                "payment_hash": {
                  "type": "hash",
                  "description": [
                    "The hash of the *payment_preimage* which will prove payment."
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "failed",
                    "complete"
                  ],
                  "description": [
                    "Status of the payment."
                  ]
                },
                "destination": {
                  "type": "pubkey",
                  "description": [
                    "The final destination of the payment if known."
                  ]
                },
                "created_at": {
                  "type": "u64",
                  "description": [
                    "The UNIX timestamp showing when this payment was initiated."
                  ]
                },
                "completed_at": {
                  "type": "u64",
                  "description": [
                    "The UNIX timestamp showing when this payment was completed."
                  ]
                },
                "label": {
                  "type": "string",
                  "description": [
                    "The label, if given to sendpay."
                  ]
                },
                "bolt11": {
                  "type": "string",
                  "description": [
                    "The bolt11 string (if pay supplied one)."
                  ]
                },
                "description": {
                  "type": "string",
                  "description": [
                    "The description matching the bolt11 description hash (if pay supplied one)."
                  ]
                },
                "bolt12": {
                  "type": "string",
                  "description": [
                    "The bolt12 string (if supplied for pay)."
                  ]
                },
                "created_index": {
                  "type": "u64",
                  "added": "v24.11",
                  "description": [
                    "1-based index indicating order this payment was created in."
                  ]
                },
                "updated_index": {
                  "type": "u64",
                  "added": "v24.11",
                  "description": [
                    "1-based index indicating order this payment was changed (only present if it has changed since creation)."
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "complete"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "amount_sent_msat",
                      "preimage"
                    ],
                    "properties": {
                      "created_index": {},
                      "updated_index": {},
                      "payment_hash": {},
                      "status": {},
                      "destination": {},
                      "created_at": {},
                      "completed_at": {},
                      "label": {},
                      "bolt11": {},
                      "description": {},
                      "bolt12": {},
                      "amount_msat": {
                        "type": "msat",
                        "description": [
                          "The amount of millisatoshi we intended to send to the destination. This can only be missing in the case of someone manually calling sendonion without the `amount_msat` parameter (which no plugin currently does)."
                        ]
                      },
                      "amount_sent_msat": {
                        "type": "msat",
                        "description": [
                          "The amount of millisatoshi we sent in order to pay (may include fees and not match amount_msat)."
                        ]
                      },
                      "preimage": {
                        "type": "secret",
                        "description": [
                          "Proof of payment."
                        ]
                      },
                      "number_of_parts": {
                        "type": "u64",
                        "description": [
                          "The number of parts for a successful payment (only if more than one)."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "failed"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "amount_sent_msat"
                    ],
                    "properties": {
                      "created_index": {},
                      "updated_index": {},
                      "payment_hash": {},
                      "status": {},
                      "destination": {},
                      "created_at": {},
                      "label": {},
                      "bolt11": {},
                      "description": {},
                      "bolt12": {},
                      "amount_sent_msat": {},
                      "erroronion": {
                        "type": "hex",
                        "description": [
                          "The error onion returned on failure, if any."
                        ]
                      }
                    }
                  }
                }
              ]
            }
          }
        },
        "post_return_value_notes": [
          "The returned array is ordered by increasing **created_at** fields."
        ]
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-pay(7)",
        "lightning-paystatus(7)",
        "lightning-listsendpays(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listpays#1",
            "method": "listpays",
            "params": {
              "bolt11": "lnbcrt100n1pnt2bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000"
            }
          },
          "response": {
            "pays": []
          }
        },
        {
          "request": {
            "id": "example:listpays#2",
            "method": "listpays",
            "params": {}
          },
          "response": {
            "pays": []
          }
        }
      ]
    },
    "listpeerchannels.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.02",
      "rpc": "listpeerchannels",
      "title": "Command returning data on channels of connected lightning nodes",
      "description": [
        "The **listpeerchannels** RPC command returns a list of this node's channels.",
        "",
        "By default, data for all known channels is returned, including those to peers that are currently connected and those to peers that are disconnected but still have open channels.",
        "",
        "At most one of *id*, *short_channel_id* or *channel_id* may be provided as a filter. If more than one is provided, the command fails with an error."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "If supplied, limits the channels to just the peer with the given ID, if it exists. Cannot be used with 'short_channel_id' or 'channel_id'."
            ]
          },
          "short_channel_id": {
            "added": "v25.05",
            "type": "short_channel_id",
            "description": [
              "If supplied, limits the channels to just this short_channel_id (or local alias), if it exists. Cannot be used with 'id' or 'channel_id'."
            ]
          },
          "channel_id": {
            "added": "v26.03",
            "type": "hash",
            "description": [
              "If supplied, limits the channels to just this channel_id, if it exists. Cannot be used with 'id' or 'short_channel_id'."
            ]
          }
        }
      },
      "response": {
        "required": [
          "channels"
        ],
        "additionalProperties": false,
        "properties": {
          "channels": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "state",
                "opener",
                "features",
                "peer_connected",
                "peer_id"
              ],
              "properties": {
                "peer_id": {
                  "type": "pubkey",
                  "description": [
                    "Node Public key."
                  ]
                },
                "peer_connected": {
                  "type": "boolean",
                  "description": [
                    "A boolean flag that is set to true if the peer is online."
                  ]
                },
                "reestablished": {
                  "type": "boolean",
                  "added": "v24.02",
                  "description": [
                    "A boolean flag that is set to true if we have successfully exchanged reestablish messages with this connection."
                  ]
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "OPENINGD",
                    "CHANNELD_AWAITING_LOCKIN",
                    "CHANNELD_NORMAL",
                    "CHANNELD_SHUTTING_DOWN",
                    "CLOSINGD_SIGEXCHANGE",
                    "CLOSINGD_COMPLETE",
                    "AWAITING_UNILATERAL",
                    "FUNDING_SPEND_SEEN",
                    "ONCHAIN",
                    "DUALOPEND_OPEN_INIT",
                    "DUALOPEND_AWAITING_LOCKIN",
                    "CHANNELD_AWAITING_SPLICE",
                    "DUALOPEND_OPEN_COMMITTED",
                    "DUALOPEND_OPEN_COMMIT_READY"
                  ],
                  "description": [
                    "The channel state, in particular `CHANNELD_NORMAL` means the channel can be used normally."
                  ]
                },
                "scratch_txid": {
                  "type": "txid",
                  "description": [
                    "The txid we would use if we went onchain now."
                  ]
                },
                "channel_type": {
                  "type": "object",
                  "description": [
                    "Channel_type as negotiated with peer."
                  ],
                  "added": "v23.05",
                  "additionalProperties": false,
                  "required": [
                    "bits",
                    "names"
                  ],
                  "properties": {
                    "bits": {
                      "type": "array",
                      "description": [
                        "Each bit set in this channel_type."
                      ],
                      "items": {
                        "type": "u32",
                        "description": [
                          "Bit number."
                        ]
                      }
                    },
                    "names": {
                      "type": "array",
                      "description": [
                        "Feature name for each bit set in this channel_type. Note that *anchors_zero_fee_htlc_tx* is a deprecated synonym for *anchors*."
                      ],
                      "items": {
                        "type": "string",
                        "enum": [
                          "static_remotekey/even",
                          "anchor_outputs/even",
                          "anchors/even",
                          "anchors_zero_fee_htlc_tx/even",
                          "scid_alias/even",
                          "zeroconf/even"
                        ],
                        "description": [
                          "Name of feature bit."
                        ]
                      }
                    }
                  }
                },
                "updates": {
                  "type": "object",
                  "added": "v24.02",
                  "description": [
                    "Latest gossip updates sent/received."
                  ],
                  "additionalProperties": false,
                  "required": [
                    "local"
                  ],
                  "properties": {
                    "local": {
                      "type": "object",
                      "description": [
                        "Our gossip for channel."
                      ],
                      "additionalProperties": false,
                      "added": "v24.02",
                      "required": [
                        "htlc_minimum_msat",
                        "htlc_maximum_msat",
                        "cltv_expiry_delta",
                        "fee_base_msat",
                        "fee_proportional_millionths"
                      ],
                      "properties": {
                        "htlc_minimum_msat": {
                          "type": "msat",
                          "added": "v24.02",
                          "description": [
                            "Minimum msat amount we allow."
                          ]
                        },
                        "htlc_maximum_msat": {
                          "type": "msat",
                          "added": "v24.02",
                          "description": [
                            "Maximum msat amount we allow."
                          ]
                        },
                        "cltv_expiry_delta": {
                          "type": "u32",
                          "added": "v24.02",
                          "description": [
                            "Blocks delay required between incoming and outgoing HTLCs."
                          ]
                        },
                        "fee_base_msat": {
                          "type": "msat",
                          "added": "v24.02",
                          "description": [
                            "Amount we charge to use the channel."
                          ]
                        },
                        "fee_proportional_millionths": {
                          "type": "u32",
                          "added": "v24.02",
                          "description": [
                            "Amount we charge to use the channel in parts-per-million."
                          ]
                        }
                      }
                    },
                    "remote": {
                      "type": "object",
                      "added": "v24.02",
                      "description": [
                        "Peer's gossip for channel."
                      ],
                      "additionalProperties": false,
                      "required": [
                        "htlc_minimum_msat",
                        "htlc_maximum_msat",
                        "cltv_expiry_delta",
                        "fee_base_msat",
                        "fee_proportional_millionths"
                      ],
                      "properties": {
                        "htlc_minimum_msat": {
                          "type": "msat",
                          "added": "v24.02",
                          "description": [
                            "Minimum msat amount they allow."
                          ]
                        },
                        "htlc_maximum_msat": {
                          "type": "msat",
                          "added": "v24.02",
                          "description": [
                            "Maximum msat amount they allow."
                          ]
                        },
                        "cltv_expiry_delta": {
                          "type": "u32",
                          "added": "v24.02",
                          "description": [
                            "Blocks delay required between incoming and outgoing HTLCs."
                          ]
                        },
                        "fee_base_msat": {
                          "type": "msat",
                          "added": "v24.02",
                          "description": [
                            "Amount they charge to use the channel."
                          ]
                        },
                        "fee_proportional_millionths": {
                          "type": "u32",
                          "added": "v24.02",
                          "description": [
                            "Amount they charge to use the channel in parts-per-million."
                          ]
                        }
                      }
                    }
                  }
                },
                "ignore_fee_limits": {
                  "type": "boolean",
                  "added": "v23.08",
                  "description": [
                    "Set if we allow this peer to set fees to anything they want."
                  ]
                },
                "lost_state": {
                  "type": "boolean",
                  "added": "v24.02",
                  "description": [
                    "Set if we are fallen behind i.e. lost some channel state."
                  ]
                },
                "feerate": {
                  "type": "object",
                  "description": [
                    "Feerates for the current tx."
                  ],
                  "additionalProperties": false,
                  "required": [
                    "perkw",
                    "perkb"
                  ],
                  "properties": {
                    "perkw": {
                      "type": "u32",
                      "description": [
                        "Feerate per 1000 weight (i.e kSipa)."
                      ]
                    },
                    "perkb": {
                      "type": "u32",
                      "description": [
                        "Feerate per 1000 virtual bytes."
                      ]
                    }
                  }
                },
                "owner": {
                  "type": "string",
                  "description": [
                    "The current subdaemon controlling this connection."
                  ]
                },
                "short_channel_id": {
                  "type": "short_channel_id",
                  "description": [
                    "The short_channel_id (once locked in)."
                  ]
                },
                "direction": {
                  "type": "integer",
                  "description": [
                    "The direction of the channel (i.e. 0 if we are the lesser node id, 1 if we are the greater)."
                  ]
                },
                "channel_id": {
                  "type": "hash",
                  "description": [
                    "The full channel_id (funding txid Xored with output number)."
                  ]
                },
                "funding_txid": {
                  "type": "txid",
                  "description": [
                    "ID of the funding transaction."
                  ]
                },
                "funding_outnum": {
                  "type": "u32",
                  "description": [
                    "The 0-based output number of the funding transaction which opens the channel."
                  ]
                },
                "initial_feerate": {
                  "type": "string",
                  "description": [
                    "For inflight opens, the first feerate used to initiate the channel open."
                  ]
                },
                "last_feerate": {
                  "type": "string",
                  "description": [
                    "For inflight opens, the most recent feerate used on the channel open."
                  ]
                },
                "next_feerate": {
                  "type": "string",
                  "description": [
                    "For inflight opens, the next feerate we'll use for the channel open."
                  ]
                },
                "next_fee_step": {
                  "type": "u32",
                  "description": [
                    "For inflight opens, the next feerate step we'll use for the channel open."
                  ]
                },
                "inflight": {
                  "type": "array",
                  "description": [
                    "Current candidate funding transactions."
                  ],
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "funding_txid",
                      "funding_outnum",
                      "feerate",
                      "total_funding_msat",
                      "splice_amount",
                      "our_funding_msat"
                    ],
                    "properties": {
                      "funding_txid": {
                        "type": "txid",
                        "description": [
                          "ID of the funding transaction."
                        ]
                      },
                      "funding_outnum": {
                        "type": "u32",
                        "description": [
                          "The 0-based output number of the funding transaction which opens the channel."
                        ]
                      },
                      "feerate": {
                        "type": "string",
                        "description": [
                          "The feerate for this funding transaction in per-1000-weight, with `kpw` appended."
                        ]
                      },
                      "total_funding_msat": {
                        "type": "msat",
                        "description": [
                          "Total amount in the channel."
                        ]
                      },
                      "splice_amount": {
                        "type": "integer",
                        "added": "v23.08",
                        "description": [
                          "The amount of sats we're splicing in or out."
                        ]
                      },
                      "our_funding_msat": {
                        "type": "msat",
                        "description": [
                          "Amount we have in the channel."
                        ]
                      },
                      "scratch_txid": {
                        "type": "txid",
                        "description": [
                          "The commitment transaction txid we would use if we went onchain now."
                        ]
                      }
                    }
                  }
                },
                "close_to": {
                  "type": "hex",
                  "description": [
                    "ScriptPubkey which we have to close to if we mutual close."
                  ]
                },
                "private": {
                  "type": "boolean",
                  "description": [
                    "If True, we will not announce this channel."
                  ]
                },
                "opener": {
                  "type": "string",
                  "enum": [
                    "local",
                    "remote"
                  ],
                  "description": [
                    "Who initiated the channel."
                  ]
                },
                "closer": {
                  "type": "string",
                  "enum": [
                    "local",
                    "remote"
                  ],
                  "description": [
                    "Who initiated the channel close (only present if closing)."
                  ]
                },
                "features": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "option_static_remotekey",
                      "option_anchor_outputs",
                      "option_anchors",
                      "option_scid_alias",
                      "option_zeroconf"
                    ],
                    "description": [
                      "BOLT #9 features which apply to this channel."
                    ]
                  }
                },
                "funding": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "local_funds_msat",
                    "remote_funds_msat"
                  ],
                  "properties": {
                    "pushed_msat": {
                      "type": "msat",
                      "description": [
                        "Amount pushed from opener to peer."
                      ]
                    },
                    "local_funds_msat": {
                      "type": "msat",
                      "description": [
                        "Amount of channel we funded."
                      ]
                    },
                    "remote_funds_msat": {
                      "type": "msat",
                      "description": [
                        "Amount of channel they funded."
                      ]
                    },
                    "fee_paid_msat": {
                      "type": "msat",
                      "description": [
                        "Amount we paid peer at open."
                      ]
                    },
                    "fee_rcvd_msat": {
                      "type": "msat",
                      "description": [
                        "Amount we were paid by peer at open."
                      ]
                    },
                    "psbt": {
                      "type": "string",
                      "added": "v25.12",
                      "description": [
                        "The PSBT (may be non-final or unsigned) we should use to open the channel, if any.  This is initially from `fundchannel_complete`, but will be updated with if `sendpsbt` is called with an updated PSBT."
                      ]
                    },
                    "withheld": {
                      "type": "boolean",
                      "added": "v25.12",
                      "description": [
                        "True if `fundchannel_complete` told us it will not broadcast the funding transaction (so we know not to bother with any other onchain transactions in the case of this channel).  This is set to false if `sendpsbt` is send on the above PSBT."
                      ]
                    }
                  }
                },
                "to_us_msat": {
                  "type": "msat",
                  "description": [
                    "How much of channel is owed to us."
                  ]
                },
                "min_to_us_msat": {
                  "type": "msat",
                  "description": [
                    "Least amount owed to us ever. If the peer were to successfully steal from us, this is the amount we would still retain."
                  ]
                },
                "max_to_us_msat": {
                  "type": "msat",
                  "description": [
                    "Most amount owed to us ever. If we were to successfully steal from the peer, this is the amount we could potentially get."
                  ]
                },
                "total_msat": {
                  "type": "msat",
                  "description": [
                    "Total amount in the channel."
                  ]
                },
                "fee_base_msat": {
                  "type": "msat",
                  "description": [
                    "Amount we charge to use the channel."
                  ]
                },
                "fee_proportional_millionths": {
                  "type": "u32",
                  "description": [
                    "Amount we charge to use the channel in parts-per-million."
                  ]
                },
                "dust_limit_msat": {
                  "type": "msat",
                  "description": [
                    "Minimum amount for an output on the channel transactions."
                  ]
                },
                "max_total_htlc_in_msat": {
                  "type": "msat",
                  "description": [
                    "Max amount accept in a single payment. This field is deprecated, use instead our_max_htlc_value_in_flight_msat"
                  ],
                  "deprecated": [
                    "v25.02",
                    "v26.03"
                  ]
                },
                "their_max_htlc_value_in_flight_msat": {
                  "type": "msat",
                  "added": "v25.02",
                  "description": [
                    "Cap on total value of outstanding HTLCs offered to the remote node. This limits the total amount in flight we can send through this channel."
                  ]
                },
                "our_max_htlc_value_in_flight_msat": {
                  "type": "msat",
                  "added": "v25.02",
                  "description": [
                    "Cap on total value of outstanding HTLCs we accept from the remote node. This limits the total amount in flight we can receive through this channel."
                  ]
                },
                "their_reserve_msat": {
                  "type": "msat",
                  "description": [
                    "Minimum we insist they keep in channel. If they have less than this in the channel, they cannot send to us on that channel."
                  ],
                  "default": "1% of the total channel capacity"
                },
                "our_reserve_msat": {
                  "type": "msat",
                  "description": [
                    "Minimum they insist we keep in channel. If you have less than this in the channel, you cannot send out via this channel."
                  ]
                },
                "spendable_msat": {
                  "type": "msat",
                  "description": [
                    "An estimate of the total we could send through channel (can be wrong because adding HTLCs requires an increase in fees paid to onchain miners, and onchain fees change dynamically according to onchain activity)."
                  ]
                },
                "receivable_msat": {
                  "type": "msat",
                  "description": [
                    "An estimate of the total peer could send through channel."
                  ]
                },
                "minimum_htlc_in_msat": {
                  "type": "msat",
                  "description": [
                    "The minimum amount HTLC we accept."
                  ]
                },
                "minimum_htlc_out_msat": {
                  "type": "msat",
                  "description": [
                    "The minimum amount HTLC we will send."
                  ]
                },
                "maximum_htlc_out_msat": {
                  "type": "msat",
                  "description": [
                    "The maximum amount HTLC we will send."
                  ]
                },
                "their_to_self_delay": {
                  "type": "u32",
                  "description": [
                    "The number of blocks before they can take their funds if they unilateral close."
                  ]
                },
                "our_to_self_delay": {
                  "type": "u32",
                  "description": [
                    "The number of blocks before we can take our funds if we unilateral close."
                  ]
                },
                "max_accepted_htlcs": {
                  "type": "u32",
                  "description": [
                    "Maximum number of incoming HTLC we will accept at once."
                  ]
                },
                "alias": {
                  "type": "object",
                  "required": [],
                  "additionalProperties": false,
                  "properties": {
                    "local": {
                      "type": "short_channel_id",
                      "description": [
                        "An alias assigned by this node to this channel, used for outgoing payments."
                      ]
                    },
                    "remote": {
                      "type": "short_channel_id",
                      "description": [
                        "An alias assigned by the remote node to this channel, usable in routehints and invoices."
                      ]
                    }
                  }
                },
                "state_changes": {
                  "type": "array",
                  "description": [
                    "Prior state changes."
                  ],
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "timestamp",
                      "old_state",
                      "new_state",
                      "cause",
                      "message"
                    ],
                    "properties": {
                      "timestamp": {
                        "type": "string",
                        "description": [
                          "UTC timestamp of form YYYY-mm-ddTHH:MM:SS.%03dZ."
                        ]
                      },
                      "old_state": {
                        "type": "string",
                        "enum": [
                          "OPENINGD",
                          "CHANNELD_AWAITING_LOCKIN",
                          "CHANNELD_NORMAL",
                          "CHANNELD_SHUTTING_DOWN",
                          "CLOSINGD_SIGEXCHANGE",
                          "CLOSINGD_COMPLETE",
                          "AWAITING_UNILATERAL",
                          "FUNDING_SPEND_SEEN",
                          "ONCHAIN",
                          "DUALOPEND_OPEN_INIT",
                          "DUALOPEND_AWAITING_LOCKIN",
                          "DUALOPEND_OPEN_COMMITTED",
                          "DUALOPEND_OPEN_COMMIT_READY",
                          "CHANNELD_AWAITING_SPLICE"
                        ],
                        "description": [
                          "Previous state."
                        ]
                      },
                      "new_state": {
                        "type": "string",
                        "enum": [
                          "OPENINGD",
                          "CHANNELD_AWAITING_LOCKIN",
                          "CHANNELD_NORMAL",
                          "CHANNELD_SHUTTING_DOWN",
                          "CLOSINGD_SIGEXCHANGE",
                          "CLOSINGD_COMPLETE",
                          "AWAITING_UNILATERAL",
                          "FUNDING_SPEND_SEEN",
                          "ONCHAIN",
                          "DUALOPEND_OPEN_INIT",
                          "DUALOPEND_AWAITING_LOCKIN",
                          "DUALOPEND_OPEN_COMMITTED",
                          "DUALOPEND_OPEN_COMMIT_READY",
                          "CHANNELD_AWAITING_SPLICE"
                        ],
                        "description": [
                          "New state."
                        ]
                      },
                      "cause": {
                        "type": "string",
                        "enum": [
                          "unknown",
                          "local",
                          "user",
                          "remote",
                          "protocol",
                          "onchain"
                        ],
                        "description": [
                          "What caused the change."
                        ]
                      },
                      "message": {
                        "type": "string",
                        "description": [
                          "Human-readable explanation."
                        ]
                      }
                    }
                  }
                },
                "status": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": [
                      "Billboard log of significant changes."
                    ]
                  }
                },
                "in_payments_offered": {
                  "type": "u64",
                  "description": [
                    "Number of incoming payment attempts."
                  ]
                },
                "in_offered_msat": {
                  "type": "msat",
                  "description": [
                    "Total amount of incoming payment attempts."
                  ]
                },
                "in_payments_fulfilled": {
                  "type": "u64",
                  "description": [
                    "Number of successful incoming payment attempts."
                  ]
                },
                "in_fulfilled_msat": {
                  "type": "msat",
                  "description": [
                    "Total amount of successful incoming payment attempts."
                  ]
                },
                "out_payments_offered": {
                  "type": "u64",
                  "description": [
                    "Number of outgoing payment attempts."
                  ]
                },
                "out_offered_msat": {
                  "type": "msat",
                  "description": [
                    "Total amount of outgoing payment attempts."
                  ]
                },
                "out_payments_fulfilled": {
                  "type": "u64",
                  "description": [
                    "Number of successful outgoing payment attempts."
                  ]
                },
                "out_fulfilled_msat": {
                  "type": "msat",
                  "description": [
                    "Total amount of successful outgoing payment attempts."
                  ]
                },
                "last_stable_connection": {
                  "type": "u64",
                  "added": "v24.02",
                  "description": [
                    "Last time we reestablished the open channel and stayed connected for 1 minute."
                  ]
                },
                "htlcs": {
                  "type": "array",
                  "description": [
                    "Current HTLCs in this channel."
                  ],
                  "items": {
                    "type": "object",
                    "additionalProperties": true,
                    "required": [
                      "direction",
                      "id",
                      "amount_msat",
                      "expiry",
                      "payment_hash",
                      "state"
                    ],
                    "properties": {
                      "direction": {
                        "type": "string",
                        "added": "v23.02",
                        "enum": [
                          "in",
                          "out"
                        ],
                        "description": [
                          "Whether it came from peer, or is going to peer."
                        ]
                      },
                      "id": {
                        "type": "u64",
                        "description": [
                          "Unique ID for this htlc on this channel in this direction."
                        ]
                      },
                      "amount_msat": {
                        "type": "msat",
                        "description": [
                          "Amount send/received for this HTLC."
                        ]
                      },
                      "expiry": {
                        "type": "u32",
                        "description": [
                          "Block this HTLC expires at (after which an `in` direction HTLC will be returned to the peer, an `out` returned to us). If this expiry is too close, lightningd(8) will automatically unilaterally close the channel in order to enforce the timeout onchain."
                        ]
                      },
                      "payment_hash": {
                        "type": "hash",
                        "description": [
                          "The hash of the payment_preimage which will prove payment."
                        ]
                      },
                      "local_trimmed": {
                        "type": "boolean",
                        "enum": [
                          true
                        ],
                        "description": [
                          "If this is too small to enforce onchain; it doesn't appear in the commitment transaction and will not be enforced in a unilateral close. Generally true if the HTLC (after subtracting onchain fees) is below the `dust_limit_msat` for the channel."
                        ]
                      },
                      "status": {
                        "type": "string",
                        "description": [
                          "Set if this HTLC is currently waiting on a hook (and shows what plugin)."
                        ]
                      }
                    },
                    "allOf": [
                      {
                        "if": {
                          "additionalProperties": true,
                          "properties": {
                            "direction": {
                              "enum": [
                                "out"
                              ]
                            }
                          }
                        },
                        "then": {
                          "additionalProperties": false,
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "direction": {},
                            "id": {},
                            "amount_msat": {},
                            "msatoshi": {},
                            "expiry": {},
                            "payment_hash": {},
                            "local_trimmed": {},
                            "status": {},
                            "alias": {},
                            "peer_id": {},
                            "peer_connected": {},
                            "reestablished": {},
                            "state": {
                              "type": "string",
                              "enum": [
                                "SENT_ADD_HTLC",
                                "SENT_ADD_COMMIT",
                                "RCVD_ADD_REVOCATION",
                                "RCVD_ADD_ACK_COMMIT",
                                "SENT_ADD_ACK_REVOCATION",
                                "RCVD_REMOVE_HTLC",
                                "RCVD_REMOVE_COMMIT",
                                "SENT_REMOVE_REVOCATION",
                                "SENT_REMOVE_ACK_COMMIT",
                                "RCVD_REMOVE_ACK_REVOCATION"
                              ],
                              "description": [
                                "Status of the HTLC."
                              ]
                            }
                          }
                        }
                      },
                      {
                        "if": {
                          "additionalProperties": true,
                          "properties": {
                            "direction": {
                              "enum": [
                                "in"
                              ]
                            }
                          }
                        },
                        "then": {
                          "additionalProperties": false,
                          "required": [
                            "state"
                          ],
                          "properties": {
                            "direction": {},
                            "id": {},
                            "amount_msat": {},
                            "msatoshi": {},
                            "expiry": {},
                            "payment_hash": {},
                            "local_trimmed": {},
                            "status": {},
                            "peer_id": {},
                            "peer_connected": {},
                            "reestablished": {},
                            "state": {
                              "type": "string",
                              "enum": [
                                "RCVD_ADD_HTLC",
                                "RCVD_ADD_COMMIT",
                                "SENT_ADD_REVOCATION",
                                "SENT_ADD_ACK_COMMIT",
                                "RCVD_ADD_ACK_REVOCATION",
                                "SENT_REMOVE_HTLC",
                                "SENT_REMOVE_COMMIT",
                                "RCVD_REMOVE_REVOCATION",
                                "RCVD_REMOVE_ACK_COMMIT",
                                "SENT_REMOVE_ACK_REVOCATION"
                              ],
                              "description": [
                                "Status of the HTLC."
                              ]
                            }
                          }
                        }
                      }
                    ]
                  }
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "peer_connected": {
                        "type": "boolean",
                        "enum": [
                          true
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": true,
                    "properties": {
                      "reestablished": {
                        "type": "boolean",
                        "description": [
                          "True if we have successfully exchanged reestablish messages this connection."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "required": [
                      "close_to"
                    ]
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [],
                    "properties": {
                      "state": {},
                      "peer_id": {},
                      "peer_connected": {},
                      "reestablished": {},
                      "scratch_txid": {},
                      "channel_type": {},
                      "feerate": {},
                      "ignore_fee_limits": {},
                      "lost_state": {},
                      "owner": {},
                      "short_channel_id": {},
                      "channel_id": {},
                      "updates": {},
                      "funding_txid": {},
                      "funding_outnum": {},
                      "close_to": {},
                      "private": {},
                      "alias": {},
                      "opener": {},
                      "closer": {},
                      "features": {},
                      "funding": {},
                      "to_us_msat": {},
                      "min_to_us_msat": {},
                      "max_to_us_msat": {},
                      "total_msat": {},
                      "fee_base_msat": {},
                      "fee_proportional_millionths": {},
                      "dust_limit_msat": {},
                      "max_total_htlc_in_msat": {},
                      "our_max_total_htlc_in_msat": {},
                      "their_max_total_htlc_in_msat": {},
                      "their_reserve_msat": {},
                      "our_reserve_msat": {},
                      "spendable_msat": {},
                      "receivable_msat": {},
                      "minimum_htlc_in_msat": {},
                      "minimum_htlc_out_msat": {},
                      "maximum_htlc_out_msat": {},
                      "spendable_msatoshi": {},
                      "receivable_msatoshi": {},
                      "their_to_self_delay": {},
                      "our_to_self_delay": {},
                      "max_accepted_htlcs": {},
                      "msatoshi_to_us": {},
                      "msatoshi_to_us_min": {},
                      "msatoshi_to_us_max": {},
                      "msatoshi_total": {},
                      "dust_limit_satoshis": {},
                      "max_htlc_value_in_flight_msat": {},
                      "our_max_htlc_value_in_flight_msat": {},
                      "their_max_htlc_value_in_flight_msat": {},
                      "our_channel_reserve_satoshis": {},
                      "their_channel_reserve_satoshis": {},
                      "spendable_satoshis": {},
                      "receivable_satoshis": {},
                      "htlc_minimum_msat": {},
                      "state_changes": {},
                      "status": {},
                      "in_payments_offered": {},
                      "in_offered_msat": {},
                      "in_msatoshi_offered": {},
                      "in_payments_fulfilled": {},
                      "in_fulfilled_msat": {},
                      "in_msatoshi_fulfilled": {},
                      "out_payments_offered": {},
                      "out_offered_msat": {},
                      "out_msatoshi_offered": {},
                      "out_payments_fulfilled": {},
                      "out_fulfilled_msat": {},
                      "out_msatoshi_fulfilled": {},
                      "last_stable_connection": {},
                      "htlcs": {},
                      "initial_feerate": {},
                      "last_feerate": {},
                      "next_feerate": {},
                      "inflight": {},
                      "last_tx_fee_msat": {},
                      "direction": {},
                      "close_to_addr": {
                        "type": "string",
                        "description": [
                          "The bitcoin address we will close to (present if close_to_addr is a standardized address)."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "required": [
                      "scratch_txid"
                    ]
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "last_tx_fee_msat"
                    ],
                    "properties": {
                      "state": {},
                      "peer_id": {},
                      "peer_connected": {},
                      "reestablished": {},
                      "alias": {},
                      "scratch_txid": {},
                      "channel_type": {},
                      "feerate": {},
                      "ignore_fee_limits": {},
                      "lost_state": {},
                      "owner": {},
                      "short_channel_id": {},
                      "channel_id": {},
                      "updates": {},
                      "funding_txid": {},
                      "funding_outnum": {},
                      "inflight": {},
                      "close_to": {},
                      "private": {},
                      "opener": {},
                      "closer": {},
                      "features": {},
                      "funding": {},
                      "to_us_msat": {},
                      "min_to_us_msat": {},
                      "max_to_us_msat": {},
                      "total_msat": {},
                      "fee_base_msat": {},
                      "fee_proportional_millionths": {},
                      "dust_limit_msat": {},
                      "max_total_htlc_in_msat": {},
                      "our_max_total_htlc_in_msat": {},
                      "their_max_total_htlc_in_msat": {},
                      "their_reserve_msat": {},
                      "our_reserve_msat": {},
                      "spendable_msat": {},
                      "receivable_msat": {},
                      "minimum_htlc_in_msat": {},
                      "minimum_htlc_out_msat": {},
                      "maximum_htlc_out_msat": {},
                      "spendable_msatoshi": {},
                      "receivable_msatoshi": {},
                      "their_to_self_delay": {},
                      "our_to_self_delay": {},
                      "max_accepted_htlcs": {},
                      "msatoshi_to_us": {},
                      "msatoshi_to_us_min": {},
                      "msatoshi_to_us_max": {},
                      "msatoshi_total": {},
                      "dust_limit_satoshis": {},
                      "max_htlc_value_in_flight_msat": {},
                      "our_max_htlc_value_in_flight_msat": {},
                      "their_max_htlc_value_in_flight_msat": {},
                      "our_channel_reserve_satoshis": {},
                      "their_channel_reserve_satoshis": {},
                      "spendable_satoshis": {},
                      "receivable_satoshis": {},
                      "htlc_minimum_msat": {},
                      "state_changes": {},
                      "status": {},
                      "in_payments_offered": {},
                      "in_offered_msat": {},
                      "in_msatoshi_offered": {},
                      "in_payments_fulfilled": {},
                      "in_fulfilled_msat": {},
                      "in_msatoshi_fulfilled": {},
                      "out_payments_offered": {},
                      "out_offered_msat": {},
                      "out_msatoshi_offered": {},
                      "out_payments_fulfilled": {},
                      "out_fulfilled_msat": {},
                      "out_msatoshi_fulfilled": {},
                      "last_stable_connection": {},
                      "htlcs": {},
                      "initial_feerate": {},
                      "last_feerate": {},
                      "next_feerate": {},
                      "close_to_addr": {},
                      "direction": {},
                      "last_tx_fee_msat": {
                        "type": "msat",
                        "description": [
                          "Fee attached to this the current tx."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "required": [
                      "short_channel_id"
                    ]
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "direction"
                    ],
                    "properties": {
                      "alias": {},
                      "peer_id": {},
                      "peer_connected": {},
                      "reestablished": {},
                      "state": {},
                      "scratch_txid": {},
                      "channel_type": {},
                      "feerate": {},
                      "ignore_fee_limits": {},
                      "lost_state": {},
                      "owner": {},
                      "short_channel_id": {},
                      "channel_id": {},
                      "updates": {},
                      "funding_txid": {},
                      "funding_outnum": {},
                      "inflight": {},
                      "close_to": {},
                      "private": {},
                      "opener": {},
                      "closer": {},
                      "features": {},
                      "funding": {},
                      "to_us_msat": {},
                      "min_to_us_msat": {},
                      "max_to_us_msat": {},
                      "total_msat": {},
                      "fee_base_msat": {},
                      "fee_proportional_millionths": {},
                      "dust_limit_msat": {},
                      "max_total_htlc_in_msat": {},
                      "our_max_total_htlc_in_msat": {},
                      "their_max_total_htlc_in_msat": {},
                      "their_reserve_msat": {},
                      "our_reserve_msat": {},
                      "spendable_msat": {},
                      "receivable_msat": {},
                      "minimum_htlc_in_msat": {},
                      "minimum_htlc_out_msat": {},
                      "maximum_htlc_out_msat": {},
                      "spendable_msatoshi": {},
                      "receivable_msatoshi": {},
                      "their_to_self_delay": {},
                      "our_to_self_delay": {},
                      "max_accepted_htlcs": {},
                      "msatoshi_to_us": {},
                      "msatoshi_to_us_min": {},
                      "msatoshi_to_us_max": {},
                      "msatoshi_total": {},
                      "dust_limit_satoshis": {},
                      "max_htlc_value_in_flight_msat": {},
                      "our_max_htlc_value_in_flight_msat": {},
                      "their_max_htlc_value_in_flight_msat": {},
                      "our_channel_reserve_satoshis": {},
                      "their_channel_reserve_satoshis": {},
                      "spendable_satoshis": {},
                      "receivable_satoshis": {},
                      "htlc_minimum_msat": {},
                      "state_changes": {},
                      "status": {},
                      "in_payments_offered": {},
                      "in_offered_msat": {},
                      "in_msatoshi_offered": {},
                      "in_payments_fulfilled": {},
                      "in_fulfilled_msat": {},
                      "in_msatoshi_fulfilled": {},
                      "out_payments_offered": {},
                      "out_offered_msat": {},
                      "out_msatoshi_offered": {},
                      "out_payments_fulfilled": {},
                      "out_fulfilled_msat": {},
                      "out_msatoshi_fulfilled": {},
                      "last_stable_connection": {},
                      "htlcs": {},
                      "initial_feerate": {},
                      "last_feerate": {},
                      "next_feerate": {},
                      "close_to_addr": {},
                      "last_tx_fee_msat": {},
                      "direction": {
                        "type": "u32",
                        "added": "v23.02",
                        "description": [
                          "0 if we're the lesser node_id, 1 if we're the greater (as used in BOLT #7 channel_update)."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "required": [
                      "inflight"
                    ]
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "initial_feerate",
                      "last_feerate",
                      "next_feerate"
                    ],
                    "properties": {
                      "state": {},
                      "peer_id": {},
                      "peer_connected": {},
                      "reestablished": {},
                      "scratch_txid": {},
                      "channel_type": {},
                      "feerate": {},
                      "ignore_fee_limits": {},
                      "lost_state": {},
                      "owner": {},
                      "alias": {},
                      "short_channel_id": {},
                      "channel_id": {},
                      "updates": {},
                      "funding_txid": {},
                      "funding_outnum": {},
                      "close_to": {},
                      "private": {},
                      "opener": {},
                      "closer": {},
                      "features": {},
                      "funding": {},
                      "to_us_msat": {},
                      "min_to_us_msat": {},
                      "max_to_us_msat": {},
                      "total_msat": {},
                      "fee_base_msat": {},
                      "fee_proportional_millionths": {},
                      "dust_limit_msat": {},
                      "max_total_htlc_in_msat": {},
                      "our_max_total_htlc_in_msat": {},
                      "their_max_total_htlc_in_msat": {},
                      "their_reserve_msat": {},
                      "our_reserve_msat": {},
                      "spendable_msat": {},
                      "receivable_msat": {},
                      "minimum_htlc_in_msat": {},
                      "minimum_htlc_out_msat": {},
                      "maximum_htlc_out_msat": {},
                      "spendable_msatoshi": {},
                      "receivable_msatoshi": {},
                      "their_to_self_delay": {},
                      "our_to_self_delay": {},
                      "max_accepted_htlcs": {},
                      "msatoshi_to_us": {},
                      "msatoshi_to_us_min": {},
                      "msatoshi_to_us_max": {},
                      "msatoshi_total": {},
                      "dust_limit_satoshis": {},
                      "max_htlc_value_in_flight_msat": {},
                      "our_max_htlc_value_in_flight_msat": {},
                      "their_max_htlc_value_in_flight_msat": {},
                      "our_channel_reserve_satoshis": {},
                      "their_channel_reserve_satoshis": {},
                      "spendable_satoshis": {},
                      "receivable_satoshis": {},
                      "htlc_minimum_msat": {},
                      "state_changes": {},
                      "status": {},
                      "in_payments_offered": {},
                      "in_offered_msat": {},
                      "in_msatoshi_offered": {},
                      "in_payments_fulfilled": {},
                      "in_fulfilled_msat": {},
                      "in_msatoshi_fulfilled": {},
                      "out_payments_offered": {},
                      "out_offered_msat": {},
                      "out_msatoshi_offered": {},
                      "out_payments_fulfilled": {},
                      "out_fulfilled_msat": {},
                      "out_msatoshi_fulfilled": {},
                      "last_stable_connection": {},
                      "htlcs": {},
                      "inflight": {},
                      "close_to_addr": {},
                      "direction": {},
                      "last_tx_fee_msat": {},
                      "initial_feerate": {
                        "type": "string",
                        "description": [
                          "The feerate for the initial funding transaction in per-1000-weight, with `kpw` appended."
                        ]
                      },
                      "last_feerate": {
                        "type": "string",
                        "description": [
                          "The feerate for the latest funding transaction in per-1000-weight, with `kpw` appended."
                        ]
                      },
                      "next_feerate": {
                        "type": "string",
                        "description": [
                          "The minimum feerate for the next funding transaction in per-1000-weight, with `kpw` appended."
                        ]
                      }
                    }
                  }
                }
              ]
            }
          }
        },
        "post_return_value_notes": [
          "The *state* field values (and *old_state* / *new_state*) are worth describing further:",
          "",
          "  * `OPENINGD`: The channel funding protocol with the peer is ongoing and both sides are negotiating parameters.",
          "  * `DUALOPEND_OPEN_INIT`: Like `OPENINGD`, but for v2 connections which are using collaborative opens.",
          "  * `DUALOPEND_OPEN_COMMIT_READY`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You're ready to send your commitment signed to your peer.",
          "  * `DUALOPEND_OPEN_COMMITTED`: Like `OPENINGD`, but for v2 connections which are using collaborative opens. You've gotten an initial signed commitment from your peer.",
          "  * `CHANNELD_AWAITING_LOCKIN` / `DUALOPEND_AWAITING_LOCKIN`: The peer and you have agreed on channel parameters and are just waiting for the channel funding transaction to be confirmed deeply (original and collaborative open protocols, respectively). Both you and the peer must acknowledge the channel funding transaction to be confirmed deeply before entering the next state. Also, you can increase the onchain fee for channels in `DUALOPEND_AWAITING_LOCKIN` using lightning-openchannel_bump(7).",
          "  * `CHANNELD_NORMAL`: The channel can be used for normal payments.",
          "  * `CHANNELD_SHUTTING_DOWN`: A mutual close was requested (by you or peer) and both of you are waiting for HTLCs in-flight to be either failed or succeeded. The channel can no longer be used for normal payments and forwarding. Mutual close will proceed only once all HTLCs in the channel have either been fulfilled or failed.",
          "  * `CLOSINGD_SIGEXCHANGE`: You and the peer are negotiating the mutual close onchain fee.",
          "  * `CLOSINGD_COMPLETE`: You and the peer have agreed on the mutual close onchain fee and are awaiting the mutual close getting confirmed deeply.",
          "  * `AWAITING_UNILATERAL`: You initiated a unilateral close, and are now waiting for the peer-selected unilateral close timeout to complete.",
          "  * `FUNDING_SPEND_SEEN`: You saw the funding transaction getting spent (usually the peer initiated a unilateral close) and will now determine what exactly happened (i.e. if it was a theft attempt).",
          "  * `ONCHAIN`: You saw the funding transaction getting spent and now know what happened (i.e. if it was a proper unilateral close by the peer, or a theft attempt)."
        ]
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong."
      ],
      "author": [
        "Michael Hawkins [michael.hawkins@protonmail.com](mailto:michael.hawkins@protonmail.com)."
      ],
      "see_also": [
        "lightning-connect(7)",
        "lightning-fundchannel_start(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)",
        "Lightning RFC site (BOLT #9): ",
        "[https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md](https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listpeerchannels#1",
            "method": "listpeerchannels",
            "params": {
              "id": "nodeid020202020202020202020202020202020202020202020202020202020202"
            }
          },
          "response": {
            "channels": [
              {
                "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "peer_connected": true,
                "reestablished": true,
                "channel_type": {
                  "bits": [
                    12,
                    22
                  ],
                  "names": [
                    "static_remotekey/even",
                    "anchors/even"
                  ]
                },
                "updates": {
                  "local": {
                    "htlc_minimum_msat": 0,
                    "htlc_maximum_msat": 990000000,
                    "cltv_expiry_delta": 6,
                    "fee_base_msat": 1,
                    "fee_proportional_millionths": 10
                  },
                  "remote": {
                    "htlc_minimum_msat": 0,
                    "htlc_maximum_msat": 990000000,
                    "cltv_expiry_delta": 6,
                    "fee_base_msat": 1,
                    "fee_proportional_millionths": 10
                  }
                },
                "last_stable_connection": 1738510000,
                "state": "CHANNELD_NORMAL",
                "scratch_txid": "scratchid1010101010101010101010101010101010101010101010101010101",
                "last_tx_fee_msat": 4867000,
                "lost_state": false,
                "feerate": {
                  "perkw": 3755,
                  "perkb": 15020
                },
                "owner": "channeld",
                "short_channel_id": "109x1x1",
                "direction": 1,
                "channel_id": "channelid0120000120000120000120000120000120000120000120000120000",
                "funding_txid": "channeltxid120000120000120000120000120000120000120000120000120000",
                "funding_outnum": 1,
                "close_to_addr": "bcrt1p8c0ku4mpxq3443rss8e6rjwamztvv8yxvmxtetal5d0n6v39rlwqvfqy6n",
                "close_to": "51203e1f6e576130235ac47081f3a1c9ddd896c61c8666ccbcafbfa35f3d32251fdc",
                "private": false,
                "opener": "local",
                "alias": {
                  "local": "30000001x60000001x60001",
                  "remote": "10000001x20000001x30001"
                },
                "features": [
                  "option_static_remotekey",
                  "option_anchors"
                ],
                "funding": {
                  "local_funds_msat": 1000000000,
                  "remote_funds_msat": 0,
                  "pushed_msat": 0
                },
                "to_us_msat": 390492790,
                "min_to_us_msat": 390492790,
                "max_to_us_msat": 1000000000,
                "total_msat": 1000000000,
                "fee_base_msat": 1,
                "fee_proportional_millionths": 10,
                "dust_limit_msat": 546000,
                "max_total_htlc_in_msat": 18446744073709552000,
                "their_max_htlc_value_in_flight_msat": 18446744073709552000,
                "our_max_htlc_value_in_flight_msat": 18446744073709552000,
                "their_reserve_msat": 10000000,
                "our_reserve_msat": 10000000,
                "spendable_msat": 363951708,
                "receivable_msat": 599507210,
                "minimum_htlc_in_msat": 0,
                "minimum_htlc_out_msat": 0,
                "maximum_htlc_out_msat": 990000000,
                "their_to_self_delay": 5,
                "our_to_self_delay": 5,
                "max_accepted_htlcs": 483,
                "state_changes": [
                  {
                    "timestamp": "2024-10-10T00:01:00.000Z",
                    "old_state": "DUALOPEND_OPEN_COMMITTED",
                    "new_state": "DUALOPEND_AWAITING_LOCKIN",
                    "cause": "user",
                    "message": "Sigs exchanged, waiting for lock-in"
                  },
                  {
                    "timestamp": "2024-10-10T00:02:00.000Z",
                    "old_state": "DUALOPEND_AWAITING_LOCKIN",
                    "new_state": "CHANNELD_NORMAL",
                    "cause": "user",
                    "message": "Lockin complete"
                  }
                ],
                "status": [
                  "CHANNELD_NORMAL:Channel ready for use."
                ],
                "in_payments_offered": 1,
                "in_offered_msat": 1000000,
                "in_payments_fulfilled": 1,
                "in_fulfilled_msat": 1000000,
                "out_payments_offered": 22,
                "out_offered_msat": 665528797,
                "out_payments_fulfilled": 16,
                "out_fulfilled_msat": 610507210,
                "htlcs": [
                  {
                    "direction": "out",
                    "id": 17,
                    "amount_msat": 4000082,
                    "expiry": 181,
                    "payment_hash": "paymenthashdelpay30303030303030303030303030303030303030303030303",
                    "state": "SENT_ADD_ACK_REVOCATION"
                  }
                ]
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listpeerchannels#2",
            "method": "listpeerchannels",
            "params": {}
          },
          "response": {
            "channels": [
              {
                "peer_id": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "peer_connected": true,
                "reestablished": true,
                "channel_type": {
                  "bits": [
                    12,
                    22
                  ],
                  "names": [
                    "static_remotekey/even",
                    "anchors/even"
                  ]
                },
                "updates": {
                  "local": {
                    "htlc_minimum_msat": 0,
                    "htlc_maximum_msat": 990000000,
                    "cltv_expiry_delta": 6,
                    "fee_base_msat": 1,
                    "fee_proportional_millionths": 10
                  },
                  "remote": {
                    "htlc_minimum_msat": 0,
                    "htlc_maximum_msat": 990000000,
                    "cltv_expiry_delta": 6,
                    "fee_base_msat": 1,
                    "fee_proportional_millionths": 10
                  }
                },
                "last_stable_connection": 1738520000,
                "state": "CHANNELD_NORMAL",
                "scratch_txid": "scratchid2020202020202020202020202020202020202020202020202020202",
                "last_tx_fee_msat": 4867000,
                "lost_state": false,
                "feerate": {
                  "perkw": 3755,
                  "perkb": 15020
                },
                "owner": "channeld",
                "short_channel_id": "109x1x1",
                "direction": 1,
                "channel_id": "channelid0120000120000120000120000120000120000120000120000120000",
                "funding_txid": "channeltxid120000120000120000120000120000120000120000120000120000",
                "funding_outnum": 1,
                "close_to_addr": "bcrt1pcl00020002000200020002000200020002000200020002000200020002",
                "close_to": "db2dec31020202020202020202020202020202020202020202020202020202020202",
                "private": false,
                "opener": "local",
                "alias": {
                  "local": "30000002x60000002x60002",
                  "remote": "10000002x20000002x30002"
                },
                "features": [
                  "option_static_remotekey",
                  "option_anchors"
                ],
                "funding": {
                  "local_funds_msat": 1000000000,
                  "remote_funds_msat": 0,
                  "pushed_msat": 0
                },
                "to_us_msat": 390492790,
                "min_to_us_msat": 390492790,
                "max_to_us_msat": 1000000000,
                "total_msat": 1000000000,
                "fee_base_msat": 1,
                "fee_proportional_millionths": 10,
                "dust_limit_msat": 546000,
                "max_total_htlc_in_msat": 18446744073709552000,
                "their_max_htlc_value_in_flight_msat": 18446744073709552000,
                "our_max_htlc_value_in_flight_msat": 18446744073709552000,
                "their_reserve_msat": 10000000,
                "our_reserve_msat": 10000000,
                "spendable_msat": 363951708,
                "receivable_msat": 599507210,
                "minimum_htlc_in_msat": 0,
                "minimum_htlc_out_msat": 0,
                "maximum_htlc_out_msat": 990000000,
                "their_to_self_delay": 5,
                "our_to_self_delay": 5,
                "max_accepted_htlcs": 483,
                "state_changes": [
                  {
                    "timestamp": "2024-10-10T00:01:00.000Z",
                    "old_state": "DUALOPEND_OPEN_COMMITTED",
                    "new_state": "DUALOPEND_AWAITING_LOCKIN",
                    "cause": "user",
                    "message": "Sigs exchanged, waiting for lock-in"
                  },
                  {
                    "timestamp": "2024-10-10T00:02:00.000Z",
                    "old_state": "DUALOPEND_AWAITING_LOCKIN",
                    "new_state": "CHANNELD_NORMAL",
                    "cause": "user",
                    "message": "Lockin complete"
                  }
                ],
                "status": [
                  "CHANNELD_NORMAL:Channel ready for use."
                ],
                "in_payments_offered": 1,
                "in_offered_msat": 1000000,
                "in_payments_fulfilled": 1,
                "in_fulfilled_msat": 1000000,
                "out_payments_offered": 22,
                "out_offered_msat": 665528797,
                "out_payments_fulfilled": 16,
                "out_fulfilled_msat": 610507210,
                "htlcs": [
                  {
                    "direction": "out",
                    "id": 17,
                    "amount_msat": 4000082,
                    "expiry": 181,
                    "payment_hash": "paymenthashdelpay30303030303030303030303030303030303030303030303",
                    "state": "SENT_ADD_ACK_REVOCATION"
                  }
                ]
              },
              {
                "peer_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "peer_connected": false,
                "channel_type": {
                  "bits": [
                    12,
                    22
                  ],
                  "names": [
                    "static_remotekey/even",
                    "anchors/even"
                  ]
                },
                "updates": {
                  "local": {
                    "htlc_minimum_msat": 0,
                    "htlc_maximum_msat": 19454000,
                    "cltv_expiry_delta": 6,
                    "fee_base_msat": 1,
                    "fee_proportional_millionths": 10
                  }
                },
                "state": "ONCHAIN",
                "scratch_txid": "scratchid2030303030303030303030303030303030303030303030303030303",
                "last_tx_fee_msat": 2250000,
                "lost_state": false,
                "feerate": {
                  "perkw": 3750,
                  "perkb": 15000
                },
                "owner": "onchaind",
                "direction": 0,
                "channel_id": "channelid1100011000110001100011000110001100011000110001100011000",
                "funding_txid": "channeltxid01050000500005000050000500005000050000500005000050000",
                "funding_outnum": 1,
                "initial_feerate": "10000perkw",
                "last_feerate": "10000perkw",
                "next_feerate": "10416perkw",
                "inflight": [
                  {
                    "funding_txid": "channeltxid01050000500005000050000500005000050000500005000050000",
                    "funding_outnum": 1,
                    "feerate": "10000perkw",
                    "total_funding_msat": 20000000,
                    "our_funding_msat": 20000000,
                    "splice_amount": 0,
                    "scratch_txid": "scratchid2030303030303030303030303030303030303030303030303030303"
                  }
                ],
                "close_to_addr": "bcrt1pcl00030003000300030003000300030003000300030003000300030003",
                "close_to": "db2dec31030303030303030303030303030303030303030303030303030303030303",
                "private": false,
                "opener": "local",
                "closer": "local",
                "alias": {
                  "local": "30000003x60000003x60003",
                  "remote": "10000003x20000003x30003"
                },
                "features": [
                  "option_static_remotekey",
                  "option_anchors"
                ],
                "funding": {
                  "local_funds_msat": 20000000,
                  "remote_funds_msat": 0,
                  "pushed_msat": 0
                },
                "to_us_msat": 20000000,
                "min_to_us_msat": 20000000,
                "max_to_us_msat": 20000000,
                "total_msat": 20000000,
                "fee_base_msat": 1,
                "fee_proportional_millionths": 10,
                "dust_limit_msat": 546000,
                "max_total_htlc_in_msat": 18446744073709552000,
                "their_max_htlc_value_in_flight_msat": 18446744073709552000,
                "our_max_htlc_value_in_flight_msat": 18446744073709552000,
                "their_reserve_msat": 546000,
                "our_reserve_msat": 546000,
                "spendable_msat": 8172000,
                "receivable_msat": 0,
                "minimum_htlc_in_msat": 0,
                "minimum_htlc_out_msat": 0,
                "maximum_htlc_out_msat": 19454000,
                "their_to_self_delay": 5,
                "our_to_self_delay": 5,
                "max_accepted_htlcs": 483,
                "state_changes": [
                  {
                    "timestamp": "2024-10-10T00:01:00.000Z",
                    "old_state": "DUALOPEND_OPEN_COMMITTED",
                    "new_state": "DUALOPEND_AWAITING_LOCKIN",
                    "cause": "user",
                    "message": "Sigs exchanged, waiting for lock-in"
                  },
                  {
                    "timestamp": "2024-10-10T00:02:00.000Z",
                    "old_state": "DUALOPEND_AWAITING_LOCKIN",
                    "new_state": "CHANNELD_SHUTTING_DOWN",
                    "cause": "user",
                    "message": "User or plugin invoked close command"
                  },
                  {
                    "timestamp": "2024-10-10T00:03:00.000Z",
                    "old_state": "CHANNELD_SHUTTING_DOWN",
                    "new_state": "CLOSINGD_SIGEXCHANGE",
                    "cause": "user",
                    "message": "Start closingd"
                  },
                  {
                    "timestamp": "2024-10-10T00:04:00.000Z",
                    "old_state": "CLOSINGD_SIGEXCHANGE",
                    "new_state": "CLOSINGD_COMPLETE",
                    "cause": "user",
                    "message": "Closing complete"
                  },
                  {
                    "timestamp": "2024-10-10T00:05:00.000Z",
                    "old_state": "CLOSINGD_COMPLETE",
                    "new_state": "FUNDING_SPEND_SEEN",
                    "cause": "user",
                    "message": "Onchain funding spend"
                  },
                  {
                    "timestamp": "2024-10-10T00:06:00.000Z",
                    "old_state": "FUNDING_SPEND_SEEN",
                    "new_state": "ONCHAIN",
                    "cause": "user",
                    "message": "Onchain init reply"
                  }
                ],
                "status": [
                  "CLOSINGD_SIGEXCHANGE:We agreed on a closing fee of 2250 satoshi for tx:scratchid2030303030303030303030303030303030303030303030303030303",
                  "ONCHAIN:Tracking mutual close transaction",
                  "ONCHAIN:All outputs resolved: waiting 96 more blocks before forgetting channel"
                ],
                "in_payments_offered": 0,
                "in_offered_msat": 0,
                "in_payments_fulfilled": 0,
                "in_fulfilled_msat": 0,
                "out_payments_offered": 0,
                "out_offered_msat": 0,
                "out_payments_fulfilled": 0,
                "out_fulfilled_msat": 0,
                "htlcs": [],
                "last_stable_connection": 1738530000
              }
            ]
          }
        }
      ]
    },
    "listpeers.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listpeers",
      "title": "Command returning data on connected lightning nodes",
      "description": [
        "The **listpeers** RPC command returns data on nodes that are connected or are not connected but have open channels with this node.",
        "",
        "Once a connection to another lightning node has been established, using the **connect** command, data on the node can be returned using **listpeers** and the *id* that was used with the **connect** command.",
        "",
        "If no *id* is supplied, then data on all lightning nodes that are connected, or not connected but have open channels with this node, are returned.",
        "",
        "If a channel is open with a node and the connection has been lost, then the node will still appear in the output of the command and the value of the *connected* attribute of the node will be \"false\".",
        "",
        "The channel will remain open for a set blocktime, after which if the connection has not been re-established, the channel will close and the node will no longer appear in the command output."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "If supplied, limits the result to just the peer with the given ID, if it exists."
            ]
          },
          "level": {
            "type": "string",
            "description": [
              "Supplying level will show log entries related to that peer at the given log level."
            ],
            "enum": [
              "io",
              "trace",
              "debug",
              "info",
              "unusual"
            ]
          }
        }
      },
      "response": {
        "required": [
          "peers"
        ],
        "additionalProperties": false,
        "properties": {
          "peers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "id",
                "connected",
                "num_channels"
              ],
              "properties": {
                "id": {
                  "type": "pubkey",
                  "description": [
                    "The unique id of the peer."
                  ]
                },
                "connected": {
                  "type": "boolean",
                  "description": [
                    "Value showing the connection status."
                  ]
                },
                "num_channels": {
                  "type": "u32",
                  "description": [
                    "The number of channels the peer has with this node."
                  ],
                  "added": "v23.02"
                },
                "log": {
                  "type": "array",
                  "description": [
                    "If *level* is specified, logs for this peer."
                  ],
                  "items": {
                    "type": "object",
                    "additionalProperties": true,
                    "required": [
                      "type"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "SKIPPED",
                          "BROKEN",
                          "UNUSUAL",
                          "INFO",
                          "DEBUG",
                          "TRACE",
                          "IO_IN",
                          "IO_OUT"
                        ]
                      }
                    },
                    "allOf": [
                      {
                        "if": {
                          "additionalProperties": true,
                          "properties": {
                            "type": {
                              "enum": [
                                "SKIPPED"
                              ]
                            }
                          }
                        },
                        "then": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "num_skipped"
                          ],
                          "properties": {
                            "type": {},
                            "num_skipped": {
                              "type": "u32",
                              "description": [
                                "Number of deleted/omitted entries."
                              ]
                            }
                          }
                        }
                      },
                      {
                        "if": {
                          "additionalProperties": true,
                          "properties": {
                            "type": {
                              "enum": [
                                "BROKEN",
                                "UNUSUAL",
                                "INFO",
                                "DEBUG",
                                "TRACE"
                              ]
                            }
                          }
                        },
                        "then": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "time",
                            "source",
                            "log",
                            "node_id"
                          ],
                          "properties": {
                            "type": {},
                            "time": {
                              "type": "string",
                              "description": [
                                "UNIX timestamp with 9 decimal places."
                              ]
                            },
                            "source": {
                              "type": "string",
                              "description": [
                                "The particular logbook this was found in."
                              ]
                            },
                            "log": {
                              "type": "string",
                              "description": [
                                "The actual log message."
                              ]
                            },
                            "node_id": {
                              "type": "pubkey",
                              "description": [
                                "The peer this is associated with."
                              ]
                            }
                          }
                        }
                      },
                      {
                        "if": {
                          "additionalProperties": true,
                          "properties": {
                            "type": {
                              "enum": [
                                "IO_IN",
                                "IO_OUT"
                              ]
                            }
                          }
                        },
                        "then": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "time",
                            "source",
                            "log",
                            "node_id",
                            "data"
                          ],
                          "properties": {
                            "type": {},
                            "time": {
                              "type": "string",
                              "description": [
                                "UNIX timestamp with 9 decimal places."
                              ]
                            },
                            "source": {
                              "type": "string",
                              "description": [
                                "The particular logbook this was found in."
                              ]
                            },
                            "log": {
                              "type": "string",
                              "description": [
                                "The actual log message."
                              ]
                            },
                            "node_id": {
                              "type": "pubkey",
                              "description": [
                                "The peer this is associated with."
                              ]
                            },
                            "data": {
                              "type": "hex",
                              "description": [
                                "The IO which occurred."
                              ]
                            }
                          }
                        }
                      }
                    ]
                  }
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "connected": {
                        "enum": [
                          true
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "netaddr",
                      "features"
                    ],
                    "properties": {
                      "id": {},
                      "channels": {},
                      "connected": {},
                      "num_channels": {},
                      "htlcs": {},
                      "log": {},
                      "netaddr": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 1,
                        "description": [
                          "A single entry array."
                        ],
                        "items": {
                          "type": "string",
                          "description": [
                            "Address, e.g. 1.2.3.4:1234."
                          ]
                        }
                      },
                      "remote_addr": {
                        "type": "string",
                        "description": [
                          "The public IPv4/6 address the peer sees us from, e.g. 1.2.3.4:1234."
                        ]
                      },
                      "features": {
                        "type": "hex",
                        "description": [
                          "Bitmap of BOLT #9 features from peer's INIT message."
                        ]
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong."
      ],
      "author": [
        "Michael Hawkins [michael.hawkins@protonmail.com](mailto:michael.hawkins@protonmail.com)."
      ],
      "see_also": [
        "lightning-connect(7)",
        "lightning-fundchannel_start(7)",
        "lightning-setchannel(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)",
        "Lightning RFC site (BOLT #9):",
        "[https://github.com/lightning/bolts/blob/master/09-features.md](https://github.com/lightning/bolts/blob/master/09-features.md)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listpeers#1",
            "method": "listpeers",
            "params": {
              "id": "nodeid030303030303030303030303030303030303030303030303030303030303"
            }
          },
          "response": {
            "peers": [
              {
                "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "connected": true,
                "num_channels": 1,
                "netaddr": [
                  "127.0.0.1:19736"
                ],
                "features": "0898882a8a59a1"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listpeers#2",
            "method": "listpeers",
            "params": {}
          },
          "response": {
            "peers": [
              {
                "id": "nodeid010101010101010101010101010101010101010101010101010101010101",
                "connected": true,
                "num_channels": 1,
                "netaddr": [
                  "127.0.0.1:19734"
                ],
                "features": "0898882a8a59a1"
              },
              {
                "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "connected": true,
                "num_channels": 1,
                "netaddr": [
                  "127.0.0.1:19736"
                ],
                "features": "0898882a8a59a1"
              },
              {
                "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
                "connected": false,
                "num_channels": 1,
                "features": "0898882a8a59a1"
              }
            ]
          }
        }
      ]
    },
    "listsendpays.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listsendpays",
      "title": "Low-level command for querying sendpay status",
      "description": [
        "The **listsendpays** RPC command gets the status of all *sendpay* commands (which is also used by the *pay* command), or with *bolt11* or *payment_hash* limits results to that specific payment. You cannot specify both. It is possible to filter the payments also by *status*.",
        "",
        "Note that there may be more than one concurrent *sendpay* command per *pay*, so this command should be used with caution."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "bolt11": {
            "type": "string",
            "description": [
              "Bolt11 invoice."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the payment_preimage."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "complete",
              "failed"
            ],
            "description": [
              "Whether the invoice has been paid, pending, or failed."
            ]
          },
          "index": {
            "type": "string",
            "added": "v23.11",
            "enum": [
              "created",
              "updated"
            ],
            "description": [
              "If neither bolt11 or payment_hash is specified, `index` controls ordering, by `created` (default) or `updated`."
            ]
          },
          "start": {
            "type": "u64",
            "added": "v23.11",
            "description": [
              "If `index` is specified, `start` may be specified to start from that value, which is generally returned from lightning-wait(7)."
            ]
          },
          "limit": {
            "type": "u32",
            "added": "v23.11",
            "description": [
              "If `index` is specified, `limit` can be used to specify the maximum number of entries to return."
            ]
          }
        },
        "dependentUpon": {
          "index": [
            "start",
            "limit"
          ]
        }
      },
      "response": {
        "required": [
          "payments"
        ],
        "additionalProperties": false,
        "properties": {
          "payments": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "id",
                "created_index",
                "payment_hash",
                "status",
                "groupid",
                "created_at",
                "amount_sent_msat"
              ],
              "properties": {
                "created_index": {
                  "added": "v23.11",
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this payment was created in."
                  ]
                },
                "id": {
                  "type": "u64",
                  "description": [
                    "Old synonym for created_index."
                  ]
                },
                "groupid": {
                  "type": "u64",
                  "description": [
                    "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
                  ]
                },
                "partid": {
                  "type": "u64",
                  "description": [
                    "Part number (for multiple parts to a single payment)."
                  ]
                },
                "payment_hash": {
                  "type": "hash",
                  "description": [
                    "The hash of the *payment_preimage* which will prove payment."
                  ]
                },
                "updated_index": {
                  "added": "v23.11",
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this payment was changed (only present if it has changed since creation)."
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "pending",
                    "failed",
                    "complete"
                  ],
                  "description": [
                    "Status of the payment."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount delivered to destination (if known). This is not known in the case where sendonion(7) was used to manually initiate a payment without the `amount_msat` parameter."
                  ]
                },
                "destination": {
                  "type": "pubkey",
                  "description": [
                    "The final destination of the payment if known."
                  ]
                },
                "created_at": {
                  "type": "u64",
                  "description": [
                    "The UNIX timestamp showing when this payment was initiated."
                  ]
                },
                "amount_sent_msat": {
                  "type": "msat",
                  "description": [
                    "The amount sent."
                  ]
                },
                "label": {
                  "type": "string",
                  "description": [
                    "The label, if given to sendpay."
                  ]
                },
                "bolt11": {
                  "type": "string",
                  "description": [
                    "The bolt11 string (if pay supplied one)."
                  ]
                },
                "description": {
                  "type": "string",
                  "description": [
                    "The description matching the bolt11 description hash (if pay supplied one)."
                  ]
                },
                "bolt12": {
                  "type": "string",
                  "description": [
                    "The bolt12 string (if supplied for pay: **experimental-offers** only)."
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "complete"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [
                      "payment_preimage"
                    ],
                    "properties": {
                      "id": {},
                      "created_index": {},
                      "updated_index": {},
                      "partid": {},
                      "groupid": {},
                      "payment_hash": {},
                      "status": {},
                      "msatoshi": {},
                      "amount_msat": {},
                      "destination": {},
                      "created_at": {},
                      "msatoshi_sent": {},
                      "amount_sent_msat": {},
                      "label": {},
                      "bolt11": {},
                      "description": {},
                      "bolt12": {},
                      "completed_at": {
                        "type": "u64",
                        "added": "pre-v0.10.1",
                        "description": [
                          "The UNIX timestamp showing when this payment was completed."
                        ]
                      },
                      "payment_preimage": {
                        "type": "secret",
                        "description": [
                          "The proof of payment: SHA256 of this **payment_hash**."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "failed"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [],
                    "properties": {
                      "id": {},
                      "created_index": {},
                      "updated_index": {},
                      "partid": {},
                      "groupid": {},
                      "payment_hash": {},
                      "status": {},
                      "msatoshi": {},
                      "amount_msat": {},
                      "destination": {},
                      "created_at": {},
                      "completed_at": {},
                      "msatoshi_sent": {},
                      "amount_sent_msat": {},
                      "label": {},
                      "bolt11": {},
                      "description": {},
                      "bolt12": {},
                      "erroronion": {
                        "type": "hex",
                        "description": [
                          "The onion message returned."
                        ]
                      }
                    }
                  }
                },
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "pending"
                        ]
                      }
                    }
                  },
                  "then": {
                    "additionalProperties": false,
                    "required": [],
                    "properties": {
                      "id": {},
                      "created_index": {},
                      "updated_index": {},
                      "partid": {},
                      "groupid": {},
                      "payment_hash": {},
                      "status": {},
                      "msatoshi": {},
                      "amount_msat": {},
                      "destination": {},
                      "created_at": {},
                      "msatoshi_sent": {},
                      "amount_sent_msat": {},
                      "label": {},
                      "bolt11": {},
                      "description": {},
                      "bolt12": {}
                    }
                  }
                }
              ]
            }
          }
        },
        "pre_return_value_notes": [
          "Note that the returned array is ordered by increasing *id*."
        ]
      },
      "author": [
        "Christian Decker [decker.christian@gmail.com](mailto:decker.christian@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-listpays(7)",
        "lightning-sendpay(7)",
        "lightning-listinvoices(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listsendpays#1",
            "method": "listsendpays",
            "params": {
              "bolt11": "lnbcrt100n1pnt2bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000bolt11invl030100000000"
            }
          },
          "response": {
            "payments": [
              {
                "created_index": 2,
                "id": 2,
                "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
                "groupid": 1,
                "updated_index": 2,
                "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "amount_msat": 10000,
                "amount_sent_msat": 10001,
                "created_at": 1738000000,
                "completed_at": 1739000000,
                "status": "complete",
                "payment_preimage": "paymentpreimagew010101010101010101010101010101010101010101010101"
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listsendpays#2",
            "method": "listsendpays",
            "params": {}
          },
          "response": {
            "payments": [
              {
                "created_index": 2,
                "id": 2,
                "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
                "groupid": 1,
                "updated_index": 2,
                "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "amount_msat": 10000,
                "amount_sent_msat": 10001,
                "created_at": 1738000000,
                "completed_at": 1739000000,
                "status": "complete",
                "payment_preimage": "paymentpreimagew010101010101010101010101010101010101010101010101"
              },
              {
                "created_index": 3,
                "id": 3,
                "payment_hash": "paymenthashkey01k101k101k101k101k101k101k101k101k101k101k101k101",
                "groupid": 0,
                "updated_index": 3,
                "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "amount_msat": 10000,
                "amount_sent_msat": 10001,
                "created_at": 1738010000,
                "completed_at": 1739010000,
                "status": "complete",
                "payment_preimage": "paymentpreimage1010101010101010101010101010101010101010101010101"
              },
              {
                "created_index": 4,
                "id": 4,
                "payment_hash": "paymenthashkey02k201k201k201k201k201k201k201k201k201k201k201k201",
                "groupid": 0,
                "updated_index": 4,
                "destination": "nodeid040404040404040404040404040404040404040404040404040404040404",
                "amount_msat": 10000000,
                "amount_sent_msat": 10000202,
                "created_at": 1738020000,
                "completed_at": 1739020000,
                "status": "complete",
                "payment_preimage": "paymentpreimage2020202020202020202020202020202020202020202020202"
              },
              {
                "created_index": 5,
                "id": 5,
                "payment_hash": "paymenthashkey03k301k301k301k301k301k301k301k301k301k301k301k301",
                "groupid": 0,
                "updated_index": 5,
                "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "amount_msat": 10000,
                "amount_sent_msat": 10001,
                "created_at": 1738030000,
                "completed_at": 1739030000,
                "status": "failed"
              },
              {
                "created_index": 6,
                "id": 6,
                "payment_hash": "paymenthashkey03k301k301k301k301k301k301k301k301k301k301k301k301",
                "groupid": 0,
                "updated_index": 6,
                "partid": 1,
                "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "amount_msat": 10000,
                "amount_sent_msat": 10001,
                "created_at": 1738040000,
                "completed_at": 1739040000,
                "status": "complete",
                "payment_preimage": "paymentpreimage3030303030303030303030303030303030303030303030303"
              }
            ]
          }
        }
      ]
    },
    "listsqlschemas.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.02",
      "rpc": "listsqlschemas",
      "title": "Command to example lightning-sql schemas",
      "description": [
        "This allows you to examine the schemas at runtime; while they are fully documented for the current release in lightning-sql(7), as fields are added or deprecated, you can use this command to determine what fields are present.",
        "",
        "If *table* is given, only that table is in the resulting list, otherwise all tables are listed."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "table": {
            "type": "string"
          }
        }
      },
      "response": {
        "required": [
          "schemas"
        ],
        "additionalProperties": false,
        "properties": {
          "schemas": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "tablename",
                "columns"
              ],
              "properties": {
                "tablename": {
                  "type": "string",
                  "description": [
                    "The name of the table."
                  ]
                },
                "columns": {
                  "type": "array",
                  "description": [
                    "The columns, in database order."
                  ],
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "name",
                      "type"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": [
                          "The name of the column."
                        ]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "INTEGER",
                          "BLOB",
                          "TEXT",
                          "REAL"
                        ],
                        "description": [
                          "The SQL type of the column."
                        ]
                      }
                    }
                  }
                },
                "indices": {
                  "type": "array",
                  "description": [
                    "Any index we created to speed lookups."
                  ],
                  "items": {
                    "type": "array",
                    "description": [
                      "The columns for this index."
                    ],
                    "items": {
                      "type": "string",
                      "description": [
                        "The column name."
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-sql(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listsqlschemas#1",
            "method": "listsqlschemas",
            "params": {
              "table": "offers"
            }
          },
          "response": {
            "schemas": [
              {
                "tablename": "offers",
                "columns": [
                  {
                    "name": "rowid",
                    "type": "INTEGER"
                  },
                  {
                    "name": "offer_id",
                    "type": "BLOB"
                  },
                  {
                    "name": "active",
                    "type": "INTEGER"
                  },
                  {
                    "name": "single_use",
                    "type": "INTEGER"
                  },
                  {
                    "name": "bolt12",
                    "type": "TEXT"
                  },
                  {
                    "name": "used",
                    "type": "INTEGER"
                  },
                  {
                    "name": "label",
                    "type": "TEXT"
                  }
                ],
                "indices": [
                  [
                    "offer_id"
                  ]
                ]
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:listsqlschemas#2",
            "method": "listsqlschemas",
            "params": [
              "closedchannels"
            ]
          },
          "response": {
            "schemas": [
              {
                "tablename": "closedchannels",
                "columns": [
                  {
                    "name": "rowid",
                    "type": "INTEGER"
                  },
                  {
                    "name": "peer_id",
                    "type": "BLOB"
                  },
                  {
                    "name": "channel_id",
                    "type": "BLOB"
                  },
                  {
                    "name": "short_channel_id",
                    "type": "TEXT"
                  },
                  {
                    "name": "alias_local",
                    "type": "TEXT"
                  },
                  {
                    "name": "alias_remote",
                    "type": "TEXT"
                  },
                  {
                    "name": "opener",
                    "type": "TEXT"
                  },
                  {
                    "name": "closer",
                    "type": "TEXT"
                  },
                  {
                    "name": "private",
                    "type": "INTEGER"
                  },
                  {
                    "name": "total_local_commitments",
                    "type": "INTEGER"
                  },
                  {
                    "name": "total_remote_commitments",
                    "type": "INTEGER"
                  },
                  {
                    "name": "total_htlcs_sent",
                    "type": "INTEGER"
                  },
                  {
                    "name": "funding_txid",
                    "type": "BLOB"
                  },
                  {
                    "name": "funding_outnum",
                    "type": "INTEGER"
                  },
                  {
                    "name": "leased",
                    "type": "INTEGER"
                  },
                  {
                    "name": "funding_fee_paid_msat",
                    "type": "INTEGER"
                  },
                  {
                    "name": "funding_fee_rcvd_msat",
                    "type": "INTEGER"
                  },
                  {
                    "name": "funding_pushed_msat",
                    "type": "INTEGER"
                  },
                  {
                    "name": "total_msat",
                    "type": "INTEGER"
                  },
                  {
                    "name": "final_to_us_msat",
                    "type": "INTEGER"
                  },
                  {
                    "name": "min_to_us_msat",
                    "type": "INTEGER"
                  },
                  {
                    "name": "max_to_us_msat",
                    "type": "INTEGER"
                  },
                  {
                    "name": "last_commitment_txid",
                    "type": "BLOB"
                  },
                  {
                    "name": "last_commitment_fee_msat",
                    "type": "INTEGER"
                  },
                  {
                    "name": "close_cause",
                    "type": "TEXT"
                  },
                  {
                    "name": "last_stable_connection",
                    "type": "INTEGER"
                  }
                ]
              }
            ]
          }
        }
      ]
    },
    "listtransactions.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "listtransactions",
      "title": "Command to get the list of transactions that was stored in the wallet.",
      "description": [
        "The **listtransactions** command returns transactions tracked in the wallet. This includes deposits, withdrawals and transactions related to channels. A transaction may have multiple types, e.g., a transaction may both be a close and a deposit if it closes the channel and returns funds to the wallet."
      ],
      "categories": [
        "readonly"
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "response": {
        "required": [
          "transactions"
        ],
        "additionalProperties": false,
        "properties": {
          "transactions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "hash",
                "rawtx",
                "blockheight",
                "txindex",
                "locktime",
                "version",
                "inputs",
                "outputs"
              ],
              "properties": {
                "hash": {
                  "type": "txid",
                  "description": [
                    "The transaction id."
                  ]
                },
                "rawtx": {
                  "type": "hex",
                  "description": [
                    "The raw transaction."
                  ]
                },
                "blockheight": {
                  "type": "u32",
                  "description": [
                    "The block height of this tx."
                  ]
                },
                "txindex": {
                  "type": "u32",
                  "description": [
                    "The transaction number within the block."
                  ]
                },
                "locktime": {
                  "type": "u32",
                  "description": [
                    "The nLocktime for this tx."
                  ]
                },
                "version": {
                  "type": "u32",
                  "description": [
                    "The nVersion for this tx."
                  ]
                },
                "inputs": {
                  "type": "array",
                  "description": [
                    "Each input, in order."
                  ],
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "txid",
                      "index",
                      "sequence"
                    ],
                    "properties": {
                      "txid": {
                        "type": "txid",
                        "description": [
                          "The transaction id spent."
                        ]
                      },
                      "index": {
                        "type": "u32",
                        "description": [
                          "The output spent."
                        ]
                      },
                      "sequence": {
                        "type": "u32",
                        "description": [
                          "The nSequence value."
                        ]
                      }
                    }
                  }
                },
                "outputs": {
                  "type": "array",
                  "description": [
                    "Each output, in order."
                  ],
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "index",
                      "amount_msat",
                      "scriptPubKey"
                    ],
                    "properties": {
                      "index": {
                        "type": "u32",
                        "description": [
                          "The 0-based output number."
                        ]
                      },
                      "amount_msat": {
                        "type": "msat",
                        "description": [
                          "The amount of the output."
                        ]
                      },
                      "scriptPubKey": {
                        "type": "hex",
                        "description": [
                          "The scriptPubKey."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters."
      ],
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) wrote the initial version of this man page,",
        "but many others did the hard work of actually implementing this rpc command."
      ],
      "see_also": [
        "lightning-newaddr(7)",
        "lightning-listfunds(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:listtransactions#1",
            "method": "listtransactions",
            "params": {}
          },
          "response": {
            "transactions": [
              {
                "hash": "txid7000170001700017000170001700017000170001700017000170001",
                "rawtx": "02000000000101lstx70001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001700017000170001",
                "blockheight": 0,
                "txindex": 0,
                "locktime": 549000100,
                "version": 2,
                "inputs": [
                  {
                    "txid": "txid600116001160011600116001160011600116001160011600116001160011",
                    "index": 1,
                    "sequence": 2158511000
                  }
                ],
                "outputs": [
                  {
                    "index": 1,
                    "amount_msat": 201998901100,
                    "scriptPubKey": "scriptpubkey01010101010101010101010101010101010101010101010101010101"
                  }
                ]
              },
              {
                "hash": "txid7000270002700027000270002700027000270002700027000270002",
                "rawtx": "02000000000101lstx70002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002700027000270002",
                "blockheight": 102,
                "txindex": 1,
                "locktime": 549000200,
                "version": 2,
                "inputs": [
                  {
                    "txid": "txid600126001260012600126001260012600126001260012600126001260012",
                    "index": 1,
                    "sequence": 2158512000
                  }
                ],
                "outputs": [
                  {
                    "index": 1,
                    "amount_msat": 201998902100,
                    "scriptPubKey": "scriptpubkey02010201020102010201020102010201020102010201020102010201"
                  },
                  {
                    "index": 2,
                    "amount_msat": 201998902200,
                    "scriptPubKey": "scriptpubkey02020202020202020202020202020202020202020202020202020202"
                  }
                ]
              }
            ]
          }
        }
      ]
    },
    "makesecret.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "makesecret",
      "title": "Command for deriving pseudorandom key from HSM",
      "description": [
        "The **makesecret** RPC command derives a secret key from the HSM_secret."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "hex": {
            "type": "hex",
            "description": [
              "One of `hex` or `string` must be specified: `hex` can be any hex data."
            ]
          },
          "string": {
            "type": "string",
            "description": [
              "One of `hex` or `string` must be specified: `string` is a UTF-8 string interpreted literally."
            ]
          }
        }
      },
      "response": {
        "required": [
          "secret"
        ],
        "additionalProperties": false,
        "properties": {
          "secret": {
            "type": "secret",
            "description": [
              "The pseudorandom key derived from HSM_secret."
            ]
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error."
      ],
      "author": [
        "Aditya [aditya.sharma20111@gmail.com](mailto:aditya.sharma20111@gmail.com) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:makesecret#1",
            "method": "makesecret",
            "params": [
              "73636220736563726574"
            ]
          },
          "response": {
            "secret": "82d3e65651ac89124448cb88b5f4cd009f6c321f58ada0fca6e9e3f2d1c5889e"
          }
        },
        {
          "request": {
            "id": "example:makesecret#2",
            "method": "makesecret",
            "params": {
              "string": "scb secret"
            }
          },
          "response": {
            "secret": "82d3e65651ac89124448cb88b5f4cd009f6c321f58ada0fca6e9e3f2d1c5889e"
          }
        }
      ]
    },
    "multifundchannel.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "multifundchannel",
      "title": "Command for establishing many lightning channels",
      "description": [
        "The **multifundchannel** RPC command opens multiple payment channels with nodes by committing a single funding transaction to the blockchain that is shared by all channels.",
        "",
        "If not already connected, **multifundchannel** will automatically attempt to connect; you may provide a *@host:port* hint appended to the node ID so that Core Lightning can learn how to connect to the node; see lightning-connect(7).",
        "",
        "Once the transaction is confirmed, normal channel operations may begin. Readiness is indicated by **listpeers** reporting a *state* of `CHANNELD_NORMAL` for the channel."
      ],
      "request": {
        "required": [
          "destinations"
        ],
        "additionalProperties": false,
        "properties": {
          "destinations": {
            "type": "array",
            "description": [
              "There must be at least one entry in *destinations*; it cannot be an empty array."
            ],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "amount"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "description": [
                    "Node ID, with an optional *@host:port* appended to it in a manner understood by **connect**; see lightning-connect(7). Each entry in the *destinations* array must have a unique node *id*. If not already connected, **multifundchannel** will automatically attempt to connect to the node."
                  ]
                },
                "amount": {
                  "type": "sat_or_all",
                  "description": [
                    "Amount in satoshis taken from the internal wallet to fund the channel (but if we have any anchor channels, this will always leave at least `min-emergency-msat` as change). The string *all* can be used to specify all available funds (or 16,777,215 satoshi if more is available and large channels were not negotiated with the peer). Otherwise it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*. The value cannot be less than the dust limit, currently 546 satoshi as of this writing, nor more than 16,777,215 satoshi (unless large channels were negotiated with the peer)."
                  ]
                },
                "announce": {
                  "type": "boolean",
                  "description": [
                    "Flag that indicates whether to announce the channel with this. If set to `False`, the channel is unpublished."
                  ],
                  "default": "`True`"
                },
                "push_msat": {
                  "type": "msat",
                  "description": [
                    "Amount of millisatoshis to outright give to the node. This is a gift to the peer, and you do not get a proof-of-payment out of this."
                  ]
                },
                "close_to": {
                  "type": "string",
                  "description": [
                    "Bitcoin address to which the channel funds should be sent to on close. Only valid if both peers have negotiated `option_upfront_shutdown_script` Returns `close_to` set to closing script iff is negotiated."
                  ]
                },
                "request_amt": {
                  "type": "sat",
                  "description": [
                    "Amount of liquidity you'd like to lease from peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*."
                  ]
                },
                "compact_lease": {
                  "type": "string",
                  "description": [
                    "Compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel to this destination."
                  ]
                },
                "mindepth": {
                  "type": "u32",
                  "description": [
                    "Number of confirmations before we consider the channel active."
                  ]
                },
                "reserve": {
                  "type": "sat",
                  "description": [
                    "Amount we want the peer to maintain on its side of the channel. It can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*."
                  ],
                  "default": "1% of the funding amount"
                }
              }
            }
          },
          "feerate": {
            "type": "feerate",
            "description": [
              "Feerate used for the opening transaction, and if *commitment_feerate* is not set, as initial feerate for commitment and HTLC transactions. See NOTES in lightning-feerates(7) for possible values."
            ],
            "default": "*normal*"
          },
          "minconf": {
            "type": "integer",
            "description": [
              "Minimum number of confirmations that used outputs should have."
            ],
            "default": 1
          },
          "utxos": {
            "type": "array",
            "items": {
              "type": "outpoint",
              "description": [
                "Utxos to be used to fund the channel, as an array of `txid:vout`."
              ]
            }
          },
          "minchannels": {
            "type": "integer",
            "description": [
              "Re-attempt funding as long as at least this many peers remain (must not be zero). The **multifundchannel** command will only fail if too many peers fail the funding process."
            ]
          },
          "commitment_feerate": {
            "type": "feerate",
            "description": [
              "Initial feerate for commitment and HTLC transactions. See *feerate* for valid values."
            ]
          }
        }
      },
      "response": {
        "required": [
          "tx",
          "txid",
          "channel_ids"
        ],
        "additionalProperties": false,
        "properties": {
          "tx": {
            "type": "hex",
            "description": [
              "The raw transaction which funded the channel."
            ]
          },
          "txid": {
            "type": "txid",
            "description": [
              "The txid of the transaction which funded the channel."
            ]
          },
          "channel_ids": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "channel_id",
                "channel_type",
                "outnum"
              ],
              "properties": {
                "id": {
                  "type": "pubkey",
                  "description": [
                    "The peer we opened the channel with."
                  ]
                },
                "outnum": {
                  "type": "u32",
                  "description": [
                    "The 0-based output index showing which output funded the channel."
                  ]
                },
                "channel_id": {
                  "type": "hash",
                  "description": [
                    "The channel_id of the resulting channel."
                  ]
                },
                "channel_type": {
                  "type": "object",
                  "description": [
                    "Channel_type as negotiated with peer."
                  ],
                  "added": "v24.02",
                  "additionalProperties": false,
                  "required": [
                    "bits",
                    "names"
                  ],
                  "properties": {
                    "bits": {
                      "type": "array",
                      "description": [
                        "Each bit set in this channel_type."
                      ],
                      "added": "v24.02",
                      "items": {
                        "type": "u32",
                        "description": [
                          "Bit number."
                        ]
                      }
                    },
                    "names": {
                      "type": "array",
                      "description": [
                        "Feature name for each bit set in this channel_type. Note that *anchors_zero_fee_htlc_tx* is a deprecated synonym for *anchors*."
                      ],
                      "added": "v24.02",
                      "items": {
                        "type": "string",
                        "enum": [
                          "static_remotekey/even",
                          "anchor_outputs/even",
                          "anchors_zero_fee_htlc_tx/even",
                          "anchors/even",
                          "scid_alias/even",
                          "zeroconf/even"
                        ],
                        "description": [
                          "Name of feature bit."
                        ]
                      }
                    }
                  }
                },
                "close_to": {
                  "type": "hex",
                  "description": [
                    "The raw scriptPubkey which mutual close will go to; only present if *close_to* parameter was specified and peer supports `option_upfront_shutdown_script`."
                  ]
                }
              }
            }
          },
          "failed": {
            "type": "array",
            "description": [
              "Any peers we failed to open with (if *minchannels* was specified less than the number of destinations)."
            ],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "method",
                "error"
              ],
              "properties": {
                "id": {
                  "type": "pubkey",
                  "description": [
                    "The peer we failed to open the channel with."
                  ]
                },
                "method": {
                  "type": "string",
                  "enum": [
                    "connect",
                    "openchannel_init",
                    "fundchannel_start",
                    "fundchannel_complete"
                  ],
                  "description": [
                    "What stage we failed at."
                  ]
                },
                "error": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "integer",
                      "description": [
                        "JSON error code from failing stage."
                      ]
                    },
                    "message": {
                      "type": "string",
                      "description": [
                        "Message from stage."
                      ]
                    },
                    "data": {
                      "untyped": true,
                      "description": [
                        "Additional error data."
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "pre_return_value_notes": [
          "This command opens multiple channels with a single large transaction, thus only one transaction is returned.",
          "",
          "If *minchannels* was specified and is less than the number of destinations, then it is possible that one or more of the destinations do not have a channel even if **multifundchannel** succeeded."
        ],
        "post_return_value_notes": [
          "On failure, none of the channels are created."
        ]
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error.",
        "- 300: The maximum allowed funding amount is exceeded.",
        "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.",
        "- 302: The output amount is too small, and would be considered dust.",
        "- 303: Broadcasting of the funding transaction failed, the internal call to bitcoin-cli returned with an error.",
        "- 313: The `min-emergency-msat` reserve not be preserved (and we have or are opening anchor channels).",
        "",
        "Failure may also occur if **lightningd** and the peer cannot agree on channel parameters (funding limits, channel reserves, fees, etc.). See lightning-fundchannel_start(7) and lightning-fundchannel_complete(7).",
        "",
        "There may be rare edge cases where a communications failure later in the channel funding process will cancel the funding locally, but the peer thinks the channel is already waiting for funding lockin. In that case, the next time we connect to the peer, our node will tell the peer to forget the channel, but some nodes (in particular, Core Lightning nodes) will disconnect when our node tells them to forget the channel. If you immediately **multifundchannel** with that peer, it could trigger this connect-forget-disconnect behavior, causing the second **multifundchannel** to fail as well due to disconnection. Doing a **connect** with the peers separately, and waiting for a few seconds, should help clear this hurdle; running **multifundchannel** a third time would also clear this."
      ],
      "author": [
        "ZmnSCPxj [ZmnSCPxj@protonmail.com](mailto:ZmnSCPxj@protonmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-connect(7)",
        "lightning-listfunds()",
        "lightning-listpeers(7)",
        "lightning-fundchannel(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "description": [
            "This example opens three channels at once, with amounts 20,000 sats, 30,000 sats",
            "and the final channel using all remaining funds (actually, capped at 16,777,215 sats",
            "because large-channels is not enabled):"
          ],
          "request": {
            "id": "example:multifundchannel#1",
            "method": "multifundchannel",
            "params": {
              "destinations": [
                {
                  "id": "nodeid030303030303030303030303030303030303030303030303030303030303@127.0.0.1:19736",
                  "amount": "20000sat"
                },
                {
                  "id": "nodeid040404040404040404040404040404040404040404040404040404040404@127.0.0.1:19737",
                  "amount": "0.0003btc"
                },
                {
                  "id": "nodeid050505050505050505050505050505050505050505050505050505050505@127.0.0.1:19738",
                  "amount": "all"
                }
              ],
              "feerate": "10000perkw",
              "commitment_feerate": "2000perkw"
            }
          },
          "response": {
            "tx": "02000000000101multif50000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000500005000050000",
            "txid": "channeltxid01050000500005000050000500005000050000500005000050000",
            "channel_ids": [
              {
                "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "channel_id": "channelid1100011000110001100011000110001100011000110001100011000",
                "channel_type": {
                  "bits": [
                    12,
                    22
                  ],
                  "names": [
                    "static_remotekey/even",
                    "anchors/even"
                  ]
                },
                "outnum": 1
              },
              {
                "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
                "channel_id": "channelid1200012000120001200012000120001200012000120001200012000",
                "channel_type": {
                  "bits": [
                    12,
                    22
                  ],
                  "names": [
                    "static_remotekey/even",
                    "anchors/even"
                  ]
                },
                "outnum": 1
              },
              {
                "id": "nodeid050505050505050505050505050505050505050505050505050505050505",
                "channel_id": "channelid1300013000130001300013000130001300013000130001300013000",
                "channel_type": {
                  "bits": [
                    12,
                    22
                  ],
                  "names": [
                    "static_remotekey/even",
                    "anchors/even"
                  ]
                },
                "outnum": 1
              }
            ],
            "failed": []
          }
        },
        {
          "request": {
            "id": "example:multifundchannel#2",
            "method": "multifundchannel",
            "params": {
              "destinations": [
                {
                  "id": "fakenodeid03030303030303030303030303030303030303030303030303030303@127.0.0.1:19736",
                  "amount": 50000
                },
                {
                  "id": "nodeid040404040404040404040404040404040404040404040404040404040404@127.0.0.1:19737",
                  "amount": 50000
                },
                {
                  "id": "nodeid010101010101010101010101010101010101010101010101010101010101@127.0.0.1:19734",
                  "amount": 50000
                }
              ],
              "minchannels": 1
            }
          },
          "response": {
            "tx": "02000000000102multif60000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000600006000060000",
            "txid": "channeltxid02060000600006000060000600006000060000600006000060000",
            "channel_ids": [
              {
                "id": "nodeid040404040404040404040404040404040404040404040404040404040404",
                "channel_id": "channelid1520015200152001520015200152001520015200152001520015200",
                "channel_type": {
                  "bits": [
                    12,
                    22
                  ],
                  "names": [
                    "static_remotekey/even",
                    "anchors/even"
                  ]
                },
                "outnum": 1
              }
            ],
            "failed": [
              {
                "id": "03a389b3a2f7aa6f9f4ccc19f2bd7a2eba83596699e86b715caaaa147fc37f3144",
                "method": "connect",
                "error": {
                  "code": 401,
                  "message": "All addresses failed: 127.0.0.1:19736: Cryptographic handshake: peer closed connection (wrong key?). "
                }
              },
              {
                "id": "nodeid010101010101010101010101010101010101010101010101010101010101",
                "method": "connect",
                "error": {
                  "code": 402,
                  "message": "disconnected during connection"
                }
              }
            ]
          }
        }
      ]
    },
    "multiwithdraw.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "multiwithdraw",
      "title": "Command for withdrawing to multiple addresses",
      "description": [
        "The **multiwithdraw** RPC command sends funds from Core Lightning's internal wallet to the addresses specified in *outputs*."
      ],
      "request": {
        "required": [
          "outputs"
        ],
        "additionalProperties": false,
        "properties": {
          "outputs": {
            "type": "array",
            "items": {
              "type": "outputdesc"
            },
            "description": [
              "An array containing objects of the form `{address: amount}`. The `amount` may be the string *all*, indicating that all onchain funds be sent to the specified address. Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*."
            ]
          },
          "feerate": {
            "type": "feerate",
            "description": [
              "Feerate used for the withdrawals. See NOTES in lightning-feerates(7) for possible values."
            ],
            "default": "*normal*"
          },
          "minconf": {
            "type": "u32",
            "description": [
              "Minimum number of confirmations that used outputs should have."
            ],
            "default": 1
          },
          "utxos": {
            "type": "array",
            "items": {
              "type": "outpoint",
              "description": [
                "Utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set."
              ]
            }
          }
        }
      },
      "response": {
        "required": [
          "tx",
          "txid"
        ],
        "additionalProperties": false,
        "properties": {
          "tx": {
            "type": "hex",
            "description": [
              "The raw transaction which was sent."
            ]
          },
          "txid": {
            "type": "txid",
            "description": [
              "The txid of the **tx**."
            ]
          }
        }
      },
      "errors": [
        "On failure, an error is reported and the withdrawal transaction is not created.",
        "",
        "- -1: Catchall nonspecific error.",
        "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.",
        "- 302: The dust limit is not met."
      ],
      "author": [
        "ZmnSCPxj [ZmnSCPxj@protonmail.com](mailto:ZmnSCPxj@protonmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-listfunds(7)",
        "lightning-fundchannel(7)",
        "lightning-newaddr(7)",
        "lightning-txprepare(7)",
        "lightning-withdraw(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:multiwithdraw#1",
            "method": "multiwithdraw",
            "params": {
              "outputs": [
                {
                  "bcrt1q84payf4ucfcpnt0994arm3f20tqmu29cna738w": "2222000msat"
                },
                {
                  "bcrt1q64wyjwvrmdj3uyz8w32mr4qgcv08a833zepjm3": "3333000msat"
                }
              ]
            }
          },
          "response": {
            "tx": "02000000000155multiw55000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000550005500055000",
            "txid": "txid5500055000550005500055000550005500055000550005500055000"
          }
        },
        {
          "request": {
            "id": "example:multiwithdraw#2",
            "method": "multiwithdraw",
            "params": {
              "outputs": [
                {
                  "bcrt1p97zrhgxgm6wscsdx8gjafj4jyqetunat7fynrk4cyg2rz6lzrr9q6dlrp2": 1000
                },
                {
                  "bcrt1qm7k64cvd2ljw758ptwrrm8ny30u67ea3cfkxpn": 1000
                },
                {
                  "bcrt1qdgvytwcw58uwlf3lqrej2eqaku6smn2mdvkycp": 1000
                },
                {
                  "bcrt1q68wfpfam8tu3a457jv7u8r64tdvqltgfs0kj84": 1000
                },
                {
                  "bcrt1qq7g9ccvfcxhg4lcj2e4s8u6l75tdzl5y7krmtl": 1000
                },
                {
                  "bcrt1pp9uw53lnrtt9v8vkemhpf6z3jfex2dkyu8je6z0jzlem2a3tqccqvseg2y": 1000
                },
                {
                  "bcrt1q5sacyx5hjrugpcgn5w2mw9aq7d2tnkwxmmjp06": 1000
                }
              ]
            }
          },
          "response": {
            "tx": "02000000000155multiw56000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000560005600056000",
            "txid": "txid5600056000560005600056000560005600056000560005600056000"
          }
        }
      ]
    },
    "newaddr.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "newaddr",
      "title": "Command for generating a new address to be used by Core Lightning",
      "description": [
        "The **newaddr** RPC command generates a new address which can subsequently be used to fund channels managed by the Core Lightning node.",
        "",
        "The funding transaction needs to be confirmed before funds can be used.",
        "",
        "To send an on-chain payment from the Core Lightning node wallet, use `withdraw`."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "addresstype": {
            "type": "string",
            "description": [
              "It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key."
            ],
            "default": "*p2tr* address",
            "enum": [
              "bech32",
              "p2tr",
              "all"
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "p2tr": {
            "added": "v23.08",
            "type": "string",
            "description": [
              "The taproot address."
            ]
          },
          "bech32": {
            "type": "string",
            "description": [
              "The bech32 (native segwit) address."
            ]
          }
        }
      },
      "errors": [
        "If an unrecognized address type is requested an error message will be returned."
      ],
      "author": [
        "Felix [fixone@gmail.com](mailto:fixone@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-listfunds(7)",
        "lightning-fundchannel(7)",
        "lightning-withdraw(7)",
        "lightning-listtransactions(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:newaddr#1",
            "method": "newaddr",
            "params": {}
          },
          "response": {
            "bech32": "bcrt1qwx6am26cuw38y4863pd6swrce2g8mzhaxr9xp8"
          }
        },
        {
          "request": {
            "id": "example:newaddr#2",
            "method": "newaddr",
            "params": {
              "addresstype": "p2tr"
            }
          },
          "response": {
            "p2tr": "bcrt1p2gppccw6ywewmg74qqxxmqfdpjds3rpr0mf22y9tm9xcc0muggwsea9nkf"
          }
        }
      ]
    },
    "notifications.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "notifications",
      "title": "Command to set up notifications.",
      "description": [
        "The **notifications** the RPC command enabled notifications for this JSON-RPC connection. By default (and for backwards-compatibility) notifications are disabled.",
        "",
        "Various commands, especially complex and slow ones, offer notifications which indicate their progress."
      ],
      "request": {
        "required": [
          "enable"
        ],
        "additionalProperties": false,
        "properties": {
          "enable": {
            "type": "boolean",
            "description": [
              "Whether to enable or disable notifications."
            ]
          }
        }
      },
      "response": {
        "additionalProperties": false,
        "properties": {},
        "post_return_value_notes": [
          "On success, if *enable* was *true*, notifications will be forwarded from then on."
        ]
      },
      "notifications": [
        "Notifications are JSON-RPC objects without an *id* field. *lightningd* sends notifications (once enabled with this *notifications* command) with a *params* *id* field indicating which command the notification refers to.",
        "",
        "Implementations should ignore notifications without an *id* parameter, or unknown *method*.",
        "",
        "Common *method*s include:",
        "  *message*: param *message*: a descriptional string indicating something which occurred relating to the command. Param *level* indicates the level, as per lightning-getlog(7): *info* and *debug* are typical.",
        "  *progress*: param *num* and *total*, where *num* starts at 0 and is always less than *total*. Optional param *stage* with fields *num* and *total*, indicating what stage we are progressing through."
      ],
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters."
      ],
      "author": [
        "Rusty Russell [rusty@blockstream.com](mailto:rusty@blockstream.com) wrote the initial version of this man page."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "example_notifications": [
        {
          "method": "message",
          "params": {
            "id": 1,
            "message": "This is a test message",
            "level": "DEBUG"
          }
        },
        {
          "method": "progress",
          "params": {
            "id": 2,
            "num": 0,
            "total": 30,
            "stage": {
              "num": 0,
              "total": 2
            }
          }
        }
      ],
      "examples": [
        {
          "request": {
            "id": "example:notifications#1",
            "method": "notifications",
            "params": {
              "enable": true
            }
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:notifications#2",
            "method": "notifications",
            "params": {
              "enable": false
            }
          },
          "response": {}
        }
      ]
    },
    "offer.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "offer",
      "title": "Command for accepting payments",
      "description": [
        "The **offer** RPC command creates an offer (or returns an existing one), which is a precursor to creating one or more invoices. It automatically enables the processing of an incoming invoice_request, and issuing of invoices.",
        "",
        "Note that for making an offer to *pay* someone else, see lightning- invoicerequest(7)."
      ],
      "request": {
        "required": [
          "amount"
        ],
        "additionalProperties": false,
        "properties": {
          "amount": {
            "oneOf": [
              {
                "type": "msat_or_any"
              },
              {
                "type": "currency"
              }
            ],
            "description": [
              "Can be the string `any`, which creates an offer that can be paid with any amount (e.g. a donation). Otherwise it can be a positive value in millisatoshi precision; it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. It can also have an ISO 4217 postfix (e.g. USD), in which case currency conversion will need to be done for the invoice itself. A plugin is needed which provides the `currencyconvert` API for this currency, otherwise the offer creation will fail."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "A short description of purpose of the offer, e.g. *coffee*. This value is encoded into the resulting offer and is viewable by anyone you expose this offer to. It must be UTF-8, and cannot use *\\u* JSON escape codes."
            ]
          },
          "issuer": {
            "type": "string",
            "description": [
              "Who is issuing this offer (i.e. you) if appropriate."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "An internal-use name for the offer, which can be any UTF-8 string. This is *NOT* encoded in the offer not sent to the issuer."
            ]
          },
          "quantity_max": {
            "type": "u64",
            "description": [
              "Invoice can specify more than one of the items up (and including) this maximum: 0 is a special value meaning `no maximuim`. The *amount* for the invoice will need to be multiplied accordingly. This is encoded in the offer."
            ]
          },
          "absolute_expiry": {
            "type": "u64",
            "description": [
              "Time the offer is valid until,in seconds since the first day of 1970 UTC. If not set, the offer remains valid (though it can be deactivated by the issuer of course). This is encoded in the offer."
            ]
          },
          "recurrence": {
            "type": "string",
            "description": [
              "An invoice is expected at regular intervals. The argument is a positive number followed by one of `seconds`, `minutes`, `hours`, `days`, `weeks`, or `months` (variants without the trailing `s` are also permitted). This is encoded in the offer. The semantics of recurrence is fairly predictable, but fully documented in BOLT 12. e.g. `4weeks`."
            ]
          },
          "recurrence_base": {
            "type": "integer",
            "description": [
              "Time in seconds since the first day of 1970 UTC. This indicates when the first period begins; without this, the recurrence periods start from the first invoice."
            ]
          },
          "recurrence_paywindow": {
            "type": "string",
            "description": [
              "Argument of form `-time+time`. The first time is the number of seconds before the start of a period in which an invoice and payment is valid, the second time is the number of seconds after the start of the period. For example *-604800+86400* means you can fetch an pay the invoice 4 weeks before the given period starts, and up to 1 day afterwards. The optional *%* indicates that the amount of the invoice will be scaled by the time remaining in the period. This is encoded in the offer."
            ],
            "default": "that payment is allowed during the current and previous periods"
          },
          "recurrence_limit": {
            "type": "u32",
            "description": [
              "To indicate the maximum period which exists. eg. `12` means there are 13 periods, from 0 to 12 inclusive. This is encoded in the offer."
            ]
          },
          "single_use": {
            "type": "boolean",
            "description": [
              "Indicates that the offer is only valid once; we may issue multiple invoices, but as soon as one is paid all other invoices will be expired (i.e. only one person can pay this offer)."
            ],
            "default": "False"
          },
          "proportional_amount": {
            "added": "v25.09",
            "type": "boolean",
            "description": [
              "Payment will be charged for the initial period proportional to the amount remaining (only makes sense if recurrence_base is specified)"
            ]
          },
          "optional_recurrence": {
            "added": "v25.09",
            "type": "boolean",
            "description": [
              "Make recurrence optional, for backwards compatibility (older payers will only pay once)."
            ]
          },
          "fronting_nodes": {
            "added": "v26.04",
            "type": "array",
            "items": {
              "type": "pubkey"
            },
            "description": [
              "An optional array of peer nodes to create blinded paths from.  One of these blinded paths will also be used for the invoice, when they request it.  This overrides the `payment-fronting-node` configuration setting.  If set to the empty array, this means *no fronting nodes*."
            ],
            "default": "The `payment-fronting-node` configuration setting"
          },
          "dev_paths": {
            "hidden": true
          }
        }
      },
      "response": {
        "required": [
          "offer_id",
          "active",
          "single_use",
          "bolt12",
          "used",
          "created"
        ],
        "additionalProperties": false,
        "properties": {
          "offer_id": {
            "type": "hash",
            "description": [
              "The id of this offer (merkle hash of non-signature fields)."
            ]
          },
          "active": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": [
              "Whether this can still be used."
            ]
          },
          "single_use": {
            "type": "boolean",
            "description": [
              "Whether this expires as soon as it's paid (reflects the *single_use* parameter)."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The bolt12 encoding of the offer."
            ]
          },
          "used": {
            "type": "boolean",
            "description": [
              "True if an associated invoice has been paid."
            ]
          },
          "created": {
            "type": "boolean",
            "description": [
              "False if the offer already existed."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "The (optional) user-specified label."
            ]
          }
        }
      },
      "errors": [
        "On failure, an error is returned and no offer is created. If the lightning process fails before responding, the caller should use lightning-listoffers(7) to query whether this offer was created or not.",
        "",
        "If the offer already existed, and is still active, that is returned; if it's not active then this call fails.",
        "",
        "- -1: Catchall nonspecific error.",
        "- 1000: Offer with this offer_id already exists (but is not active)."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listoffers(7)",
        "lightning-disableoffer(7)",
        "lightning-invoicerequest(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:offer#1",
            "method": "offer",
            "params": {
              "amount": "10000msat",
              "description": "Fish sale!"
            }
          },
          "response": {
            "offer_id": "offeridl21000002100000210000021000002100000210000021000002100000",
            "active": true,
            "single_use": false,
            "bolt12": "lno1qgsq000bolt210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000",
            "used": false,
            "created": true
          }
        },
        {
          "request": {
            "id": "example:offer#2",
            "method": "offer",
            "params": {
              "amount": "1000sat",
              "description": "Coffee",
              "quantity_max": 10
            }
          },
          "response": {
            "offer_id": "offeridl22000002200000220000022000002200000220000022000002200000",
            "active": true,
            "single_use": false,
            "bolt12": "lno1qgsq000bolt220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000",
            "used": false,
            "created": true
          }
        }
      ]
    },
    "openchannel_abort.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "openchannel_abort",
      "title": "Command to abort a channel to a peer",
      "description": [
        "`openchannel_abort` is a low level RPC command which initiates an abort for specified channel. It uses the openchannel protocol which allows for interactive transaction construction."
      ],
      "request": {
        "required": [
          "channel_id"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "Channel id of the channel to be aborted."
            ]
          }
        }
      },
      "response": {
        "required": [
          "channel_id",
          "channel_canceled",
          "reason"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel id of the aborted channel."
            ]
          },
          "channel_canceled": {
            "type": "boolean",
            "description": [
              "Whether this is completely canceled (there may be remaining in-flight transactions)."
            ]
          },
          "reason": {
            "type": "string",
            "description": [
              "Usually \"Abort requested\", but if it happened to fail at the same time it could be different."
            ]
          }
        }
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: Catchall nonspecific error.",
        "- 305: Peer is not connected.",
        "- 311: Unknown channel id.",
        "- 312: Channel in an invalid state"
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-openchannel_init(7)",
        "lightning-openchannel_update(7)",
        "lightning-openchannel_signed(7)",
        "lightning-openchannel_bump(7)",
        "lightning-fundchannel_start(7)",
        "lightning-fundchannel_complete(7)",
        "lightning-fundchannel(7)",
        "lightning-fundpsbt(7)",
        "lightning-utxopsbt(7)",
        "lightning-multifundchannel(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:openchannel_abort#1",
            "method": "openchannel_abort",
            "params": {
              "channel_id": "channelid0111200111200111200111200111200111200111200111200111200"
            }
          },
          "response": {
            "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
            "channel_canceled": false,
            "reason": "Abort requested"
          }
        }
      ]
    },
    "openchannel_bump.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "openchannel_bump",
      "title": "Command to initiate a channel RBF",
      "description": [
        "`openchannel_bump` is a RPC command which initiates a channel RBF (Replace-By-Fee) for the specified channel. It uses the openchannel protocol which allows for interactive transaction construction.",
        "",
        "Warning: bumping a leased channel will lose the lease."
      ],
      "request": {
        "required": [
          "channel_id",
          "amount",
          "initialpsbt"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "Id of the channel to RBF."
            ]
          },
          "amount": {
            "type": "sat",
            "description": [
              "Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel."
            ]
          },
          "initialpsbt": {
            "type": "string",
            "description": [
              "The funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met."
            ]
          },
          "funding_feerate": {
            "type": "feerate",
            "description": [
              "Feerate for the funding transaction."
            ],
            "default": "1/64th greater than the last feerate used for this channel"
          }
        }
      },
      "response": {
        "required": [
          "channel_id",
          "channel_type",
          "psbt",
          "commitments_secured",
          "funding_serial"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel id of the channel."
            ]
          },
          "channel_type": {
            "type": "object",
            "description": [
              "Channel_type as negotiated with peer."
            ],
            "added": "v24.02",
            "additionalProperties": false,
            "required": [
              "bits",
              "names"
            ],
            "properties": {
              "bits": {
                "type": "array",
                "description": [
                  "Each bit set in this channel_type."
                ],
                "added": "v24.02",
                "items": {
                  "type": "u32",
                  "description": [
                    "Bit number."
                  ]
                }
              },
              "names": {
                "type": "array",
                "description": [
                  "Feature name for each bit set in this channel_type. Note that *anchors_zero_fee_htlc_tx* is a deprecated synonym for *anchors*."
                ],
                "added": "v24.02",
                "items": {
                  "type": "string",
                  "enum": [
                    "static_remotekey/even",
                    "anchor_outputs/even",
                    "anchors_zero_fee_htlc_tx/even",
                    "anchors/even",
                    "scid_alias/even",
                    "zeroconf/even"
                  ],
                  "description": [
                    "Name of feature bit."
                  ]
                }
              }
            }
          },
          "psbt": {
            "type": "string",
            "description": [
              "The (incomplete) PSBT of the RBF transaction."
            ]
          },
          "commitments_secured": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": [
              "Whether the *psbt* is complete."
            ]
          },
          "funding_serial": {
            "type": "u64",
            "description": [
              "The serial_id of the funding output in the *psbt*."
            ]
          },
          "requires_confirmed_inputs": {
            "type": "boolean",
            "description": [
              "Does peer require confirmed inputs in psbt?"
            ]
          }
        },
        "post_return_value_notes": [
          "If the peer does not support `option_dual_fund`, this command will return an error.",
          "",
          "If the channel is not in a state that is eligible for RBF, this command will return an error."
        ]
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: Catchall nonspecific error.",
        "- 300: The amount exceeded the maximum configured funding amount.",
        "- 301: The provided PSBT cannot afford the funding amount.",
        "- 305: Peer is not connected.",
        "- 309: PSBT missing required fields",
        "- 311: Unknown channel id.",
        "- 312: Channel in an invalid state"
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-openchannel_init(7)",
        "lightning-openchannel_update(7)",
        "lightning-openchannel_signed(7)",
        "lightning-openchannel_abort(7)",
        "lightning-fundchannel_start(7)",
        "lightning-fundchannel_complete(7)",
        "lightning-fundchannel(7)",
        "lightning-fundpsbt(7)",
        "lightning-utxopsbt(7)",
        "lightning-multifundchannel(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:openchannel_bump#1",
            "method": "openchannel_bump",
            "params": [
              "b020c1c6818daf024954c9ee578caad058cbcae7dd75b2c4d38b8f6f81901ff5",
              1000000,
              "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000",
              "15000perkw"
            ]
          },
          "response": {
            "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000810000",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "commitments_secured": false,
            "funding_serial": 17725655605188030000,
            "requires_confirmed_inputs": false
          }
        },
        {
          "request": {
            "id": "example:openchannel_bump#2",
            "method": "openchannel_bump",
            "params": {
              "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
              "amount": 1000000,
              "initialpsbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000",
              "funding_feerate": "15000perkw"
            }
          },
          "response": {
            "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "commitments_secured": false,
            "funding_serial": 17725655605188040000,
            "requires_confirmed_inputs": false
          }
        },
        {
          "request": {
            "id": "example:openchannel_bump#3",
            "method": "openchannel_bump",
            "params": [
              "b020c1c6818daf024954c9ee578caad058cbcae7dd75b2c4d38b8f6f81901ff5",
              2000000,
              "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000",
              "18750perkw"
            ]
          },
          "response": {
            "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "commitments_secured": false,
            "funding_serial": 17725655605188050000,
            "requires_confirmed_inputs": false
          }
        }
      ]
    },
    "openchannel_init.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "openchannel_init",
      "title": "Command to initiate a channel to a peer",
      "description": [
        "`openchannel_init` is a low level RPC command which initiates a channel open with a specified peer. It uses the openchannel protocol which allows for interactive transaction construction."
      ],
      "request": {
        "required": [
          "id",
          "amount",
          "initialpsbt"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "Node id of the remote peer."
            ]
          },
          "amount": {
            "type": "sat",
            "description": [
              "Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel."
            ]
          },
          "initialpsbt": {
            "type": "string",
            "description": [
              "Funded, incomplete PSBT that specifies the UTXOs and change output for our channel contribution. It can be updated, see `openchannel_update`; *initialpsbt* must have at least one input. Must have the Non-Witness UTXO (PSBT_IN_NON_WITNESS_UTXO) set for every input. An error (code 309) will be returned if this requirement is not met."
            ]
          },
          "commitment_feerate": {
            "type": "feerate",
            "description": [
              "Feerate for commitment transactions for non-anchor channels: see **fundchannel**. For anchor channels, it is ignored."
            ]
          },
          "funding_feerate": {
            "type": "feerate",
            "description": [
              "Feerate for the funding transaction."
            ],
            "default": "'opening' feerate"
          },
          "announce": {
            "type": "boolean",
            "description": [
              "Whether or not to announce this channel."
            ]
          },
          "close_to": {
            "type": "string",
            "description": [
              "Bitcoin address to which the channel funds should be sent on close. Only valid if both peers have negotiated `option_upfront_shutdown_script`."
            ]
          },
          "request_amt": {
            "type": "sat",
            "description": [
              "An amount of liquidity you'd like to lease from the peer. If peer supports `option_will_fund`, indicates to them to include this much liquidity into the channel. Must also pass in *compact_lease*."
            ]
          },
          "compact_lease": {
            "type": "hex",
            "description": [
              "A compact representation of the peer's expected channel lease terms. If the peer's terms don't match this set, we will fail to open the channel."
            ]
          },
          "channel_type": {
            "type": "array",
            "description": [
              "Each bit set in this channel_type."
            ],
            "items": {
              "type": "u32",
              "description": [
                "Bit number."
              ]
            }
          }
        }
      },
      "response": {
        "required": [
          "channel_id",
          "psbt",
          "channel_type",
          "commitments_secured",
          "funding_serial"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel id of the channel."
            ]
          },
          "psbt": {
            "type": "string",
            "description": [
              "The (incomplete) PSBT of the funding transaction."
            ]
          },
          "channel_type": {
            "type": "object",
            "description": [
              "Channel_type as negotiated with peer."
            ],
            "added": "v24.02",
            "additionalProperties": false,
            "required": [
              "bits",
              "names"
            ],
            "properties": {
              "bits": {
                "type": "array",
                "description": [
                  "Each bit set in this channel_type."
                ],
                "added": "v24.02",
                "items": {
                  "type": "u32",
                  "description": [
                    "Bit number."
                  ]
                }
              },
              "names": {
                "type": "array",
                "description": [
                  "Feature name for each bit set in this channel_type. Note that *anchors_zero_fee_htlc_tx* is a deprecated synonym for *anchors*."
                ],
                "added": "v24.02",
                "items": {
                  "type": "string",
                  "enum": [
                    "static_remotekey/even",
                    "anchor_outputs/even",
                    "anchors_zero_fee_htlc_tx/even",
                    "anchors/even",
                    "scid_alias/even",
                    "zeroconf/even"
                  ],
                  "description": [
                    "Name of feature bit."
                  ]
                }
              }
            }
          },
          "commitments_secured": {
            "type": "boolean",
            "enum": [
              false
            ],
            "description": [
              "Whether the *psbt* is complete."
            ]
          },
          "funding_serial": {
            "type": "u64",
            "description": [
              "The serial_id of the funding output in the *psbt*."
            ]
          },
          "requires_confirmed_inputs": {
            "type": "boolean",
            "description": [
              "Does peer require confirmed inputs in psbt?"
            ]
          }
        },
        "post_return_value_notes": [
          "If the peer does not support `option_dual_fund`, this command will return an error.",
          "",
          "If you sent a *request_amt* and the peer supports `option_will_fund` and is interested in leasing you liquidity in this channel, returns their updated channel fee max (*channel_fee_proportional_basis*, *channel_fee_base_msat*), updated rate card for the lease fee (*lease_fee_proportional_basis*, *lease_fee_base_sat*) and their on-chain weight *weight_charge*, which will be added to the lease fee at a rate of *funding_feerate* * *weight_charge* / 1000."
        ]
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: Catchall nonspecific error.",
        "- 300: The amount exceeded the maximum configured funding amount.",
        "- 301: The provided PSBT cannot afford the funding amount.",
        "- 304: Still syncing with bitcoin network",
        "- 305: Peer is not connected.",
        "- 306: Unknown peer id.",
        "- 309: PSBT missing required fields",
        "- 310: v2 channel open protocol not supported by peer",
        "- 312: Channel in an invalid state"
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-openchannel_update(7)",
        "lightning-openchannel_signed(7)",
        "lightning-openchannel_abort(7)",
        "lightning-openchannel_bump(7)",
        "lightning-fundchannel_start(7)",
        "lightning-fundchannel_complete(7)",
        "lightning-fundchannel(7)",
        "lightning-fundpsbt(7)",
        "lightning-utxopsbt(7)",
        "lightning-multifundchannel(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:openchannel_init#1",
            "method": "openchannel_init",
            "params": {
              "id": "nodeid121212121212121212121212121212121212121212121212121212121212",
              "amount": 1000000,
              "initialpsbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000"
            }
          },
          "response": {
            "channel_id": "a5be438539f73c018a98a4b9dd557d62430881c56552025b5579d180cc3887ed",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000610000",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "commitments_secured": false,
            "funding_serial": 17725655605188010000,
            "requires_confirmed_inputs": false
          }
        },
        {
          "request": {
            "id": "example:openchannel_init#2",
            "method": "openchannel_init",
            "params": [
              "nodeid121212121212121212121212121212121212121212121212121212121212",
              500000,
              "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000"
            ]
          },
          "response": {
            "channel_id": "b3b2e46371876858784cd1b87ecf406e32d8f98b7a44b7f436d1dca317ce0f1b",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000710000",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "commitments_secured": false,
            "funding_serial": 17725655605188020000,
            "requires_confirmed_inputs": false
          }
        }
      ]
    },
    "openchannel_signed.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "openchannel_signed",
      "title": "Command to conclude a channel open",
      "description": [
        "`openchannel_signed` is a low level RPC command which concludes a channel open with the specified peer. It uses the v2 openchannel protocol, which allows for interactive transaction construction.",
        "",
        "This command should be called after `openchannel_update` returns *commitments_secured* `true`.",
        "",
        "This command will broadcast the finalized funding transaction, if we receive valid signatures from the peer."
      ],
      "request": {
        "required": [
          "channel_id",
          "signed_psbt"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "Id of the channel."
            ]
          },
          "signed_psbt": {
            "type": "string",
            "description": [
              "The PSBT returned from `openchannel_update` (where *commitments_secured* was true) with partial signatures or finalized witness stacks included for every input that we contributed to the PSBT."
            ]
          }
        }
      },
      "response": {
        "required": [
          "channel_id",
          "tx",
          "txid"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel id of the channel."
            ]
          },
          "tx": {
            "type": "hex",
            "description": [
              "The funding transaction."
            ]
          },
          "txid": {
            "type": "txid",
            "description": [
              "The txid of the **tx**."
            ]
          }
        }
      },
      "errors": [
        "On error, the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: Catchall nonspecific error.",
        "- 303: Funding transaction broadcast failed.",
        "- 305: Peer is not connected.",
        "- 309: PSBT missing required fields.",
        "- 311: Unknown channel id.",
        "- 312: Channel in an invalid state"
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-openchannel_init(7)",
        "lightning-openchannel_update(7)",
        "lightning-openchannel_abort(7)",
        "lightning-openchannel_bump(7)",
        "lightning-fundchannel_start(7)",
        "lightning-fundchannel_complete(7)",
        "lightning-fundchannel(7)",
        "lightning-fundpsbt(7)",
        "lightning-utxopsbt(7)",
        "lightning-multifundchannel(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:openchannel_signed#1",
            "method": "openchannel_signed",
            "params": {
              "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
              "signed_psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000"
            }
          },
          "response": {
            "tx": "02000000000101sgpsbt11000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000",
            "txid": "txidocsigned1011000110001100011000110001100011000110001100011000",
            "channel_id": "channelid0111200111200111200111200111200111200111200111200111200"
          }
        },
        {
          "request": {
            "id": "example:openchannel_signed#2",
            "method": "openchannel_signed",
            "params": [
              "b020c1c6818daf024954c9ee578caad058cbcae7dd75b2c4d38b8f6f81901ff5",
              "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000"
            ]
          },
          "response": {
            "tx": "02000000000101sgpsbt12000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000120001200012000",
            "txid": "txidocsigned1012000120001200012000120001200012000120001200012000",
            "channel_id": "channelid0111200111200111200111200111200111200111200111200111200"
          }
        }
      ]
    },
    "openchannel_update.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "openchannel_update",
      "title": "Command to update a collab channel open",
      "description": [
        "`openchannel_update` is a low level RPC command which continues an open channel, as specified by *channel_id*. An updated *psbt* is passed in; any changes from the PSBT last returned (either from `openchannel_init` or a previous call to `openchannel_update`) will be communicated to the peer.",
        "",
        "Must be called after `openchannel_init` and before `openchannel_signed`.",
        "",
        "Must be called until *commitments_secured* is returned as true, at which point `openchannel_signed` should be called with a signed version of the PSBT returned by the last call to `openchannel_update`."
      ],
      "request": {
        "required": [
          "channel_id",
          "psbt"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "Id of the channel."
            ]
          },
          "psbt": {
            "type": "string",
            "description": [
              "Updated PSBT to be sent to the peer. May be identical to the PSBT last returned by either `openchannel_init` or `openchannel_update`."
            ]
          }
        }
      },
      "response": {
        "required": [
          "channel_id",
          "psbt",
          "commitments_secured",
          "channel_type",
          "funding_outnum"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel id of the channel."
            ]
          },
          "channel_type": {
            "type": "object",
            "description": [
              "Channel_type as negotiated with peer."
            ],
            "added": "v24.02",
            "additionalProperties": false,
            "required": [
              "bits",
              "names"
            ],
            "properties": {
              "bits": {
                "type": "array",
                "description": [
                  "Each bit set in this channel_type."
                ],
                "added": "v24.02",
                "items": {
                  "type": "u32",
                  "description": [
                    "Bit number."
                  ]
                }
              },
              "names": {
                "type": "array",
                "description": [
                  "Feature name for each bit set in this channel_type. Note that *anchors_zero_fee_htlc_tx* is a deprecated synonym for *anchors*."
                ],
                "added": "v24.02",
                "items": {
                  "type": "string",
                  "enum": [
                    "static_remotekey/even",
                    "anchor_outputs/even",
                    "anchors_zero_fee_htlc_tx/even",
                    "anchors/even",
                    "scid_alias/even",
                    "zeroconf/even"
                  ],
                  "description": [
                    "Name of feature bit."
                  ]
                }
              }
            }
          },
          "psbt": {
            "type": "string",
            "description": [
              "The PSBT of the funding transaction."
            ]
          },
          "commitments_secured": {
            "type": "boolean",
            "description": [
              "Whether the *psbt* is complete (if true, sign *psbt* and call `openchannel_signed` to complete the channel open)."
            ]
          },
          "funding_outnum": {
            "type": "u32",
            "description": [
              "The index of the funding output in the psbt."
            ]
          },
          "close_to": {
            "type": "hex",
            "description": [
              "Scriptpubkey which we have to close to if we mutual close."
            ]
          },
          "requires_confirmed_inputs": {
            "type": "boolean",
            "description": [
              "Does peer require confirmed inputs in psbt?"
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "commitments_secured": {
                  "type": "boolean",
                  "enum": [
                    true
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": true,
              "required": [
                "channel_id",
                "funding_outnum"
              ],
              "properties": {
                "commitments_secured": {},
                "channel_id": {
                  "type": "hash",
                  "description": [
                    "The derived channel id."
                  ]
                },
                "close_to": {
                  "type": "hex",
                  "description": [
                    "If a `close_to` address was provided to `openchannel_init` and the peer supports `option_upfront_shutdownscript`."
                  ]
                },
                "funding_outnum": {
                  "type": "u32",
                  "description": [
                    "The index of the funding output for this channel in the funding transaction."
                  ]
                }
              }
            },
            "else": {
              "additionalProperties": false,
              "properties": {
                "commitments_secured": {}
              }
            }
          }
        ]
      },
      "errors": [
        "On error, the returned object will contain `code` and `message` properties,",
        "with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: Catchall nonspecific error.",
        "- 305: Peer is not connected.",
        "- 309: PSBT missing required fields",
        "- 311: Unknown channel id.",
        "- 312: Channel in an invalid state"
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-openchannel_init(7)",
        "lightning-openchannel_signed(7)",
        "lightning-openchannel_bump(7)",
        "lightning-openchannel_abort(7)",
        "lightning-fundchannel_start(7)",
        "lightning-fundchannel_complete(7)",
        "lightning-fundchannel(7)",
        "lightning-fundpsbt(7)",
        "lightning-utxopsbt(7)",
        "lightning-multifundchannel(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:openchannel_update#1",
            "method": "openchannel_update",
            "params": {
              "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
              "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000"
            }
          },
          "response": {
            "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "commitments_secured": true,
            "funding_outnum": 1,
            "close_to": "51202321a432c9022a560c7dae78bdb72c605c373961edd29c42aa98c183782d052a"
          }
        },
        {
          "request": {
            "id": "example:openchannel_update#2",
            "method": "openchannel_update",
            "params": [
              "b020c1c6818daf024954c9ee578caad058cbcae7dd75b2c4d38b8f6f81901ff5",
              "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000"
            ]
          },
          "response": {
            "channel_id": "channelid0111200111200111200111200111200111200111200111200111200",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000",
            "channel_type": {
              "bits": [
                12,
                22
              ],
              "names": [
                "static_remotekey/even",
                "anchors/even"
              ]
            },
            "commitments_secured": true,
            "funding_outnum": 1,
            "close_to": "51202321a432c9022a560c7dae78bdb72c605c373961edd29c42aa98c183782d052a"
          }
        }
      ]
    },
    "parsefeerate.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "parsefeerate",
      "title": "Command for parsing a feerate string to a feerate",
      "description": [
        "The **parsefeerate** command returns the current feerate for any valid *feerate_str*. This is useful for finding the current feerate that a **fundpsbt** or **utxopsbt** command might use."
      ],
      "request": {
        "required": [
          "feerate_str"
        ],
        "additionalProperties": false,
        "properties": {
          "feerate_str": {
            "type": "string",
            "description": [
              "The feerate string to parse."
            ]
          }
        }
      },
      "response": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "perkw": {
            "type": "u32",
            "description": [
              "Value of *feerate_str* in kilosipa."
            ],
            "additionalProperties": false
          }
        }
      },
      "errors": [
        "The **parsefeerate** command will error if the *feerate_str* format is not recognized.",
        "",
        "- -32602: If the given parameters are wrong."
      ],
      "trivia": [
        "In CLN we like to call the weight unit \"sipa\" in honor of Pieter Wuille, who uses the name \"sipa\" on IRC and elsewhere. Internally we call the *perkw* style as \"feerate per kilosipa\"."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:parsefeerate#1",
            "method": "parsefeerate",
            "params": [
              "unilateral_close"
            ]
          },
          "response": {
            "perkw": 11000
          }
        },
        {
          "request": {
            "id": "example:parsefeerate#2",
            "method": "parsefeerate",
            "params": [
              "9999perkw"
            ]
          },
          "response": {
            "perkw": 9999
          }
        },
        {
          "request": {
            "id": "example:parsefeerate#3",
            "method": "parsefeerate",
            "params": [
              10000
            ]
          },
          "response": {
            "perkw": 2500
          }
        },
        {
          "request": {
            "id": "example:parsefeerate#4",
            "method": "parsefeerate",
            "params": [
              "urgent"
            ]
          },
          "response": {
            "perkw": 11000
          }
        }
      ]
    },
    "pay.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "pay",
      "title": "Command for sending a payment to a BOLT11 invoice",
      "description": [
        "The **pay** RPC command attempts to find a route to the given destination, and send the funds it asks for. .",
        "",
        "The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **pay** with the same *bolt11* will succeed immediately.",
        "",
        "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name."
      ],
      "request": {
        "required": [
          "bolt11"
        ],
        "additionalProperties": false,
        "properties": {
          "bolt11": {
            "type": "string",
            "description": [
              "Bolt11 or bolt12 invoice (such as one received from lightningd-fetchinvoice(7)). For a bolt11 invoice, if it does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "*amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "It is used to attach a label to payments, and is returned in lightning- listpays(7) and lightning-listsendpays(7)."
            ]
          },
          "riskfactor": {
            "type": "number",
            "description": [
              "The *riskfactor* is described in detail in lightning-getroute(7)."
            ],
            "default": "10"
          },
          "maxfeepercent": {
            "type": "number",
            "description": [
              "Percentage of the amount that is to be paid."
            ],
            "default": "0.5"
          },
          "retry_for": {
            "type": "u16",
            "description": [
              "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment."
            ],
            "default": "60 seconds"
          },
          "maxdelay": {
            "type": "u16",
            "description": [
              "A payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case."
            ]
          },
          "exemptfee": {
            "type": "msat",
            "description": [
              "This option can be used for tiny payments which would be dominated by the fee leveraged by forwarding nodes. Setting `exemptfee` allows the  `maxfeepercent` check to be skipped on fees that are smaller than `exemptfee`."
            ],
            "default": "5000 millisatoshi"
          },
          "localinvreqid": {
            "type": "hex",
            "description": [
              "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7). This  ensures that we only make a single payment for an offer, and that the offer is marked `used` once paid."
            ]
          },
          "exclude": {
            "type": "array",
            "description": [
              "*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing."
            ],
            "default": "not to exclude any channels or nodes",
            "items": {
              "oneOf": [
                {
                  "type": "short_channel_id_dir"
                },
                {
                  "type": "pubkey"
                }
              ]
            }
          },
          "maxfee": {
            "type": "msat",
            "description": [
              "*maxfee* overrides both *maxfeepercent* and *exemptfee* defaults (and if you specify *maxfee* you cannot specify either of those), and creates an absolute limit on what fee we will pay. This allows you to implement your own heuristics rather than the primitive ones used here."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "It is only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid."
            ]
          },
          "partial_msat": {
            "type": "msat",
            "added": "v23.05",
            "description": [
              "Explicitly state that you are only paying some part of the invoice.  Presumably someone else is paying the rest (otherwise the payment will time out at the recipient).  Note that this is currently not supported for self-payment (please file an issue if you need this)"
            ]
          }
        }
      },
      "response": {
        "required": [
          "payment_preimage",
          "payment_hash",
          "created_at",
          "parts",
          "amount_msat",
          "amount_sent_msat",
          "status"
        ],
        "additionalProperties": false,
        "properties": {
          "payment_preimage": {
            "type": "secret",
            "description": [
              "The proof of payment: SHA256 of this **payment_hash**."
            ]
          },
          "destination": {
            "type": "pubkey",
            "description": [
              "The final destination of the payment."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "created_at": {
            "type": "number",
            "description": [
              "The UNIX timestamp showing when this payment was initiated."
            ]
          },
          "parts": {
            "type": "u32",
            "description": [
              "How many attempts this took."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Amount the recipient received."
            ]
          },
          "amount_sent_msat": {
            "type": "msat",
            "description": [
              "Total amount we sent (including fees)."
            ]
          },
          "warning_partial_completion": {
            "type": "string",
            "description": [
              "Not all parts of a multi-part payment have completed."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "complete",
              "pending",
              "failed"
            ],
            "description": [
              "Status of payment."
            ]
          }
        },
        "post_return_value_notes": [
          "You can monitor the progress and retries of a payment using the lightning-paystatus(7) command."
        ]
      },
      "randomization": [
        "To protect user privacy, the payment algorithm performs some randomization.",
        "",
        "1: Route Randomization",
        "",
        "Route randomization means the payment algorithm does not always use the lowest-fee or shortest route. This prevents some highly-connected node from learning all of the user payments by reducing their fees below the network average.",
        "",
        "2: Shadow Route",
        "",
        "Shadow route means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.",
        "",
        "Route randomization will never exceed *maxfeepercent* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*."
      ],
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error.",
        "- 201: Already paid with this *hash* using different amount or destination.",
        "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object (except for self-payment, which currently returns the error directly from lightning-sendpay(7)).",
        "- 205: Unable to find a route.",
        "- 206: Route too expensive. Either the fee or the needed total locktime for the route exceeds your *maxfeepercent* or *maxdelay* settings, respectively. The *data* field of the error will indicate the actual *fee* as well as the *feepercent* percentage that the fee has of the destination payment amount. It will also indicate the actual *delay* along the route.",
        "- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment. The *data* field of the error indicates *now* (the current time) and *expiry* (the invoice expiration) as UNIX epoch time in seconds.",
        "- 210: Payment timed out without a payment in progress.",
        "",
        "Error codes 202 and 204 will only get reported at **sendpay**; in **pay** we will keep retrying if we would have gotten those errors.",
        "",
        "A routing failure object has the fields below:",
        "",
        "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.",
        "*erring_node*: The hex string of the pubkey id of the node that reported the error.",
        "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error.",
        "*failcode*: The failure code, as per BOLT #4.",
        "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4.",
        "",
        "The *data* field of errors will include statistics *getroute_tries* and *sendpay_tries*. It will also contain a *failures* field with detailed data about routing errors."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listpays(7)",
        "lightning-decode(7)",
        "lightning-listinvoices(7)",
        "lightning-delinvoice(7)",
        "lightning-getroute(7)",
        "lightning-invoice(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:pay#1",
            "method": "pay",
            "params": [
              "lnbcrt100n1pnt2bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000bolt11invl032000000000"
            ]
          },
          "response": {
            "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
            "payment_hash": "paymenthashinvl0320032003200320032003200320032003200320032003200",
            "created_at": 1738000000,
            "parts": 1,
            "amount_msat": 50000,
            "amount_sent_msat": 50001,
            "payment_preimage": "paymentpreimagep010101010101010101010101010101010101010101010101",
            "status": "complete"
          }
        },
        {
          "request": {
            "id": "example:pay#2",
            "method": "pay",
            "params": {
              "bolt11": "lnbcrt100n1pnt2bolt11invl030300000000bolt11invl030300000000bolt11invl030300000000bolt11invl030300000000bolt11invl030300000000bolt11invl030300000000bolt11invl030300000000bolt11invl030300000000bolt11invl030300000000bolt11invl030300000000"
            }
          },
          "response": {
            "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
            "payment_hash": "paymenthashinvl0330033003300330033003300330033003300330033003300",
            "created_at": 1738000000,
            "parts": 1,
            "amount_msat": 100000,
            "amount_sent_msat": 100000,
            "payment_preimage": "paymentpreimagep020202020202020202020202020202020202020202020202",
            "status": "complete"
          }
        }
      ]
    },
    "ping.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "ping",
      "title": "Command to check if a node is up.",
      "description": [
        "The **ping** command checks if the node with *id* is ready to talk. It only works for peers we are currently connected with."
      ],
      "request": {
        "required": [
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "The pubkey of the node to ping."
            ]
          },
          "len": {
            "type": "u16",
            "description": [
              "The length of the ping."
            ],
            "default": "128"
          },
          "pongbytes": {
            "type": "u16",
            "description": [
              "The length of the reply. A value of 65532 to 65535 means `don't reply`."
            ],
            "default": "128"
          }
        }
      },
      "response": {
        "required": [
          "totlen"
        ],
        "additionalProperties": false,
        "properties": {
          "totlen": {
            "type": "u16",
            "description": [
              "The answer length of the reply message (including header: 0 means no reply expected)."
            ]
          }
        }
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters or we're already waiting for a ping response from peer."
      ],
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) wrote the initial version of this man page,",
        "but many others did the hard work of actually implementing this rpc command."
      ],
      "see_also": [
        "lightning-connect(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:ping#1",
            "method": "ping",
            "params": {
              "id": "nodeid010101010101010101010101010101010101010101010101010101010101",
              "len": 128,
              "pongbytes": 128
            }
          },
          "response": {
            "totlen": 132
          }
        },
        {
          "request": {
            "id": "example:ping#2",
            "method": "ping",
            "params": {
              "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "len": 1000,
              "pongbytes": 65535
            }
          },
          "response": {
            "totlen": 0
          }
        }
      ]
    },
    "plugin.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": true,
      "rpc": "plugin",
      "title": "Manage plugins with RPC",
      "description": [
        "The **plugin** RPC command can be used to control dynamic plugins, i.e. plugins that declared themself 'dynamic' (in getmanifest)."
      ],
      "request": {
        "required": [
          "subcommand"
        ],
        "oneOfMany": [
          [
            "plugin",
            "directory"
          ]
        ],
        "additionalProperties": true,
        "properties": {
          "subcommand": {
            "type": "string",
            "enum": [
              "start",
              "stop",
              "rescan",
              "startdir",
              "list"
            ],
            "description": [
              "Determines what action is taken:",
              "  - *subcommand* **start** takes a *path* to an executable as argument and starts it as plugin. *path* may be an absolute path or a path relative to the plugins directory (default *~/.lightning/plugins*). If the plugin is already running and the executable (checksum) has changed, the plugin is killed and restarted except if its an important (or builtin) plugin. If the plugin doesn't complete the 'getmanifest' and 'init' handshakes within 60 seconds, the command will timeout and kill the plugin. Additional *options* may be passed to the plugin, but requires all parameters to be passed as keyword=value pairs using the `-k|--keyword` option which is recommended. For example the following command starts the plugin helloworld.py (present in the plugin directory) with the option greeting set to 'A crazy':",
              "    ```shell",
              "    lightning-cli -k plugin subcommand=start plugin=helloworld.py greeting='A crazy'",
              "    ```",
              "  - *subcommand* **stop** takes a plugin executable *path* or *name* as argument and stops the plugin. If the plugin subscribed to 'shutdown', it may take up to 30 seconds before this command returns. If the plugin is important and dynamic, this will shutdown `lightningd`.",
              "  - *subcommand* **startdir** starts all executables it can find in *directory* (excl. subdirectories) as plugins. Checksum and timeout behavior as in **start** applies.",
              "  - *subcommand* **rescan** starts all plugins in the default plugins directory (default *~/.lightning/plugins*) that are not already running. Checksum and timeout behavior as in **start** applies.",
              "  - *subcommand* **list** lists all running plugins (incl. non-dynamic)."
            ]
          },
          "plugin": {
            "type": "string",
            "description": [
              "*path* or *name* of a plugin executable to start or stop."
            ]
          },
          "directory": {
            "type": "string",
            "description": [
              "*path* of a directory containing plugins."
            ]
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string",
              "description": [
                "*keyword=value* options passed to plugin, can be repeated."
              ]
            }
          }
        }
      },
      "response": {
        "required": [
          "command"
        ],
        "additionalProperties": true,
        "properties": {
          "command": {
            "type": "string",
            "enum": [
              "start",
              "stop",
              "rescan",
              "startdir",
              "list"
            ],
            "description": [
              "The subcommand this is responding to."
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "command": {
                  "type": "string",
                  "enum": [
                    "start",
                    "startdir",
                    "rescan",
                    "list"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "command",
                "plugins"
              ],
              "properties": {
                "command": {},
                "plugins": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "name",
                      "active",
                      "dynamic"
                    ],
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": [
                          "Full pathname of the plugin."
                        ]
                      },
                      "active": {
                        "type": "boolean",
                        "description": [
                          "Status; plugin completed init and is operational, plugins are configured asynchronously."
                        ]
                      },
                      "dynamic": {
                        "type": "boolean",
                        "description": [
                          "Plugin can be stopped or started without restarting lightningd."
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "command": {
                  "type": "string",
                  "enum": [
                    "stop"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "command",
                "result"
              ],
              "properties": {
                "command": {},
                "result": {
                  "type": "string",
                  "description": [
                    "A message saying it successfully stopped."
                  ]
                }
              }
            }
          }
        ]
      },
      "errors": [
        "On error, the reason why the action could not be taken upon the plugin is returned."
      ],
      "author": [
        "Antoine Poinsot [darosior@protonmail.com](mailto:darosior@protonmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-cli(1)",
        "lightning-listconfigs(7)",
        "[writing plugins][writing plugins]"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)",
        "",
        "[writing plugins]: https://docs.corelightning.org/docs/plugin-development"
      ],
      "examples": [
        {
          "request": {
            "id": "example:plugin#1",
            "method": "plugin",
            "params": {
              "subcommand": "start",
              "plugin": "/root/lightning/tests/plugins/allow_even_msgs.py"
            }
          },
          "response": {
            "command": "start",
            "plugins": [
              {
                "name": "/root/lightning/plugins/autoclean",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/chanbackup",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/bcli",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/commando",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/funder",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/topology",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/exposesecret",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/keysend",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/offers",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/pay",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/recklessrpc",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/recover",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/txprepare",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/cln-renepay",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/cln-xpay",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/spenderp",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/cln-askrene",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/sql",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/cln-grpc",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/cln-lsps-client",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/cln-bip353",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/bookkeeper",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/tests/plugins/allow_even_msgs.py",
                "active": true,
                "dynamic": true
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:plugin#2",
            "method": "plugin",
            "params": {
              "subcommand": "stop",
              "plugin": "/root/lightning/tests/plugins/allow_even_msgs.py"
            }
          },
          "response": {
            "command": "stop",
            "result": "Successfully stopped allow_even_msgs.py."
          }
        },
        {
          "request": {
            "id": "example:plugin#3",
            "method": "plugin",
            "params": [
              "list"
            ]
          },
          "response": {
            "command": "list",
            "plugins": [
              {
                "name": "/root/lightning/plugins/autoclean",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/chanbackup",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/bcli",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/commando",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/funder",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/topology",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/exposesecret",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/keysend",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/offers",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/pay",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/recklessrpc",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/recover",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/txprepare",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/cln-renepay",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/cln-xpay",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/spenderp",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/cln-askrene",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/sql",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/cln-grpc",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/cln-lsps-client",
                "active": true,
                "dynamic": false
              },
              {
                "name": "/root/lightning/plugins/cln-bip353",
                "active": true,
                "dynamic": true
              },
              {
                "name": "/root/lightning/plugins/bookkeeper",
                "active": true,
                "dynamic": false
              }
            ]
          }
        }
      ]
    },
    "preapproveinvoice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.02",
      "rpc": "preapproveinvoice",
      "title": "Ask the HSM to preapprove an invoice (low-level)",
      "description": [
        "The **preapproveinvoice** RPC command submits the *bolt11* invoice to the HSM to check that it is approved for payment.",
        "",
        "Generally the **preapproveinvoice** request does not need to be made explicitly, it is automatically generated as part of a **pay** request.",
        "",
        "By default, the HSM will approve all **preapproveinvoice** requests.",
        "",
        "If a remote signer is being used it might decline an **preapproveinvoice** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.",
        "",
        "If a remote signer declines a **preapproveinvoice** request a subsequent attempt to pay the invoice anyway will fail; the signer will refuse to sign the commitment."
      ],
      "request": {
        "required": [
          "bolt11"
        ],
        "additionalProperties": false,
        "properties": {
          "bolt11": {
            "type": "string",
            "description": [
              "Bolt11 invoice to submit to the HSM to check."
            ],
            "added": "v23.02"
          }
        }
      },
      "response": {
        "additionalProperties": false,
        "properties": {}
      },
      "author": [
        "Ken Sedgwick [ken@bonsai.com](mailto:ken@bonsai.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-pay(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:preapproveinvoice#1",
            "method": "preapproveinvoice",
            "params": {
              "bolt11": "lnbcrt100n1pnt2bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000bolt11invl020400000000"
            }
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:preapproveinvoice#2",
            "method": "preapproveinvoice",
            "params": [
              "lnbcrt100n1pnt2bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000bolt11invl020500000000"
            ]
          },
          "response": {}
        }
      ]
    },
    "preapprovekeysend.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.02",
      "rpc": "preapprovekeysend",
      "title": "Ask the HSM to preapprove a keysend payment (low-level)",
      "description": [
        "The **preapprovekeysend** RPC command submits the *destination*, *payment_hash*, and *amount_msat* parameters to the HSM to check that they are approved as a keysend payment.",
        "",
        "Generally the **preapprovekeysend** request does not need to be made explicitly, it is automatically generated as part of a **keysend** request.",
        "",
        "By default, the HSM will approve all **preapprovekeysend** requests.",
        "",
        "If a remote signer is being used it might decline an **preapprovekeysend** request because it would exceed velocity controls, is not covered by allowlist controls, was declined manually, or other reasons.",
        "",
        "If a remote signer declines a **preapprovekeysend** request a subsequent attempt to pay the keysend anyway will fail; the signer will refuse to sign the commitment."
      ],
      "request": {
        "required": [
          "destination",
          "payment_hash",
          "amount_msat"
        ],
        "additionalProperties": false,
        "properties": {
          "destination": {
            "type": "pubkey",
            "description": [
              "It is a 33 byte, hex-encoded, node ID of the node that the payment should go to."
            ],
            "added": "v23.02"
          },
          "payment_hash": {
            "type": "hex",
            "added": "v23.02",
            "description": [
              "It is the unique identifier of a payment."
            ],
            "maxLength": 64,
            "minLength": 64
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount to send in millisatoshi precision; it can be a whole number, or a whole number with suffix `msat` or `sat`, or a three decimal point number with suffix `sat`, or an 1 to 11 decimal point number suffixed by `btc`."
            ],
            "added": "v23.02"
          }
        }
      },
      "response": {
        "additionalProperties": false,
        "properties": {}
      },
      "author": [
        "Ken Sedgwick [ken@bonsai.com](mailto:ken@bonsai.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-keysend(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:preapprovekeysend#1",
            "method": "preapprovekeysend",
            "params": {
              "destination": "nodeid020202020202020202020202020202020202020202020202020202020202",
              "payment_hash": "0000000000000000000000000000000000000000000000000000000000000000",
              "amount_msat": 1000
            }
          },
          "response": {}
        },
        {
          "request": {
            "id": "example:preapprovekeysend#2",
            "method": "preapprovekeysend",
            "params": [
              "nodeid050505050505050505050505050505050505050505050505050505050505",
              "0101010101010101010101010101010101010101010101010101010101010101",
              2000
            ]
          },
          "response": {}
        }
      ]
    },
    "reckless.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "reckless",
      "title": "Issue a command to the reckless plugin manager utility",
      "description": [
        "The **reckless** RPC starts a reckless process with the *command* and *target* provided.  Node configuration, network, and lightning direrctory are automatically passed to the reckless utility."
      ],
      "request": {
        "required": [
          "command"
        ],
        "additionalProperties": false,
        "properties": {
          "command": {
            "type": "string",
            "enum": [
              "install",
              "uninstall",
              "search",
              "enable",
              "disable",
              "source",
              "--version"
            ],
            "description": [
              "Determines which command to pass to reckless",
              "  - *command* **install** takes a *plugin_name* to search for and install a named plugin.",
              "  - *command* **uninstall** takes a *plugin_name* and attempts to uninstall a plugin of the same name.",
              "  - *command* **search** takes a *plugin_name* to search for a named plugin.",
              "..."
            ]
          },
          "target/subcommand": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array"
              }
            ],
            "description": [
              "Target of a reckless command or a subcommand."
            ]
          },
          "target": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array"
              }
            ],
            "description": [
              "*name* of a plugin to install/uninstall/search/enable/disable or source to add/remove."
            ]
          }
        }
      },
      "response": {
        "required": [
          "log",
          "result"
        ],
        "additionalProperties": false,
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": [
              "Output of the requested reckless command."
            ]
          },
          "log": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": [
              "Verbose log entries of the requested reckless command."
            ]
          }
        }
      },
      "author": [
        "Alex Myers [alex@endothermic.dev](mailto:alex@endothermic.dev) is mainly responsible."
      ],
      "see_also": [
        "reckless(1)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:reckless#1",
            "method": "reckless",
            "params": {
              "command": "search",
              "target/subcommand": "backup"
            }
          },
          "response": {
            "result": [
              "https://github.com/lightningd/plugins"
            ],
            "log": [
              "DEBUG: Warning: Reckless requires write access",
              "DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/contents/",
              "DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/git/trees/294f93d7060799439c994daa84f534c4d1458325",
              "INFO: found backup in source: https://github.com/lightningd/plugins",
              "DEBUG: entry: None",
              "DEBUG: sub-directory: backup"
            ]
          }
        },
        {
          "request": {
            "id": "example:reckless#2",
            "method": "reckless",
            "params": {
              "command": "install",
              "target/subcommand": [
                "summars",
                "currecyrate"
              ]
            }
          },
          "response": {
            "result": [
              "/tmp/l1/reckless/summars",
              "/tmp/l1/reckless/currencyrate"
            ],
            "log": [
              "DEBUG: Searching for summars",
              "DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/contents/",
              "DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/git/trees/294f93d7060799439c994daa84f534c4d1458325",
              "INFO: found summars in source: https://github.com/lightningd/plugins",
              "DEBUG: entry: None",
              "DEBUG: sub-directory: summars",
              "DEBUG: Retrieving summars from https://github.com/lightningd/plugins",
              "DEBUG: Install requested from InstInfo(summars, https://github.com/lightningd/plugins, None, None, None, summars).",
              "INFO: cloning Source.GITHUB_REPO InstInfo(summars, https://github.com/lightningd/plugins, None, None, None, summars)",
              "DEBUG: cloned_src: InstInfo(summars, /tmp/reckless-726255950dyifh_fh/clone, None, Cargo.toml, Cargo.toml, summars/summars)",
              "DEBUG: using latest commit of default branch",
              "DEBUG: checked out HEAD: 5e449468bd57db7d0f33178fe0dc867e0da94133",
              "DEBUG: using installer rust",
              "DEBUG: creating /tmp/l1/reckless/summars",
              "DEBUG: creating /tmp/l1/reckless/summars/source",
              "DEBUG: copying /tmp/reckless-726255950dyifh_fh/clone/summars/summars tree to /tmp/l1/reckless/summars/source/summars",
              "DEBUG: linking source /tmp/l1/reckless/summars/source/summars/Cargo.toml to /tmp/l1/reckless/summars/Cargo.toml",
              "DEBUG: InstInfo(summars, /tmp/l1/reckless/summars, None, Cargo.toml, Cargo.toml, source/summars)",
              "DEBUG: cargo installing from /tmp/l1/reckless/summars/source/summars",
              "DEBUG: rust project compiled successfully",
              "INFO: plugin installed: /tmp/l1/reckless/summars",
              "DEBUG: activating summars",
              "INFO: summars enabled",
              "DEBUG: Searching for currencyrate",
              "DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/contents/",
              "DEBUG: fetching from gh API: https://api.github.com/repos/lightningd/plugins/git/trees/294f93d7060799439c994daa84f534c4d1458325",
              "INFO: found currencyrate in source: https://github.com/lightningd/plugins",
              "DEBUG: entry: None",
              "DEBUG: sub-directory: currencyrate",
              "DEBUG: Retrieving currencyrate from https://github.com/lightningd/plugins",
              "DEBUG: Install requested from InstInfo(currencyrate, https://github.com/lightningd/plugins, None, None, None, currencyrate).",
              "INFO: cloning Source.GITHUB_REPO InstInfo(currencyrate, https://github.com/lightningd/plugins, None, None, None, currencyrate)",
              "DEBUG: cloned_src: InstInfo(currencyrate, /tmp/reckless-192564272t478naxn/clone, None, currencyrate.py, requirements.txt, currencyrate/currencyrate)",
              "DEBUG: using latest commit of default branch",
              "DEBUG: checked out HEAD: 5e449468bd57db7d0f33178fe0dc867e0da94133",
              "DEBUG: using installer python3venv",
              "DEBUG: creating /tmp/l1/reckless/currencyrate",
              "DEBUG: creating /tmp/l1/reckless/currencyrate/source",
              "DEBUG: copying /tmp/reckless-192564272t478naxn/clone/currencyrate/currencyrate tree to /tmp/l1/reckless/currencyrate/source/currencyrate",
              "DEBUG: linking source /tmp/l1/reckless/currencyrate/source/currencyrate/currencyrate.py to /tmp/l1/reckless/currencyrate/currencyrate.py",
              "DEBUG: InstInfo(currencyrate, /tmp/l1/reckless/currencyrate, None, currencyrate.py, requirements.txt, source/currencyrate)",
              "DEBUG: configuring a python virtual environment (pip) in /tmp/l1/reckless/currencyrate/.venv",
              "DEBUG: virtual environment created in /tmp/l1/reckless/currencyrate/.venv.",
              "INFO: dependencies installed successfully",
              "DEBUG: virtual environment for cloned plugin: .venv",
              "INFO: plugin installed: /tmp/l1/reckless/currencyrate",
              "DEBUG: activating currencyrate",
              "INFO: currencyrate enabled"
            ]
          }
        }
      ]
    },
    "recover.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "recover",
      "title": "Reinitialize Your Node for Recovery",
      "description": [
        "The **recover** RPC command wipes your node and restarts it with the `--recover` option. This is only permitted if the node is unused: no channels, no bitcoin addresses issued (you can use `check` to see if recovery is possible).",
        "",
        "For nodes created with v25.12 or later, *hsmsecret* MUST be the 12-word mnemonic.",
        "",
        "For earlier nodes, *hsmsecret* is either a codex32 secret starting with \"cl1\" as returned by `lightning-hsmtool getcodexsecret`, or a raw 64 character hex string.",
        "",
        "NOTE: this command only currently works with the `sqlite3` database backend."
      ],
      "request": {
        "required": [
          "hsmsecret"
        ],
        "additionalProperties": false,
        "properties": {
          "hsmsecret": {
            "type": "string",
            "description": [
              "Usually a 12-word mnemonic; but for old nodes either a codex32 secret starting with `cl1` as returned by `lightning-hsmtool getcodexsecret` or a raw 64 character hex string."
            ]
          }
        }
      },
      "response": {
        "required": [
          "result"
        ],
        "additionalProperties": false,
        "properties": {
          "result": {
            "type": "string",
            "added": "v24.05",
            "enum": [
              "Recovery restart in progress"
            ]
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@blockstream.com](mailto:rusty@blockstream.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-hsmtool(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:recover#1",
            "method": "recover",
            "params": {
              "hsmsecret": "6c696768746e696e672d36000000000000000000000000000000000000000000"
            }
          },
          "response": {
            "result": "Recovery restart in progress"
          }
        },
        {
          "request": {
            "id": "example:recover#2",
            "method": "recover",
            "params": {
              "hsmsecret": "cl10leetsd35kw6r5de5kueedxyesqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqluplcg0lxenqd"
            }
          },
          "response": {
            "result": "Recovery restart in progress"
          }
        }
      ]
    },
    "recoverchannel.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "recoverchannel",
      "title": "Command for recovering channels bundeled in an array in the form of *Static Backup*",
      "description": [
        "The **recoverchannel** RPC command tries to force the peer (with whom you already had a channel) to close the channel and sweeps on-chain fund. This method is not spontaneous and depends on the peer, so use it in case of severe data loss.",
        "",
        "The *scb* parameter is an array containing minimum required info to reconnect and sweep funds. You can get the scb for already stored channels by using the RPC command 'staticbackup'."
      ],
      "request": {
        "required": [
          "scb"
        ],
        "additionalProperties": false,
        "properties": {
          "scb": {
            "type": "array",
            "description": [
              "SCB of the channels in an array."
            ],
            "items": {
              "type": "hex"
            }
          }
        }
      },
      "response": {
        "required": [
          "stubs"
        ],
        "additionalProperties": false,
        "properties": {
          "stubs": {
            "type": "array",
            "items": {
              "type": "string",
              "description": [
                "Channel IDs of channels successfully inserted."
              ]
            }
          }
        }
      },
      "author": [
        "Aditya [aditya.sharma20111@gmail.com](mailto:aditya.sharma20111@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-getsharedsecret(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:recoverchannel#1",
            "method": "recoverchannel",
            "params": {
              "scb": [
                "0000000000000001channelid0340000340000340000340000340000340000340000340000340000nodeid03030303030303030303030303030303030303030303030303030303030300017f000001034003400340034003400340034003400340034003400340034003400340034003400340034003400340034003400003401000",
                "0000000000000002channelid0340200340200340200340200340200340200340200340200340200nodeid03030303030303030303030303030303030303030303030303030303030300017f000001034203420342034203420342034203420342034203420342034203420342034203420342034203420342034203420003401000",
                "0000000000000003channelid0410000410000410000410000410000410000410000410000410000nodeid01010101010101010101010101010101010101010101010101010101010100017f000001041004100410041004100410041004100410041004100410041004100410041004100410041004100410041004100003401000",
                "0000000000000004channelid0120000120000120000120000120000120000120000120000120000nodeid01010101010101010101010101010101010101010101010101010101010100017f000001012001200120012001200120012001200120012001200120012001200120012001200120012001200120012001200003401000",
                "0000000000000005channelid1520015200152001520015200152001520015200152001520015200nodeid01010101010101010101010101010101010101010101010101010101010100017f000001015201520152015201520152015201520152015201520152015201520152015201520152015201520152015201520003401000",
                "0000000000000006channelid1240012400124001240012400124001240012400124001240012400nodeid02020202020202020202020202020202020202020202020202020202020200017f000001012401240124012401240124012401240124012401240124012401240124012401240124012401240124012401240003401000"
              ]
            }
          },
          "response": {
            "stubs": [
              "09eb55872cd9039ecd08281af756e23b15aad4129fd6a9bcd71b472114ebf43a",
              "21bd30cac60f477f2c4267220b1702a6ec5780db34f9934fa94b8c0508bf3357",
              "222d999f537e32e9458c5db17a63e012dcced61340de06fda5bc30566270b0aa",
              "7512083907c74ed3a045e9bf772b3d72948eb93daf84a1cee57108800451aaf2",
              "a4a379248e49d207cc984646e632e1a31105a85708b9d6d961a5018fdd489f5a",
              "f4e1de801de57374d5737da622611e3a1ad9f16d5df9c30fceecc11ce732eeeb"
            ]
          }
        }
      ]
    },
    "renepay.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "renepay",
      "title": "Command for sending a payment to a BOLT11 invoice",
      "added": "v23.08",
      "description": [
        "**renepay** is a new payment plugin based on Pickhardt-Richter optimization method for Multi-Path-Payments. This implementation has not been thoroughly tested and it should be used with caution.",
        "",
        "The response will occur when the payment fails or succeeds. Once a payment has succeeded, calls to **renepay** with the same *invstring* will not lead to a new payment attempt, but instead it will succeed immediately.",
        "",
        "When using *lightning-cli*, you may skip optional parameters by using *null*. Alternatively, use **-k** option to provide parameters by name."
      ],
      "request": {
        "required": [
          "invstring"
        ],
        "additionalProperties": false,
        "properties": {
          "invstring": {
            "type": "string",
            "description": [
              "Bolt11 invoice which the RPC command attempts to pay. Currently, **renepay** supports bolt11 invoices only."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "If the *invstring* does not contain an amount, *amount_msat* is required, otherwise if it is specified it must be *null*. in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*."
            ]
          },
          "maxfee": {
            "type": "msat",
            "description": [
              "*maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value."
            ]
          },
          "maxdelay": {
            "type": "u32",
            "description": [
              "Overrides the value of `max-locktime-blocks` for this payment. It serves to limit the locktime of funds in the payment HTLC measured in blocks."
            ]
          },
          "retry_for": {
            "type": "u32",
            "description": [
              "Measured in seconds specifies how much time it is allowed for the command to keep retrying the payment."
            ],
            "default": "60 seconds"
          },
          "description": {
            "type": "string",
            "description": [
              "Only required for bolt11 invoices which do not contain a description themselves, but contain a description hash: in this case *description* is required. *description* is then checked against the hash inside the invoice before it will be paid."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "Used to attach a label to payments, and is returned in lightning-listpays(7) and lightning-listsendpays(7)."
            ]
          },
          "exclude": {
            "added": "v24.08",
            "type": "array",
            "description": [
              "*exclude* is a JSON array of short-channel-id/direction (e.g. [ '564334x877x1/0', '564195x1292x0/1' ]) or pubkey which should be excluded from consideration for routing."
            ],
            "default": "not to exclude any channels or nodes",
            "items": {
              "oneOf": [
                {
                  "type": "short_channel_id_dir"
                },
                {
                  "type": "pubkey"
                }
              ]
            }
          },
          "dev_use_shadow": {
            "hidden": true,
            "type": "boolean"
          }
        }
      },
      "response": {
        "required": [
          "payment_preimage",
          "payment_hash",
          "created_at",
          "parts",
          "amount_msat",
          "amount_sent_msat",
          "status"
        ],
        "additionalProperties": false,
        "properties": {
          "payment_preimage": {
            "type": "secret",
            "description": [
              "The proof of payment: SHA256 of this **payment_hash**."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "bolt11": {
            "type": "string",
            "added": "v23.08",
            "description": [
              "The bolt11 invoice paid."
            ]
          },
          "bolt12": {
            "type": "string",
            "added": "v23.08",
            "description": [
              "The bolt12 invoice paid."
            ]
          },
          "created_at": {
            "type": "number",
            "description": [
              "The UNIX timestamp showing when this payment was initiated."
            ]
          },
          "groupid": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "The groupid used for these payment parts (as can be seen in listsendpays)"
            ]
          },
          "parts": {
            "type": "u32",
            "description": [
              "How many attempts this took."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Amount the recipient received."
            ]
          },
          "amount_sent_msat": {
            "type": "msat",
            "description": [
              "Total amount we sent (including fees)."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "complete",
              "pending",
              "failed"
            ],
            "description": [
              "Status of payment."
            ]
          },
          "destination": {
            "type": "pubkey",
            "description": [
              "The final destination of the payment."
            ]
          }
        },
        "post_return_value_notes": [
          "You can monitor the progress and retries of a payment using the lightning-renepaystatus(7) command."
        ]
      },
      "optimality": [
        "**renepay** is based on the work by Pickhardt-Richter's *Optimally Reliable & Cheap Payment Flows on the Lightning Network*. Which means the payment command will prefer routes that have a higher probability of success while keeping fees low.",
        "",
        "The algorithm records some partial knowledge of the state of the Network deduced from the responses obtained after evey payment attempt. This knowledge is kept through different payment requests, but decays with time to account for the dynamics of the Network (after 1 hour all previous knowledge will be erased). Knowledge from previous payment attempts increases the reliability for subsequent ones.",
        "",
        "Higher probabilities of success and lower fees cannot generally by optimized at once. Hence **renepay** combines the two in different amounts seeking solutions that satisfy *maxfee* bound and a target for 90% probability of success. *maxfee* is a hard bound, in the sense that the command will never attempt a payment when the fees exceed that value. While the probability target is not compulsory (but desirable), i.e. if the best route does not satisfy the 90% probability target it will be tried anyways.",
        "",
        "When *maxfee* and the 90% probability bounds are satified, the algorithm will optimize the fees to its lowest value."
      ],
      "randomization": [
        "To protect user privacy, the payment algorithm performs *shadow route* randomization. Which means the payment algorithm will virtually extend the route by adding delays and fees along it, making it appear to intermediate nodes that the route is longer than it actually is. This prevents intermediate nodes from reliably guessing their distance from the payee.",
        "",
        "Route randomization will never exceed *maxfee* of the payment. Route randomization and shadow routing will not take routes that would exceed *maxdelay*."
      ],
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error.",
        "- 200: Other payment attempts are in progress.",
        "- 203: Permanent failure at destination.",
        "- 205: Unable to find a route.",
        "- 206: Payment routes are too expensive.",
        "- 207: Invoice expired. Payment took too long before expiration, or already expired at the time you initiated payment.",
        "- 210: Payment timed out without a payment in progress.",
        "- 212: Invoice is invalid."
      ],
      "author": [
        "Eduardo Quintana-Miranda [eduardo.quintana@pm.me](mailto:eduardo.quintana@pm.me) is mainly responsible."
      ],
      "see_also": [
        "lightning-renepaystatus(7)",
        "lightning-listpays(7)",
        "lightning-invoice(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)",
        "",
        "Pickhardt R. and Richter S., *Optimally Reliable & Cheap Payment Flows on the Lightning Network* [https://arxiv.org/abs/2107.05322](https://arxiv.org/abs/2107.05322)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:renepay#1",
            "method": "renepay",
            "params": {
              "invstring": "lnbcrt100n1pnt2bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000",
              "amount_msat": 400000
            }
          },
          "response": {
            "bolt11": "lnbcrt100n1pnt2bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000",
            "amount_msat": 400000,
            "payment_hash": "paymenthashinvl0210021002100210021002100210021002100210021002100",
            "destination": "nodeid020202020202020202020202020202020202020202020202020202020202",
            "created_at": 1738000000,
            "groupid": 1,
            "parts": 2,
            "status": "complete",
            "payment_preimage": "paymentpreimager010101010101010101010101010101010101010101010101",
            "amount_sent_msat": 400000
          }
        },
        {
          "request": {
            "id": "example:renepay#2",
            "method": "renepay",
            "params": {
              "invstring": "lnbcrt100n1pnt2bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000"
            }
          },
          "response": {
            "bolt11": "lnbcrt100n1pnt2bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000bolt11invl030400000000",
            "amount_msat": 4000,
            "payment_hash": "paymenthashinvl0340034003400340034003400340034003400340034003400",
            "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
            "created_at": 1738000000,
            "groupid": 1,
            "parts": 2,
            "status": "complete",
            "payment_preimage": "paymentpreimager020202020202020202020202020202020202020202020202",
            "amount_sent_msat": 4000
          }
        }
      ]
    },
    "renepaystatus.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "renepaystatus",
      "title": "Command for quering the status of previous renepay attempts",
      "added": "v23.08",
      "description": [
        "The **renepaystatus** RPC command queries the payment plugin **renepay** for the status of previous payment attempts.",
        "",
        "This command always succeeds."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "invstring": {
            "type": "string",
            "description": [
              "If specified, the command will return a list of payment attempts whose invoice matches *invstring*, otherwise all payments with be listed."
            ]
          }
        }
      },
      "response": {
        "required": [
          "paystatus"
        ],
        "additionalProperties": false,
        "properties": {
          "paystatus": {
            "type": "array",
            "description": [
              "A list of payments attempted by renepay."
            ],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "bolt11",
                "payment_hash",
                "created_at",
                "groupid",
                "amount_msat",
                "status"
              ],
              "properties": {
                "bolt11": {
                  "type": "string",
                  "description": [
                    "Invoice string BOLT11."
                  ]
                },
                "payment_preimage": {
                  "type": "secret",
                  "description": [
                    "The proof of payment: SHA256 of this **payment_hash** (for completed payments only)."
                  ]
                },
                "payment_hash": {
                  "type": "hash",
                  "description": [
                    "The hash of the *payment_preimage* which will prove payment."
                  ]
                },
                "created_at": {
                  "type": "number",
                  "description": [
                    "The UNIX timestamp showing when this payment was initiated."
                  ]
                },
                "groupid": {
                  "type": "u32",
                  "description": [
                    "The id for this payment attempt."
                  ]
                },
                "parts": {
                  "type": "u32",
                  "description": [
                    "How many attempts this took."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "Amount the recipient received."
                  ]
                },
                "amount_sent_msat": {
                  "type": "msat",
                  "description": [
                    "Total amount we sent including fees (for completed payments only)."
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "complete",
                    "pending",
                    "failed"
                  ],
                  "description": [
                    "Status of payment."
                  ]
                },
                "destination": {
                  "type": "pubkey",
                  "description": [
                    "The final destination of the payment."
                  ]
                },
                "notes": {
                  "type": "array",
                  "description": [
                    "A list of messages for debugging purposes."
                  ],
                  "items": {
                    "type": "string",
                    "description": [
                      "A message generated by renepay."
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "author": [
        "Eduardo Quintana-Miranda [eduardo.quintana@pm.me](mailto:eduardo.quintana@pm.me) is mainly responsible."
      ],
      "see_also": [
        "lightning-renepay(7)",
        "lightning-listpays(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:renepaystatus#1",
            "method": "renepaystatus",
            "params": {
              "invstring": "lnbcrt100n1pnt2bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000"
            }
          },
          "response": {
            "paystatus": [
              {
                "bolt11": "lnbcrt100n1pnt2bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000bolt11invl020100000000",
                "amount_msat": 400000,
                "payment_hash": "paymenthashinvl0210021002100210021002100210021002100210021002100",
                "destination": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "created_at": 1738000000,
                "groupid": 1,
                "parts": 2,
                "status": "complete",
                "payment_preimage": "paymentpreimager010101010101010101010101010101010101010101010101",
                "amount_sent_msat": 400000
              }
            ]
          }
        }
      ]
    },
    "reserveinputs.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "reserveinputs",
      "title": "Construct a transaction and reserve the UTXOs it spends",
      "description": [
        "The **reserveinputs** RPC command places (or increases) reservations on any inputs specified in *psbt* which are known to lightningd. It will fail with an error if any of the inputs are known to be spent, and ignore inputs which are unknown.",
        "",
        "Normally the command will fail (with no reservations made) if an input is already reserved."
      ],
      "request": {
        "required": [
          "psbt"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "The PSBT to reserve inputs from."
            ]
          },
          "exclusive": {
            "type": "boolean",
            "description": [
              "If set to *False*, existing reservations are simply extended, rather than causing failure."
            ]
          },
          "reserve": {
            "type": "u32",
            "description": [
              "The number of blocks to reserve. By default, reservations are for the next 72 blocks (approximately 6 hours)."
            ]
          }
        }
      },
      "response": {
        "required": [
          "reservations"
        ],
        "additionalProperties": false,
        "properties": {
          "reservations": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "txid",
                "vout",
                "was_reserved",
                "reserved",
                "reserved_to_block"
              ],
              "properties": {
                "txid": {
                  "type": "txid",
                  "description": [
                    "The input transaction id."
                  ]
                },
                "vout": {
                  "type": "u32",
                  "description": [
                    "The input index output number which was reserved."
                  ]
                },
                "was_reserved": {
                  "type": "boolean",
                  "description": [
                    "Whether the input was already reserved."
                  ]
                },
                "reserved": {
                  "type": "boolean",
                  "enum": [
                    true
                  ],
                  "description": [
                    "Whether the input is now reserved."
                  ]
                },
                "reserved_to_block": {
                  "type": "u32",
                  "description": [
                    "What blockheight the reservation will expire."
                  ]
                }
              }
            }
          }
        }
      },
      "errors": [
        "On failure, an error is reported and no UTXOs are reserved.",
        "",
        "- -32602: Invalid parameter, such as specifying a spent/reserved input in *psbt*."
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-unreserveinputs(7)",
        "lightning-signpsbt(7)",
        "lightning-sendpsbt(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:reserveinputs#1",
            "method": "reserveinputs",
            "params": {
              "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100"
            }
          },
          "response": {
            "reservations": [
              {
                "txid": "channeltxid111200111200111200111200111200111200111200111200111200",
                "vout": 1,
                "was_reserved": false,
                "reserved": true,
                "reserved_to_block": 226
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:reserveinputs#2",
            "method": "reserveinputs",
            "params": {
              "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200011200"
            }
          },
          "response": {
            "reservations": [
              {
                "txid": "txidocsigned1011000110001100011000110001100011000110001100011000",
                "vout": 1,
                "was_reserved": false,
                "reserved": true,
                "reserved_to_block": 226
              }
            ]
          }
        }
      ]
    },
    "sendcustommsg.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v0.10.1",
      "rpc": "sendcustommsg",
      "title": "Low-level interface to send protocol messages to peers",
      "description": [
        "The `sendcustommsg` RPC method allows the user to inject a custom message into the communication with the peer with the given `node_id`. This is intended as a low-level interface to implement custom protocol extensions on top, not for direct use by end-users.",
        "",
        "On the receiving end a plugin may implement the `custommsg` plugin hook and get notified about incoming messages, and allow additional unknown even types in their getmanifest response."
      ],
      "request": {
        "required": [
          "node_id",
          "msg"
        ],
        "additionalProperties": false,
        "properties": {
          "node_id": {
            "type": "pubkey",
            "description": [
              "The node specified by `node_id` must be a peer, i.e., it must have a direct connection with the node receiving the RPC call, and the connection must be established. For a method to send arbitrary messages over multiple hops, including hops that do not understand the custom message, see the `createonion` and `sendonion` RPC methods. Messages can only be injected if the connection is handled by `openingd` or `channeld`. Messages cannot be injected when the peer is handled by `onchaind` or `closingd` since these do not have a connection, or are synchronous daemons that do not handle spontaneous messages."
            ]
          },
          "msg": {
            "type": "hex",
            "description": [
              "Must be a hex encoded well-formed message, including the 2-byte type prefix, but excluding the length prefix which will be added by the RPC method. The message types may not be one of the internally handled types, since that may cause issues with the internal state tracking of Core Lightning. We do (as of *v23.11*) allow sending of even types, but note that peers (as per the spec) will disconnect on receiving unknown even types."
            ]
          }
        }
      },
      "response": {
        "required": [
          "status"
        ],
        "additionalProperties": false,
        "properties": {
          "status": {
            "type": "string",
            "description": [
              "Information about where message was queued."
            ]
          }
        },
        "pre_return_value_notes": [
          "The method will validate the arguments and queue the message for delivery through the daemon that is currently handling the connection. Queuing provides best effort guarantees and the message may not be delivered if the connection is terminated while the message is queued. The RPC method will return as soon as the message is queued.",
          "",
          "If any of the above limitations is not respected the method returns an explicit error message stating the issue."
        ]
      },
      "author": [
        "Christian Decker [decker.christian@gmail.com](mailto:decker.christian@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-createonion(7)",
        "lightning-sendonion(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:sendcustommsg#1",
            "method": "sendcustommsg",
            "params": {
              "node_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
              "msg": "77770012"
            }
          },
          "response": {
            "status": "Message sent to connectd for delivery"
          }
        }
      ]
    },
    "sendinvoice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "sendinvoice",
      "title": "Command for send an invoice for an offer",
      "description": [
        "The **sendinvoice** RPC command creates and sends an invoice to the issuer of an *invoice_request* for it to pay: lightning-invoicerequest(7).",
        "",
        "If **fetchinvoice-noconnect** is not specified in the configuation, it will connect to the destination in the (currently common!) case where it cannot find a route which supports `option_onion_messages`."
      ],
      "request": {
        "required": [
          "invreq",
          "label"
        ],
        "additionalProperties": false,
        "properties": {
          "invreq": {
            "type": "string",
            "description": [
              "The bolt12 invoice_request string beginning with `lnr1`."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "The unique label to use for this invoice."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Required if the *offer* does not specify an amount at all, or specifies it in a different currency. Otherwise you may set it (e.g. to provide a tip)."
            ],
            "default": "the amount contained in the offer (multiplied by *quantity* if any)"
          },
          "timeout": {
            "type": "u32",
            "description": [
              "Seconds to wait for the offering node to pay the invoice or return an error. This will also be the timeout on the invoice that is sent."
            ],
            "default": "90 seconds"
          },
          "quantity": {
            "type": "u64",
            "description": [
              "Quantity is is required if the offer specifies quantity_max, otherwise it is not allowed."
            ]
          }
        }
      },
      "response": {
        "required": [
          "label",
          "description",
          "payment_hash",
          "status",
          "created_index",
          "expires_at"
        ],
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string",
            "description": [
              "Unique label supplied at invoice creation."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "Description used in the invoice."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "unpaid",
              "paid",
              "expired"
            ],
            "description": [
              "Whether it's paid, unpaid or unpayable."
            ]
          },
          "expires_at": {
            "type": "u64",
            "description": [
              "UNIX timestamp of when it will become / became unpayable."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount required to pay this invoice."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The BOLT12 string."
            ]
          },
          "created_index": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "1-based index indicating order this invoice was created in."
            ]
          },
          "updated_index": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "1-based index indicating order this invoice was changed (only present if it has changed since creation)."
            ]
          },
          "amount_received_msat": {},
          "paid_at": {},
          "pay_index": {},
          "payment_preimage": {}
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "paid"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "pay_index",
                "amount_received_msat",
                "paid_at",
                "payment_preimage"
              ],
              "properties": {
                "label": {},
                "description": {},
                "payment_hash": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "bolt12": {},
                "expires_at": {},
                "created_index": {},
                "updated_index": {},
                "pay_index": {
                  "type": "u64",
                  "description": [
                    "Unique incrementing index for this payment."
                  ]
                },
                "amount_received_msat": {
                  "type": "msat",
                  "description": [
                    "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)."
                  ]
                },
                "paid_at": {
                  "type": "u64",
                  "description": [
                    "UNIX timestamp of when it was paid."
                  ]
                },
                "payment_preimage": {
                  "type": "secret",
                  "description": [
                    "Proof of payment."
                  ]
                }
              }
            }
          }
        ]
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error.",
        "- 1002: Offer has expired.",
        "- 1003: Cannot find a route to the node making the offer.",
        "- 1004: The node making the offer returned an error message.",
        "- 1005: We timed out waiting for the invoice to be paid"
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-fetchinvoice(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:sendinvoice#1",
            "method": "sendinvoice",
            "params": {
              "invreq": "lno1qgsq000bolt210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000",
              "label": "test sendinvoice"
            }
          },
          "response": {
            "label": "test sendinvoice",
            "bolt12": "lno1qgsq000boltsi100si100si100si100si100si100si100si100si100si100si100si100si100si100si100si100si100si100si100si100si100si100si100si100",
            "payment_hash": "paymenthashsdinvsi10si10si10si10si10si10si10si10si10si10si10si10",
            "amount_msat": 1000000,
            "status": "paid",
            "pay_index": 2,
            "amount_received_msat": 1000000,
            "paid_at": 1738500000,
            "payment_preimage": "paymentpreimagei010101010101010101010101010101010101010101010101",
            "description": "Simple test",
            "expires_at": 1739000000,
            "created_index": 4,
            "updated_index": 2
          }
        }
      ]
    },
    "sendonion.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "sendonion",
      "title": "Send a payment with a custom onion packet",
      "description": [
        "Note: you probably want to use the more modern and flexible `injectpaymentonion` command instead of this.",
        "The **sendonion** RPC command can be used to initiate a payment attempt with a custom onion packet. The onion packet is used to deliver instructions for hops along the route on how to behave. Normally these instructions are indications on where to forward a payment and what parameters to use, or contain details of the payment for the final hop. However, it is possible to add arbitrary information for hops in the custom onion, allowing for custom extensions that are not directly supported by Core Lightning.",
        "",
        "If the first element of *route* does not have \"channel\" set, a suitable channel (if any) will be chosen, otherwise that specific short-channel-id is used. The following is an example of a 3 hop onion:",
        "",
        "```json",
        "[",
        "  \"298606954e9de3e9d938d18a74fed794c440e8eda82e52dc08600953c8acf9c4\",",
        "  \"2dc094de72adb03b90894192edf9f67919cb2691b37b1f7d4a2f4f31c108b087\",",
        "  \"a7b82b240dbd77a4ac8ea07709b1395d8c510c73c17b4b392bb1f0605d989c85\"",
        "]",
        "```"
      ],
      "request": {
        "required": [
          "onion",
          "first_hop",
          "payment_hash"
        ],
        "additionalProperties": false,
        "properties": {
          "onion": {
            "type": "hex",
            "description": [
              "Hex-encoded 1366 bytes long blob that was returned by either of the tools that can generate onions. It contains the payloads destined for each hop and some metadata. Please refer to [BOLT 04][bolt04] for further details. If is specific to the route that is being used and the *payment_hash* used to construct, and therefore cannot be reused for other payments or to attempt a separate route. The custom onion can generally be created using the `devtools/onion` CLI tool, or the **createonion** RPC command."
            ]
          },
          "first_hop": {
            "type": "object",
            "description": [
              "Instructs Core Lightning which peer to send the onion to. It is a JSON dictionary that corresponds to the first element of the route array returned by *getroute* (so fields not mentioned here are ignored)."
            ],
            "required": [
              "id",
              "amount_msat",
              "delay"
            ],
            "additionalProperties": true,
            "properties": {
              "id": {
                "type": "pubkey",
                "description": [
                  "Node id for the peer. Use any available channel available to this peer."
                ]
              },
              "amount_msat": {
                "type": "msat",
                "description": [
                  "The amount to add an HTLC for millisatoshis."
                ]
              },
              "delay": {
                "type": "u16",
                "description": [
                  "The number of blocks delay of blocks on top of the current blockheight."
                ]
              }
            }
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "Specifies the 32 byte hex-encoded hash to use as a challenge to the HTLC that we are sending. It is specific to the onion and has to match the one the onion was created with."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "Can be used to provide a human readable reference to retrieve the payment at a later time."
            ]
          },
          "shared_secrets": {
            "type": "array",
            "description": [
              "A JSON list of 32 byte hex-encoded secrets that were used when creating the onion. Core Lightning can send a payment with a custom onion without the knowledge of these secrets, however it will not be able to parse an eventual error message since that is encrypted with the shared secrets used in the onion. If *shared_secrets* is provided Core Lightning will decrypt the error, act accordingly, e.g., add a `channel_update` included in the error to its network view, and set the details in *listsendpays* correctly. If it is not provided Core Lightning will store the encrypted onion, and expose it in *listsendpays* allowing the caller to decrypt it externally. If it is not provided the Core Lightning node does not know how long the route is, which channels or nodes are involved, and what an eventual error could have been. It can therefore be used for oblivious payments."
            ],
            "items": {
              "type": "secret"
            }
          },
          "partid": {
            "type": "u16",
            "description": [
              "If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*."
            ]
          },
          "bolt11": {
            "type": "string",
            "description": [
              "If provided, it will be returned in *waitsendpay* and *listsendpays* results."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Used to annotate the payment, and is returned by *waitsendpay* and *listsendpays*."
            ]
          },
          "destination": {
            "type": "pubkey",
            "description": [
              "If provided, it will be returned in **listpays** result."
            ]
          },
          "localinvreqid": {
            "type": "hash",
            "description": [
              "`localinvreqid` is used by offers to link a payment attempt to a local `invoice_request` offer created by lightningd-invoicerequest(7)."
            ]
          },
          "groupid": {
            "type": "u64",
            "description": [
              "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
            ]
          },
          "description": {
            "added": "v0.11.0",
            "type": "string",
            "description": [
              "If provided, it will be returned in *waitsendpay* and *listsendpays* results."
            ]
          },
          "total_amount_msat": {
            "type": "msat",
            "description": [
              "This is the full amount requested by the destination in the invoice. It is needed internally for multi-part payments.",
              "Its default value is 0 msat for backwards compatibility."
            ],
            "default": "0",
            "added": "v25.05"
          }
        }
      },
      "response": {
        "required": [
          "created_index",
          "id",
          "payment_hash",
          "status",
          "created_at",
          "amount_sent_msat"
        ],
        "additionalProperties": true,
        "properties": {
          "created_index": {
            "added": "v23.11",
            "type": "u64",
            "description": [
              "1-based index indicating order this payment was created in."
            ]
          },
          "id": {
            "type": "u64",
            "description": [
              "Old synonym for created_index."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "complete"
            ],
            "description": [
              "Status of the payment (could be complete if already sent previously)."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount delivered to destination (if known)."
            ]
          },
          "destination": {
            "type": "pubkey",
            "description": [
              "The final destination of the payment if known."
            ]
          },
          "created_at": {
            "type": "u64",
            "description": [
              "The UNIX timestamp showing when this payment was initiated."
            ]
          },
          "amount_sent_msat": {
            "type": "msat",
            "description": [
              "The amount sent."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "The label, if given to sendpay."
            ]
          },
          "bolt11": {
            "type": "string",
            "description": [
              "The bolt11 string (if supplied)."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The bolt12 string (if supplied)."
            ]
          },
          "partid": {
            "type": "u64",
            "description": [
              "The partid (if supplied) to sendonion/sendpay."
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "complete"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "payment_preimage"
              ],
              "properties": {
                "created_index": {},
                "id": {},
                "payment_hash": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "destination": {},
                "created_at": {},
                "groupid": {},
                "msatoshi_sent": {},
                "amount_sent_msat": {},
                "label": {},
                "bolt11": {},
                "bolt12": {},
                "partid": {},
                "updated_index": {
                  "added": "v23.11",
                  "type": "u64",
                  "description": [
                    "1-based index indicating order this payment was changed."
                  ]
                },
                "payment_preimage": {
                  "type": "secret",
                  "description": [
                    "The proof of payment: SHA256 of this **payment_hash**."
                  ]
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "pending"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [],
              "properties": {
                "created_index": {},
                "id": {},
                "payment_hash": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "destination": {},
                "created_at": {},
                "groupid": {},
                "msatoshi_sent": {},
                "amount_sent_msat": {},
                "label": {},
                "bolt11": {},
                "bolt12": {},
                "partid": {},
                "message": {
                  "type": "string",
                  "description": [
                    "Monitor status with listpays or waitsendpay."
                  ]
                }
              }
            }
          }
        ]
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- 202: an parseable onion",
        "",
        "the error details are decrypted and presented here, if *shared_secrets* was provided and an error was returned by one of the intermediate nodes"
      ],
      "author": [
        "Christian Decker [decker.christian@gmail.com](mailto:decker.christian@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-injectpaymentonion(7)",
        "lightning-createonion(7)",
        "lightning-sendpay(7)",
        "lightning-listsendpays(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)",
        "",
        "[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md"
      ],
      "examples": [
        {
          "request": {
            "id": "example:sendonion#1",
            "method": "sendonion",
            "params": {
              "onion": "onion10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010",
              "first_hop": {
                "id": "nodeid020202020202020202020202020202020202020202020202020202020202",
                "channel": "109x1x1",
                "direction": 1,
                "amount_msat": 1002,
                "delay": 21,
                "style": "tlv"
              },
              "payment_hash": "assocdata0010101010101010101010101010101010101010101010101010101"
            }
          },
          "response": {
            "message": "Monitor status with listpays or waitsendpay",
            "created_index": 10,
            "id": 10,
            "payment_hash": "assocdata0010101010101010101010101010101010101010101010101010101",
            "groupid": 1,
            "amount_sent_msat": 1002,
            "created_at": 1738000000,
            "status": "pending"
          }
        }
      ]
    },
    "sendpay.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "sendpay",
      "title": "Low-level command for sending a payment via a route",
      "description": [
        "The **sendpay** RPC command attempts to send funds associated with the given *payment_hash*, along a route to the final destination in the route.",
        "",
        "Generally, a client would call lightning-getroute(7) to resolve a route, then use **sendpay** to send it. If it fails, it would call lightning-getroute(7) again to retry. If the route is empty, a payment-to-self is attempted.",
        "",
        "The response will occur when the payment is on its way to the destination. The **sendpay** RPC command does not wait for definite success or definite failure of the payment (except for already-succeeded payments, or to-self payments). Instead, use the **waitsendpay** RPC command to poll or wait for definite success or definite failure.",
        "",
        "Once a payment has succeeded, calls to **sendpay** with the same *payment_hash* but a different *amount_msat* or destination will fail; this prevents accidental multiple payments. Calls to **sendpay** with the same *payment_hash*, *amount_msat*, and destination as a previous successful payment (even if a different route or *partid*) will return immediately with success."
      ],
      "request": {
        "required": [
          "route",
          "payment_hash"
        ],
        "additionalProperties": false,
        "properties": {
          "route": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "amount_msat",
                "id",
                "delay",
                "channel"
              ],
              "additionalProperties": true,
              "properties": {
                "id": {
                  "type": "pubkey",
                  "description": [
                    "The node at the end of this hop."
                  ]
                },
                "channel": {
                  "type": "short_channel_id",
                  "description": [
                    "The channel joining these nodes."
                  ]
                },
                "delay": {
                  "type": "u32",
                  "description": [
                    "The total CLTV expected by the node at the end of this hop."
                  ]
                },
                "amount_msat": {
                  "type": "msat",
                  "description": [
                    "The amount expected by the node at the end of this hop."
                  ]
                }
              }
            }
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the payment_preimage."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "The label provided when creating the invoice_request."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Amount must be provided if *partid* is non-zero, or the payment is to-self, otherwise it must be equal to the final amount to the destination. it can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*."
            ],
            "default": "in millisatoshi precision"
          },
          "bolt11": {
            "type": "string",
            "description": [
              "Bolt11 invoice to pay. If provided, will be returned in *waitsendpay* and *listsendpays* results."
            ]
          },
          "payment_secret": {
            "type": "secret",
            "description": [
              "Value that the final recipient requires to accept the payment, as defined by the `payment_data` field in BOLT 4 and the `s` field in the BOLT 11 invoice format. It is required if *partid* is non-zero."
            ]
          },
          "partid": {
            "type": "u64",
            "description": [
              "Must not be provided for self-payments. If provided and non-zero, allows for multiple parallel partial payments with the same *payment_hash*. The *amount_msat* amount (which must be provided) for each **sendpay** with matching *payment_hash* must be equal, and **sendpay** will fail if there are differing values given."
            ]
          },
          "localinvreqid": {
            "type": "hex",
            "description": [
              "Indicates that this payment is being made for a local invoice_request. This ensures that we only send a payment for a single-use invoice_request once."
            ]
          },
          "groupid": {
            "type": "u64",
            "description": [
              "Allows you to attach a number which appears in **listsendpays** so payments can be identified as part of a logical group. The *pay* plugin uses this to identify one attempt at a MPP payment, for example."
            ]
          },
          "payment_metadata": {
            "added": "v0.11.0",
            "type": "hex",
            "description": [
              "Placed in the final onion hop TLV."
            ]
          },
          "description": {
            "added": "v0.11.0",
            "type": "string",
            "description": [
              "Description used in the invoice."
            ]
          },
          "dev_legacy_hop": {
            "hidden": true
          }
        }
      },
      "response": {
        "required": [
          "id",
          "created_index",
          "payment_hash",
          "status",
          "created_at",
          "amount_sent_msat"
        ],
        "additionalProperties": false,
        "properties": {
          "created_index": {
            "added": "v23.11",
            "type": "u64",
            "description": [
              "1-based index indicating order this payment was created in."
            ]
          },
          "updated_index": {
            "added": "v23.11",
            "type": "u64",
            "description": [
              "1-based index indicating order this payment was changed (only present if it has changed since creation)."
            ]
          },
          "id": {
            "type": "u64",
            "description": [
              "Old synonym for created_index."
            ]
          },
          "groupid": {
            "type": "u64",
            "description": [
              "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "complete"
            ],
            "description": [
              "Status of the payment (could be complete if already sent previously)."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount delivered to destination (if known)."
            ]
          },
          "destination": {
            "type": "pubkey",
            "description": [
              "The final destination of the payment if known."
            ]
          },
          "created_at": {
            "type": "u64",
            "description": [
              "The UNIX timestamp showing when this payment was initiated."
            ]
          },
          "completed_at": {
            "type": "u64",
            "description": [
              "The UNIX timestamp showing when this payment was completed."
            ]
          },
          "amount_sent_msat": {
            "type": "msat",
            "description": [
              "The amount sent."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "The *label*, if given to sendpay."
            ]
          },
          "partid": {
            "type": "u64",
            "description": [
              "The *partid*, if given to sendpay."
            ]
          },
          "bolt11": {
            "type": "string",
            "description": [
              "The bolt11 string (if supplied)."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The bolt12 string (if supplied)."
            ]
          },
          "message": {},
          "payment_preimage": {}
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "complete"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "payment_preimage"
              ],
              "properties": {
                "id": {},
                "created_index": {},
                "updated_index": {},
                "groupid": {},
                "payment_hash": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "destination": {},
                "created_at": {},
                "completed_at": {},
                "msatoshi_sent": {},
                "amount_sent_msat": {},
                "label": {},
                "partid": {},
                "bolt11": {},
                "bolt12": {},
                "payment_preimage": {
                  "type": "secret",
                  "description": [
                    "The proof of payment: SHA256 of this **payment_hash**."
                  ]
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "pending"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "message"
              ],
              "properties": {
                "id": {},
                "created_index": {},
                "updated_index": {},
                "groupid": {},
                "payment_hash": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "destination": {},
                "created_at": {},
                "completed_at": {},
                "msatoshi_sent": {},
                "amount_sent_msat": {},
                "label": {},
                "partid": {},
                "bolt11": {},
                "bolt12": {},
                "message": {
                  "type": "string",
                  "description": [
                    "Monitor status with listpays or waitsendpay."
                  ]
                }
              }
            }
          }
        ]
      },
      "errors": [
        "On error, if the error occurred from a node other than the final destination, the route table will be updated so that lightning-getroute(7) should return an alternate route (if any). An error from the final destination implies the payment should not be retried.",
        "",
        "- -1: Catchall nonspecific error.",
        "- 201: Already paid with this *hash* using different amount or destination.",
        "- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.",
        "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.",
        "- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.",
        "- 212: *localinvreqid* refers to an invalid, or used, local invoice_request.",
        "",
        "A routing failure object has the fields below:",
        "",
        "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.",
        "*erring_node*: The hex string of the pubkey id of the node that reported the error.",
        "*erring_channel*: The short channel ID of the channel that has the error, or *0:0:0* if the destination node raised the error. In addition *erring_direction* will indicate which direction of the channel caused the failure.",
        "*failcode*: The failure code, as per BOLT #4.",
        "*channel_update*: The hex string of the *channel_update* message received from the remote node. Only present if error is from the remote node and the *failcode* has the UPDATE bit set, as per BOLT #4."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listinvoices(7)",
        "lightning-delinvoice(7)",
        "lightning-getroute(7)",
        "lightning-invoice(7)",
        "lightning-pay(7)",
        "lightning-waitsendpay(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:sendpay#1",
            "method": "sendpay",
            "params": {
              "route": [
                {
                  "id": "nodeid020202020202020202020202020202020202020202020202020202020202",
                  "channel": "109x1x1",
                  "direction": 1,
                  "amount_msat": 10001,
                  "delay": 15,
                  "style": "tlv"
                },
                {
                  "id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                  "channel": "111x1x1",
                  "direction": 0,
                  "amount_msat": 10000,
                  "delay": 9,
                  "style": "tlv"
                }
              ],
              "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
              "payment_secret": "paymentsecretinvl00310003100031000310003100031000310003100031000"
            }
          },
          "response": {
            "message": "Monitor status with listpays or waitsendpay",
            "created_index": 2,
            "id": 2,
            "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
            "groupid": 1,
            "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
            "amount_msat": 10000,
            "amount_sent_msat": 10001,
            "created_at": 1738000000,
            "status": "pending"
          }
        }
      ]
    },
    "sendpsbt.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "sendpsbt",
      "title": "Command to finalize, extract and send a partially signed bitcoin transaction (PSBT).",
      "description": [
        "The **sendpsbt** is a low-level RPC command which sends a fully-signed PSBT.  If the PSBT is the same one promised by a channel (via fundchannel_complete) it will also be associated with that channel and re-transmitted if necessary on restart."
      ],
      "request": {
        "required": [
          "psbt"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "The fully signed psbt to be sent."
            ]
          },
          "reserve": {
            "type": "u32",
            "description": [
              "Number of blocks to increase reservation of any of our inputs by."
            ],
            "default": "72"
          }
        }
      },
      "response": {
        "required": [
          "tx",
          "txid"
        ],
        "additionalProperties": false,
        "properties": {
          "tx": {
            "type": "hex",
            "description": [
              "The raw transaction which was sent."
            ]
          },
          "txid": {
            "type": "txid",
            "description": [
              "The txid of the **tx**."
            ]
          }
        }
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters or some error happened during the command process."
      ],
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) wrote the initial version of this man page,",
        "but many others did the hard work of actually implementing this rpc command."
      ],
      "see_also": [
        "lightning-fundpsbt(7)",
        "lightning-signpsbt(7)",
        "lightning-listtransactions(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:sendpsbt#1",
            "method": "sendpsbt",
            "params": {
              "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000"
            }
          },
          "response": {
            "tx": "02000000000155multiw61000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000610006100061000",
            "txid": "txid6100061000610006100061000610006100061000610006100061000"
          }
        }
      ]
    },
    "setchannel.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "setchannel",
      "title": "Command for configuring fees / htlc range advertized for a channel",
      "description": [
        "The **setchannel** RPC command sets channel specific routing fees, and `htlc_minimum_msat` or `htlc_maximum_msat` as defined in BOLT #7. The channel has to be in normal or awaiting state. This can be checked by **listpeers** reporting a *state* of CHANNELD_NORMAL or CHANNELD_AWAITING_LOCKIN for the channel.",
        "",
        "These changes (for a public channel) will be broadcast to the rest of the network (though many nodes limit the rate of such changes they will accept: we allow 2 a day, with a few extra occasionally)."
      ],
      "request": {
        "required": [
          "id"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "description": [
              "Should contain a scid (short channel ID), channel id or peerid (pubkey) of the channel to be modified. If *id* is set to `all`, the updates are applied to all channels in states CHANNELD_NORMAL CHANNELD_AWAITING_LOCKIN or DUALOPEND_AWAITING_LOCKIN. If *id* is a peerid, all channels with the +peer in those states are changed."
            ]
          },
          "feebase": {
            "type": "msat",
            "description": [
              "Value in millisatoshi that is added as base fee to any routed payment: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*."
            ]
          },
          "feeppm": {
            "type": "u32",
            "description": [
              "Value that is added proportionally per-millionths to any routed payment volume in satoshi. For example, if ppm is 1,000 and 1,000,000 satoshi is being routed through the channel, an proportional fee of 1,000 satoshi is added, resulting in a 0.1% fee."
            ]
          },
          "htlcmin": {
            "type": "msat",
            "description": [
              "Value that limits how small an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that the peer also enforces a minimum for the channel: setting it below that will simply set it to that value with a warning. Also note that *htlcmin* only applies to forwarded HTLCs: we can still send smaller payments ourselves."
            ],
            "default": "no lower limit"
          },
          "htlcmax": {
            "type": "msat",
            "description": [
              "Value that limits how large an HTLC we will forward: if omitted, it is unchanged. It can be a whole number, or a whole number ending in *msat* or *sat*, or a number with three decimal places ending in *sat*, or a number with 1 to 11 decimal places ending in *btc*. Note that *htlcmax* only applies to forwarded HTLCs: we can still send larger payments ourselves."
            ],
            "default": "no effective limit"
          },
          "enforcedelay": {
            "type": "u32",
            "description": [
              "Number of seconds to delay before enforcing the new fees/htlc max. This gives the network a chance to catch up with the new rates and avoids rejecting HTLCs before they do. This only has an effect if rates are increased (we always allow users to overpay fees) or *htlcmax* is decreased, and only applied to a single rate increase per channel (we don't remember an arbitrary number of prior feerates) and if the node is restarted the updated configuration is enforced immediately."
            ],
            "default": "600, which is ten minutes"
          },
          "ignorefeelimits": {
            "added": "v23.08",
            "type": "boolean",
            "description": [
              "If set to True means to allow the peer to set the commitment transaction fees (or closing transaction fees) to any value they want. This is dangerous: they could set an exorbitant fee (so HTLCs are unenforcable), or a tiny fee (so that commitment transactions cannot be relayed), but avoids channel breakage in case of feerate disagreements. (Note: the global `ignore_fee_limits` setting overrides this)."
            ]
          }
        }
      },
      "response": {
        "required": [
          "channels"
        ],
        "additionalProperties": false,
        "properties": {
          "channels": {
            "type": "array",
            "description": [
              "Channel(s) set, and their resulting configuration."
            ],
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "peer_id",
                "channel_id",
                "fee_base_msat",
                "fee_proportional_millionths",
                "minimum_htlc_out_msat",
                "maximum_htlc_out_msat",
                "ignore_fee_limits"
              ],
              "properties": {
                "peer_id": {
                  "type": "pubkey",
                  "description": [
                    "The node_id of the peer."
                  ]
                },
                "channel_id": {
                  "type": "hash",
                  "description": [
                    "The channel_id of the channel."
                  ]
                },
                "short_channel_id": {
                  "type": "short_channel_id",
                  "description": [
                    "The short_channel_id (if locked in)."
                  ]
                },
                "fee_base_msat": {
                  "type": "msat",
                  "description": [
                    "The resulting feebase (this is the BOLT #7 name)."
                  ]
                },
                "fee_proportional_millionths": {
                  "type": "u32",
                  "description": [
                    "The resulting feeppm (this is the BOLT #7 name)."
                  ]
                },
                "ignore_fee_limits": {
                  "type": "boolean",
                  "added": "v23.08",
                  "description": [
                    "If we are now allowing peer to set feerate on commitment transaction without restriction."
                  ]
                },
                "minimum_htlc_out_msat": {
                  "type": "msat",
                  "description": [
                    "The resulting htlcmin we will advertize (the BOLT #7 name is htlc_minimum_msat)."
                  ]
                },
                "warning_htlcmin_too_low": {
                  "type": "string",
                  "description": [
                    "The requested htlcmin was too low for this peer, so we set it to the minimum they will allow."
                  ]
                },
                "maximum_htlc_out_msat": {
                  "type": "msat",
                  "description": [
                    "The resulting htlcmax we will advertize (the BOLT #7 name is htlc_maximum_msat)."
                  ]
                },
                "warning_htlcmax_too_high": {
                  "type": "string",
                  "description": [
                    "The requested htlcmax was greater than the channel capacity, so we set it to the channel capacity."
                  ]
                }
              }
            }
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Channel is in incorrect state, i.e. Catchall nonspecific error.",
        "- -32602: JSONRPC2_INVALID_PARAMS, i.e. Given id is not a channel ID or short channel ID."
      ],
      "author": [
        "Michael Schmoock [michael@schmoock.net](mailto:michael@schmoock.net) is the author of this feature."
      ],
      "see_also": [
        "lightningd-config(5)",
        "lightning-fundchannel(7)",
        "lightning-listchannels(7)",
        "lightning-listpeers(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:setchannel#1",
            "method": "setchannel",
            "params": {
              "id": "123x1x1",
              "ignorefeelimits": true
            }
          },
          "response": {
            "channels": [
              {
                "peer_id": "nodeid030303030303030303030303030303030303030303030303030303030303",
                "channel_id": "channelid0230200230200230200230200230200230200230200230200230200",
                "short_channel_id": "123x1x1",
                "fee_base_msat": 1,
                "fee_proportional_millionths": 10,
                "minimum_htlc_out_msat": 0,
                "maximum_htlc_out_msat": 990000000,
                "ignore_fee_limits": true
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:setchannel#2",
            "method": "setchannel",
            "params": {
              "id": "115x1x1",
              "feebase": 4000,
              "feeppm": 300,
              "enforcedelay": 0
            }
          },
          "response": {
            "channels": [
              {
                "peer_id": "nodeid050505050505050505050505050505050505050505050505050505050505",
                "channel_id": "channelid0250000250000250000250000250000250000250000250000250000",
                "short_channel_id": "115x1x1",
                "fee_base_msat": 4000,
                "fee_proportional_millionths": 300,
                "minimum_htlc_out_msat": 0,
                "maximum_htlc_out_msat": 990000000,
                "ignore_fee_limits": false
              }
            ]
          }
        }
      ]
    },
    "setconfig.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.08",
      "rpc": "setconfig",
      "title": "Dynamically change some config options",
      "description": [
        "The **setconfig** RPC command allows you set the (dynamic) configuration option named by `config`: options which take a value (as separate from simple flag options) also need a `val` parameter.",
        "",
        "This new value will *also* be written at the end of the `config.setconfig` file (but see lightningd-config), for persistence across restarts (and any old value commented out if they were set in other config files).",
        "",
        "You can see what options are dynamically adjustable using lightning-listconfigs(7). Note that you can also adjust existing options for stopped plugins; they will have an effect when the plugin is restarted."
      ],
      "request": {
        "required": [
          "config"
        ],
        "additionalProperties": false,
        "properties": {
          "config": {
            "type": "string",
            "description": [
              "Name of the config variable which should be set to the value of the variable."
            ]
          },
          "val": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "boolean"
              }
            ],
            "description": [
              "Value of the config variable to be set or updated."
            ]
          },
          "transient": {
            "type": "boolean",
            "added": "v25.02",
            "default": "False",
            "description": [
              "If set, this change does NOT try to alter the configuration files, so the change will be reverted on any restart."
            ]
          }
        }
      },
      "response": {
        "required": [
          "config"
        ],
        "additionalProperties": false,
        "properties": {
          "config": {
            "type": "object",
            "description": [
              "Config settings after completion."
            ],
            "additionalProperties": false,
            "required": [
              "config",
              "source",
              "dynamic"
            ],
            "properties": {
              "config": {
                "type": "string",
                "description": [
                  "Name of the config variable which was set."
                ]
              },
              "source": {
                "type": "string",
                "description": [
                  "Source of configuration setting (`file`:`linenum`)."
                ]
              },
              "plugin": {
                "type": "string",
                "description": [
                  "The plugin this configuration setting is for."
                ]
              },
              "dynamic": {
                "type": "boolean",
                "enum": [
                  true
                ],
                "description": [
                  "Whether this option is settable via setconfig."
                ]
              },
              "set": {
                "type": "boolean",
                "description": [
                  "For simple flag options."
                ]
              },
              "value_str": {
                "type": "string",
                "description": [
                  "For string options."
                ]
              },
              "value_msat": {
                "type": "msat",
                "description": [
                  "For msat options."
                ]
              },
              "value_int": {
                "type": "integer",
                "description": [
                  "For integer options."
                ]
              },
              "value_bool": {
                "type": "boolean",
                "description": [
                  "For boolean options."
                ]
              }
            }
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -32602: JSONRPC2_INVALID_PARAMS, i.e. the parameter is not dynamic, or the val was invalid."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible for this feature."
      ],
      "see_also": [
        "lightningd-config(5)",
        "lightning-listconfigs(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:setconfig#1",
            "method": "setconfig",
            "params": [
              "autoclean-expiredinvoices-age",
              300
            ]
          },
          "response": {
            "config": {
              "config": "autoclean-expiredinvoices-age",
              "value_int": 300,
              "source": "/tmp/.lightning/regtest/config.setconfig:2",
              "plugin": "/root/lightning/plugins/autoclean",
              "dynamic": true
            }
          }
        },
        {
          "request": {
            "id": "example:setconfig#2",
            "method": "setconfig",
            "params": {
              "config": "min-capacity-sat",
              "val": 500000
            }
          },
          "response": {
            "config": {
              "config": "min-capacity-sat",
              "value_int": 500000,
              "source": "/tmp/.lightning/regtest/config.setconfig:3",
              "dynamic": true
            }
          }
        }
      ]
    },
    "setpsbtversion.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "setpsbtversion",
      "title": "Command for setting PSBT version",
      "description": [
        "The **setpsbtversion** RPC command converts the provided PSBT to the given version, and returns the base64 result of the conversion. Returns an error if version is invalid."
      ],
      "request": {
        "required": [
          "psbt",
          "version"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "The PSBT to change versions."
            ]
          },
          "version": {
            "type": "u32",
            "description": [
              "The version to set."
            ]
          }
        }
      },
      "response": {
        "required": [
          "psbt"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "A converted PSBT of the requested version."
            ]
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -32602: Parameter missed or malformed."
      ],
      "author": [
        "Gregory Sanders [gsanders87@gmail.com](mailto:gsanders87@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-fundpsbt(7)",
        "lightning-utxopsbt(7)",
        "lightning-signpsbt(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:setpsbtversion#1",
            "method": "setpsbtversion",
            "params": {
              "psbt": "cHNidP8BAgpsbt1001010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
              "version": 0
            }
          },
          "response": {
            "psbt": "cHNidP8BADUCAAAAAAFAQg8AAAAAACJRIO7yw3zIUblRUcdhCLSjdFxJsYHu2s0Y29bT0bGAGdcbbwAAAAAA"
          }
        },
        {
          "request": {
            "id": "example:setpsbtversion#2",
            "method": "setpsbtversion",
            "params": [
              "cHNidP8BAgpsbt20020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202",
              2
            ]
          },
          "response": {
            "psbt": "cHNidP8BAgpsbt20020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202"
          }
        }
      ]
    },
    "showrunes.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.08",
      "rpc": "showrunes",
      "title": "Command to list previously generated runes",
      "description": [
        "The **showrunes** RPC command either lists runes that we stored as we generate them (see lightning-createrune(7)) or decodes the rune given on the command line."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "rune": {
            "type": "string",
            "description": [
              "If specified, only details of that rune will be returned."
            ]
          }
        }
      },
      "response": {
        "required": [
          "runes"
        ],
        "additionalProperties": false,
        "properties": {
          "runes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "rune",
                "unique_id",
                "restrictions",
                "restrictions_as_english"
              ],
              "properties": {
                "rune": {
                  "type": "string",
                  "description": [
                    "Base64 encoded rune."
                  ]
                },
                "unique_id": {
                  "type": "string",
                  "description": [
                    "Unique id assigned when the rune was generated; this is always a u64 for commando runes."
                  ]
                },
                "restrictions": {
                  "type": "array",
                  "description": [
                    "The restrictions on what commands this rune can authorize."
                  ],
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "alternatives",
                      "english"
                    ],
                    "properties": {
                      "alternatives": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "fieldname",
                            "value",
                            "condition",
                            "english"
                          ],
                          "properties": {
                            "fieldname": {
                              "type": "string",
                              "description": [
                                "The field this restriction applies to; see commando-rune(7)."
                              ]
                            },
                            "value": {
                              "type": "string",
                              "description": [
                                "The value accepted for this field."
                              ]
                            },
                            "condition": {
                              "type": "string",
                              "description": [
                                "The way to compare fieldname and value."
                              ]
                            },
                            "english": {
                              "type": "string",
                              "description": [
                                "English readable description of this alternative."
                              ]
                            }
                          }
                        }
                      },
                      "english": {
                        "type": "string",
                        "description": [
                          "English readable summary of alternatives above."
                        ]
                      }
                    }
                  }
                },
                "restrictions_as_english": {
                  "type": "string",
                  "description": [
                    "English readable description of the restrictions array above."
                  ]
                },
                "stored": {
                  "type": "boolean",
                  "enum": [
                    false
                  ],
                  "description": [
                    "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)."
                  ]
                },
                "blacklisted": {
                  "type": "boolean",
                  "enum": [
                    true
                  ],
                  "description": [
                    "The rune has been blacklisted; see commando-blacklist(7)."
                  ]
                },
                "last_used": {
                  "type": "number",
                  "description": [
                    "The last time this rune was successfully used."
                  ],
                  "added": "v23.11"
                },
                "our_rune": {
                  "type": "boolean",
                  "enum": [
                    false
                  ],
                  "description": [
                    "This is not a rune for this node (only possible when `rune` is specified)."
                  ]
                }
              }
            }
          }
        }
      },
      "author": [
        "Shahana Farooqui [sfarooqui@blockstream.com](mailto:sfarooqui@blockstream.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-commando-showrunes(7)",
        "lightning-blacklistrune(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:showrunes#1",
            "method": "showrunes",
            "params": {
              "rune": "zFMd1fjhrAYxUeFA54TjloZqOt8JrA_i_nYwIgXkag49MA=="
            }
          },
          "response": {
            "runes": [
              {
                "rune": "zFMd1fjhrAYxUeFA54TjloZqOt8JrA_i_nYwIgXkag49MA==",
                "last_used": 1738000000,
                "unique_id": "0",
                "restrictions": [],
                "restrictions_as_english": ""
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:showrunes#2",
            "method": "showrunes",
            "params": {}
          },
          "response": {
            "runes": [
              {
                "rune": "zFMd1fjhrAYxUeFA54TjloZqOt8JrA_i_nYwIgXkag49MA==",
                "last_used": 1738000000,
                "unique_id": "0",
                "restrictions": [],
                "restrictions_as_english": ""
              },
              {
                "rune": "RXgu0DD_i0wSPEZkIDyZIWL0bSAGdhvJ_GHOQdTg04A9MSZpZF4wMjY2ZTQ1OThkMWQzYzQxNWY1NyZtZXRob2Q9bGlzdHBlZXJz",
                "last_used": 1738000000,
                "unique_id": "1",
                "restrictions": [
                  {
                    "alternatives": [
                      {
                        "fieldname": "id",
                        "value": "0266e4598d1d3c415f57",
                        "condition": "^",
                        "english": "id starts with 0266e4598d1d3c415f57"
                      }
                    ],
                    "english": "id starts with 0266e4598d1d3c415f57"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "method",
                        "value": "listpeers",
                        "condition": "=",
                        "english": "method equal to listpeers"
                      }
                    ],
                    "english": "method equal to listpeers"
                  }
                ],
                "restrictions_as_english": "id starts with 0266e4598d1d3c415f57 AND method equal to listpeers"
              },
              {
                "rune": "QUJEYMLGgiaJvMDv_MhR2hiMKIBTbq-PrL-KxcIlirQ9MiZtZXRob2Q9cGF5JnBuYW1lYW1vdW50bXNhdDwxMDAwMA==",
                "last_used": 1738000000,
                "unique_id": "2",
                "restrictions": [
                  {
                    "alternatives": [
                      {
                        "fieldname": "method",
                        "value": "pay",
                        "condition": "=",
                        "english": "method equal to pay"
                      }
                    ],
                    "english": "method equal to pay"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "pnameamountmsat",
                        "value": "10000",
                        "condition": "<",
                        "english": "pnameamountmsat < 10000"
                      }
                    ],
                    "english": "pnameamountmsat < 10000"
                  }
                ],
                "restrictions_as_english": "method equal to pay AND pnameamountmsat < 10000"
              },
              {
                "rune": "jEx3l0c7NMZPSDYT7xnXXvNA83z5PDNBHRQTIk1BwNw9MyZpZD0wMjY2ZTQ1OThkMWQzYzQxNWY1NzJhODQ4ODgzMGI2MGY3ZTc0NGVkOTIzNWViMGIxYmE5MzI4M2IzMTVjMDM1MTgmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZD0wMjY2ZTQ1OThkMWQzYzQxNWY1NzJhODQ4ODgzMGI2MGY3ZTc0NGVkOTIzNWViMGIxYmE5MzI4M2IzMTVjMDM1MTh8cGFycjA9MDI2NmU0NTk4ZDFkM2M0MTVmNTcyYTg0ODg4MzBiNjBmN2U3NDRlZDkyMzVlYjBiMWJhOTMyODNiMzE1YzAzNTE4",
                "unique_id": "3",
                "restrictions": [
                  {
                    "alternatives": [
                      {
                        "fieldname": "id",
                        "value": "nodeid010101010101010101010101010101010101010101010101010101010101",
                        "condition": "=",
                        "english": "id equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
                      }
                    ],
                    "english": "id equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "method",
                        "value": "listpeers",
                        "condition": "=",
                        "english": "method equal to listpeers"
                      }
                    ],
                    "english": "method equal to listpeers"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "pnum",
                        "value": "1",
                        "condition": "=",
                        "english": "pnum equal to 1"
                      }
                    ],
                    "english": "pnum equal to 1"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "pnameid",
                        "value": "nodeid010101010101010101010101010101010101010101010101010101010101",
                        "condition": "=",
                        "english": "pnameid equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
                      },
                      {
                        "fieldname": "parr0",
                        "value": "nodeid010101010101010101010101010101010101010101010101010101010101",
                        "condition": "=",
                        "english": "parr0 equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
                      }
                    ],
                    "english": "pnameid equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 OR parr0 equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
                  }
                ],
                "restrictions_as_english": "id equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 AND method equal to listpeers AND pnum equal to 1 AND pnameid equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 OR parr0 equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
              },
              {
                "rune": "8_CRIJ4arWAz72A4ILOZ46MESSJtQQQ9iQZjU28qulA9NCZpZD0wMjY2ZTQ1OThkMWQzYzQxNWY1NzJhODQ4ODgzMGI2MGY3ZTc0NGVkOTIzNWViMGIxYmE5MzI4M2IzMTVjMDM1MTgmbWV0aG9kPWxpc3RwZWVycyZwbnVtPTEmcG5hbWVpZF4wMjY2ZTQ1OThkMWQzYzQxNWY1N3xwYXJyMF4wMjY2ZTQ1OThkMWQzYzQxNWY1Nw==",
                "unique_id": "4",
                "restrictions": [
                  {
                    "alternatives": [
                      {
                        "fieldname": "id",
                        "value": "nodeid010101010101010101010101010101010101010101010101010101010101",
                        "condition": "=",
                        "english": "id equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
                      }
                    ],
                    "english": "id equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "method",
                        "value": "listpeers",
                        "condition": "=",
                        "english": "method equal to listpeers"
                      }
                    ],
                    "english": "method equal to listpeers"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "pnum",
                        "value": "1",
                        "condition": "=",
                        "english": "pnum equal to 1"
                      }
                    ],
                    "english": "pnum equal to 1"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "pnameid",
                        "value": "0266e4598d1d3c415f57",
                        "condition": "^",
                        "english": "pnameid starts with 0266e4598d1d3c415f57"
                      },
                      {
                        "fieldname": "parr0",
                        "value": "0266e4598d1d3c415f57",
                        "condition": "^",
                        "english": "parr0 starts with 0266e4598d1d3c415f57"
                      }
                    ],
                    "english": "pnameid starts with 0266e4598d1d3c415f57 OR parr0 starts with 0266e4598d1d3c415f57"
                  }
                ],
                "restrictions_as_english": "id equal to 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518 AND method equal to listpeers AND pnum equal to 1 AND pnameid starts with 0266e4598d1d3c415f57 OR parr0 starts with 0266e4598d1d3c415f57"
              },
              {
                "rune": "iP1FQEsFmPsu-XW7w8uXIJaJb7jU9PqOfkmXlOyWMuA9NSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5fG1ldGhvZD1wYXl8bWV0aG9kPXhwYXkmbWV0aG9kL2xpc3RkYXRhc3RvcmUmbWV0aG9kL3BheXxwZXI9MWRheSZtZXRob2QvcGF5fHBuYW1lYW1vdW50X21zYXQ8MTAwMDAwMDAxJm1ldGhvZC94cGF5fHBlcj0xZGF5Jm1ldGhvZC94cGF5fHBuYW1lYW1vdW50X21zYXQ8MTAwMDAwMDAx",
                "unique_id": "5",
                "restrictions": [
                  {
                    "alternatives": [
                      {
                        "fieldname": "method",
                        "value": "list",
                        "condition": "^",
                        "english": "method starts with list"
                      },
                      {
                        "fieldname": "method",
                        "value": "get",
                        "condition": "^",
                        "english": "method starts with get"
                      },
                      {
                        "fieldname": "method",
                        "value": "summary",
                        "condition": "=",
                        "english": "method equal to summary"
                      },
                      {
                        "fieldname": "method",
                        "value": "pay",
                        "condition": "=",
                        "english": "method equal to pay"
                      },
                      {
                        "fieldname": "method",
                        "value": "xpay",
                        "condition": "=",
                        "english": "method equal to xpay"
                      }
                    ],
                    "english": "method starts with list OR method starts with get OR method equal to summary OR method equal to pay OR method equal to xpay"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "method",
                        "value": "listdatastore",
                        "condition": "/",
                        "english": "method unequal to listdatastore"
                      }
                    ],
                    "english": "method unequal to listdatastore"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "method",
                        "value": "pay",
                        "condition": "/",
                        "english": "method unequal to pay"
                      },
                      {
                        "fieldname": "per",
                        "value": "1day",
                        "condition": "=",
                        "english": "per equal to 1day"
                      }
                    ],
                    "english": "method unequal to pay OR per equal to 1day"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "method",
                        "value": "pay",
                        "condition": "/",
                        "english": "method unequal to pay"
                      },
                      {
                        "fieldname": "pnameamount_msat",
                        "value": "100000001",
                        "condition": "<",
                        "english": "pnameamount_msat < 100000001"
                      }
                    ],
                    "english": "method unequal to pay OR pnameamount_msat < 100000001"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "method",
                        "value": "xpay",
                        "condition": "/",
                        "english": "method unequal to xpay"
                      },
                      {
                        "fieldname": "per",
                        "value": "1day",
                        "condition": "=",
                        "english": "per equal to 1day"
                      }
                    ],
                    "english": "method unequal to xpay OR per equal to 1day"
                  },
                  {
                    "alternatives": [
                      {
                        "fieldname": "method",
                        "value": "xpay",
                        "condition": "/",
                        "english": "method unequal to xpay"
                      },
                      {
                        "fieldname": "pnameamount_msat",
                        "value": "100000001",
                        "condition": "<",
                        "english": "pnameamount_msat < 100000001"
                      }
                    ],
                    "english": "method unequal to xpay OR pnameamount_msat < 100000001"
                  }
                ],
                "restrictions_as_english": "method starts with list OR method starts with get OR method equal to summary OR method equal to pay OR method equal to xpay AND method unequal to listdatastore AND method unequal to pay OR per equal to 1day AND method unequal to pay OR pnameamount_msat < 100000001 AND method unequal to xpay OR per equal to 1day AND method unequal to xpay OR pnameamount_msat < 100000001"
              }
            ]
          }
        }
      ]
    },
    "signinvoice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.02",
      "rpc": "signinvoice",
      "title": "Low-level invoice signing",
      "description": [
        "The **signinvoice** RPC command signs an invoice. Unlike **createinvoice** it does not save the invoice into the database and thus does not require the preimage."
      ],
      "request": {
        "required": [
          "invstring"
        ],
        "additionalProperties": false,
        "properties": {
          "invstring": {
            "type": "string",
            "description": [
              "Bolt11 form, but the final signature is ignored. Minimal sanity checks are done."
            ]
          }
        }
      },
      "response": {
        "required": [
          "bolt11"
        ],
        "additionalProperties": false,
        "properties": {
          "bolt11": {
            "type": "string",
            "description": [
              "The bolt11 string."
            ]
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error."
      ],
      "author": [
        "Carl Dong [contact@carldong.me](mailto:contact@carldong.me) is mainly responsible."
      ],
      "see_also": [
        "lightning-createinvoice(7)",
        "lightning-invoice(7)",
        "lightning-listinvoices(7)",
        "lightning-delinvoice(7)",
        "lightning-getroute(7)",
        "lightning-sendpay(7)",
        "lightning-offer(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:signinvoice#1",
            "method": "signinvoice",
            "params": {
              "invstring": "lnbcrt100n1pnt2bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000bolt11invl010200000000"
            }
          },
          "response": {
            "bolt11": "lnbcrt100n1pnt2bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000bolt11invl060600000000"
          }
        },
        {
          "request": {
            "id": "example:signinvoice#2",
            "method": "signinvoice",
            "params": [
              "lnbcrt100n1pnt2bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000bolt11invl020600000000"
            ]
          },
          "response": {
            "bolt11": "lnbcrt100n1pnt2bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000bolt11invl060700000000"
          }
        }
      ]
    },
    "signmessage.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "signmessage",
      "title": "Command to create a signature from this node",
      "description": [
        "The **signmessage** RPC command creates a digital signature of *message* using this node's secret key. A receiver who knows your node's *id* and the *message* can be sure that the resulting signature could only be created by something with access to this node's secret key."
      ],
      "request": {
        "required": [
          "message"
        ],
        "additionalProperties": false,
        "properties": {
          "message": {
            "type": "string",
            "description": [
              "Less than 65536 characters long message to be signed by the node."
            ]
          }
        }
      },
      "response": {
        "required": [
          "signature",
          "recid",
          "zbase"
        ],
        "additionalProperties": false,
        "properties": {
          "signature": {
            "type": "hex",
            "description": [
              "The signature."
            ],
            "minLength": 128,
            "maxLength": 128
          },
          "recid": {
            "type": "hex",
            "description": [
              "The recovery id (0, 1, 2 or 3)."
            ],
            "minLength": 2,
            "maxLength": 2
          },
          "zbase": {
            "type": "string",
            "description": [
              "*signature* and *recid* encoded in a style compatible with **lnd**'s [SignMessageRequest](https://api.lightning.community/#grpc-request- signmessagerequest)."
            ]
          }
        }
      },
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-checkmessage(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)",
        "",
        "[SignMessageRequest](https://api.lightning.community/#grpc-request-signmessagerequest)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:signmessage#1",
            "method": "signmessage",
            "params": {
              "message": "this is a test!"
            }
          },
          "response": {
            "signature": "9ea05929890e40489edbd5fe0552d22bcffe00bbd29da4fcf93ed5d8f1973e421509071a64935231a126637e3615225ddda86d2d0926ae537d9c3be149f9b21f",
            "recid": "00",
            "zbase": "d6xkysjjtr8ry1r65xk9hbk14eih99oyzxjj5j8h9r9pms8t1h9rrfejyhpgjr41ggo1ca56gak1rzq7ibs14njgi3jz58b5hfr9uco9"
          }
        },
        {
          "request": {
            "id": "example:signmessage#2",
            "method": "signmessage",
            "params": {
              "message": "message for you"
            }
          },
          "response": {
            "signature": "8149401781108c1c2fda12d91969bfe2306afe06c387394d47a83a85a14702a16b6fcd0060693da436ff1c2b25cc470d7db68fe45d833733d8dca660a3f4d67d",
            "recid": "00",
            "zbase": "d6yw1oyzoreea8bx5ejp1gmjz9tdy4z6y5baqqkpe6wdibpbehbkn45x3wygy4j7wo5x68bmrzgrqdm7s486ezcdgh37tzfgcnt9jiu7"
          }
        }
      ]
    },
    "signmessagewithkey.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "signmessagewithkey",
      "title": "Command to create a signature using a key from the wallet",
      "description": [
        "The **signmessagewithkey** RPC command creates a digital signature of *message* using the key associated with the address provided in the input.",
        "The signature scheme follows the BIP137 specification."
      ],
      "added": "v25.05",
      "request": {
        "required": [
          "message",
          "address"
        ],
        "additionalProperties": false,
        "properties": {
          "message": {
            "type": "string",
            "description": [
              "Less than 65536 characters long message to be signed by the node."
            ]
          },
          "address": {
            "type": "string",
            "description": [
              "A Bitcoin accepted type address for lookup in the list of addresses issued to date.",
              "Only P2WPKH type addresses are supported"
            ]
          }
        }
      },
      "response": {
        "required": [
          "address",
          "pubkey",
          "signature",
          "base64"
        ],
        "additionalProperties": false,
        "properties": {
          "address": {
            "type": "string",
            "description": [
              "The bitcoin address used for signing."
            ]
          },
          "pubkey": {
            "type": "pubkey",
            "description": [
              "The public key associated with the bitcoin address provided."
            ]
          },
          "signature": {
            "type": "hex",
            "description": [
              "The signature."
            ]
          },
          "base64": {
            "type": "string",
            "description": [
              "The signature encoded in base64."
            ]
          }
        }
      },
      "author": [
        "Lagrang3 [lagrang3@protonmail.com](mailto:lagrang3@protonmail.com) is mainly responsible."
      ],
      "see_also": [],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:signmessagewithkey#1",
            "method": "signmessagewithkey",
            "params": {
              "message": "a test message",
              "address": "bcrt1qgrh5vtf63mtayzhxwp480aww3j3qfr5qpq65un"
            }
          },
          "response": {
            "address": "bcrt1qgrh5vtf63mtayzhxwp480aww3j3qfr5qpq65un",
            "pubkey": "03bc4a456585ba21ba26af4a0e5399ec76410b2e0ca67db0f3bcb2f47b232fa4b0",
            "signature": "28564edf260a72d991cbb38cf608e293124f8b8f478d13d4544fe27b9d76c65df1284ca395ccdfd3d5f151729ef18f56c028f5f860155d6aa4d0aaaa176a00db01",
            "base64": "KFZO3yYKctmRy7OM9gjikxJPi49HjRPUVE/ie512xl3xKEyjlczf09XxUXKe8Y9WwCj1+GAVXWqk0KqqF2oA2wE="
          }
        }
      ]
    },
    "signpsbt.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "signpsbt",
      "title": "Command to sign a wallet's inputs on a provided bitcoin transaction (PSBT).",
      "description": [
        "**signpsbt** is a low-level RPC command which signs a PSBT as defined by BIP-174.",
        "",
        "By default, all known inputs are signed, and others ignored: with *signonly*, only those inputs are signed, and an error is returned if one of them cannot be signed.",
        "",
        "Note that the command will fail if there are no inputs to sign, or if the inputs to be signed were not previously reserved."
      ],
      "request": {
        "required": [
          "psbt"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "The psbt to be signed."
            ]
          },
          "signonly": {
            "type": "array",
            "description": [
              "Input numbers to sign."
            ],
            "items": {
              "type": "u32"
            }
          }
        }
      },
      "response": {
        "required": [
          "signed_psbt"
        ],
        "additionalProperties": false,
        "properties": {
          "signed_psbt": {
            "type": "string",
            "description": [
              "The fully signed PSBT."
            ]
          }
        }
      },
      "errors": [
        "On failure, one of the following error codes may be returned:",
        "",
        "- -32602: Error in given parameters, or there aren't wallet's inputs to sign, or we couldn't sign all of *signonly*, or inputs are not reserved."
      ],
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) wrote the initial version of this man page,",
        "but many others did the hard work of actually implementing this rpc command."
      ],
      "see_also": [
        "lightning-fundpsbt(7)",
        "lightning-sendpsbt(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:signpsbt#1",
            "method": "signpsbt",
            "params": {
              "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000910000"
            }
          },
          "response": {
            "signed_psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000"
          }
        },
        {
          "request": {
            "id": "example:signpsbt#2",
            "method": "signpsbt",
            "params": [
              "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000"
            ]
          },
          "response": {
            "signed_psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000121000"
          }
        }
      ]
    },
    "splice_init.json": {
      "$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"
        ],
        "additionalProperties": false,
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel id of the channel to be spliced."
            ]
          },
          "relative_amount": {
            "type": "integer",
            "description": [
              "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",
              "```"
            ]
          },
          "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"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "The (incomplete) PSBT of the splice transaction."
            ]
          }
        }
      },
      "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`.",
        "",
        "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 the PSBT with the splice_update command.",
        "",
        "```shell",
        "PSBT_SPLICE_UPDATE=$(echo $(lightning-cli splice_update $CHANNEL_ID $PSBT_SPLICE_INIT) | jq -r \".psbt\")",
        "```",
        "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](mailto:@dustydaemon) is mainly responsible."
      ],
      "see_also": [
        "lightning-splice_signed(7)",
        "lightning-splice_update(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:splice_init#1",
            "method": "splice_init",
            "params": {
              "channel_id": "channelid0780000780000780000780000780000780000780000780000780000",
              "relative_amount": 100000,
              "initialpsbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000713000"
            }
          },
          "response": {
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000"
          }
        },
        {
          "request": {
            "id": "example:splice_init#2",
            "method": "splice_init",
            "params": [
              "channelid0780000780000780000780000780000780000780000780000780000",
              -105000,
              "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000714000"
            ]
          },
          "response": {
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000"
          }
        }
      ]
    },
    "splice_signed.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 psbt of the resulting transaction after splice negotiation(s)"
            ]
          },
          "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",
          "psbt"
        ],
        "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."
            ]
          },
          "psbt": {
            "type": "string",
            "description": [
              "The psbt of the resulting transaction after splice negotiation(s)"
            ]
          },
          "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](mailto:@dustydaemon) is mainly responsible."
      ],
      "see_also": [
        "lightning-splice_init(7)",
        "lightning-splice_update(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:splice_signed#1",
            "method": "splice_signed",
            "params": {
              "channel_id": "channelid0780000780000780000780000780000780000780000780000780000",
              "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000718000"
            }
          },
          "response": {
            "tx": "02000000000101sendpt64000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000640006400064000",
            "txid": "txid6400064000640006400064000640006400064000640006400064000",
            "outnum": 1,
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000"
          }
        },
        {
          "request": {
            "id": "example:splice_signed#2",
            "method": "splice_signed",
            "params": {
              "channel_id": "channelid0780000780000780000780000780000780000780000780000780000",
              "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000"
            }
          },
          "response": {
            "tx": "02000000000102sendpt65000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000650006500065000",
            "txid": "txid6500065000650006500065000650006500065000650006500065000",
            "outnum": 1,
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000"
          }
        }
      ]
    },
    "splice_update.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "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"
        ],
        "additionalProperties": false,
        "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",
          "signatures_secured"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "The (incomplete) PSBT of the splice transaction."
            ]
          },
          "commitments_secured": {
            "type": "boolean",
            "description": [
              "Whether or not the commitments were secured."
            ]
          },
          "signatures_secured": {
            "added": "v24.11",
            "type": "boolean",
            "description": [
              "whether or not the peer sent us their signatures for this splice"
            ]
          }
        }
      },
      "usage": [
        "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.",
        "",
        "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](mailto:@dustydaemon) is mainly responsible."
      ],
      "see_also": [
        "lightning-splice_init(7)",
        "lightning-splice_signed(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:splice_update#1",
            "method": "splice_update",
            "params": {
              "channel_id": "channelid0780000780000780000780000780000780000780000780000780000",
              "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000711000"
            }
          },
          "response": {
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200715200",
            "commitments_secured": true,
            "signatures_secured": true
          }
        },
        {
          "request": {
            "id": "example:splice_update#2",
            "method": "splice_update",
            "params": [
              "channelid0780000780000780000780000780000780000780000780000780000",
              "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000"
            ]
          },
          "response": {
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000712000",
            "commitments_secured": true,
            "signatures_secured": true
          }
        }
      ]
    },
    "sql-template.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.02",
      "rpc": "sql",
      "title": "Command to do complex queries on list commands",
      "description": [
        "The **sql** RPC command runs the given query across a sqlite3 database created from various list commands.",
        "",
        "When tables are accessed, it calls the below commands, so it's no faster than any other local access (though it goes to great length to cache `listnodes` and `listchannels`) which then processes the results.",
        "",
        "It is, however faster for remote access if the result of the query is much smaller than the list commands would be.",
        "",
        "Note that you may need to use `-o` if you use queries which contain `=` (which make lightning-cli(1) default to keyword style)"
      ],
      "request": {
        "required": [
          "query"
        ],
        "additionalProperties": false,
        "properties": {
          "query": {
            "type": "string",
            "description": [
              "The standard sqlite3 query to run.",
              "Note that queries like \"SELECT *\" are fragile, as columns will change across releases; see lightning-listsqlschemas(7)."
            ]
          }
        }
      },
      "response": {
        "required": [
          "rows"
        ],
        "additionalProperties": false,
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "type": "array"
            }
          },
          "warning_db_failure": {
            "type": "string",
            "description": [
              "A message if the database encounters an error partway through."
            ]
          }
        },
        "pre_return_value_notes": [
          "On success, an object containing **rows** is returned. It is an array. Each array entry contains an array of values, each an integer, real number, string or *null*, depending on the sqlite3 type.",
          "",
          "The object may contain **warning_db_failure** if the database fails partway through its operation."
        ]
      },
      "treatment_of_types": [
        "The following types are supported in schemas, and this shows how they are presented in the database. This matters: a JSON boolean is represented as an integer in the database, so a query will return 0 or 1, not true or false.",
        "",
        "* *hex*. A hex string.",
        "  * JSON: a string",
        "  * sqlite3: BLOB",
        "",
        "* *hash*/*secret*/*pubkey*/*txid*: just like *hex*.",
        "",
        "* *msat*/*integer*/*u64*/*u32*/*u16*/*u8*. Normal numbers.",
        "  * JSON: an unsigned integer",
        "  * sqlite3: INTEGER",
        "",
        "* *boolean*. True or false.",
        "  * JSON: literal **true** or **false**",
        "  * sqlite3: INTEGER",
        "",
        "* *number*. A floating point number (used for times in some places).",
        "  * JSON: number",
        "  * sqlite3: REAL",
        "",
        "* *string*. Text.",
        "  * JSON: string",
        "  * sqlite3: TEXT",
        "",
        "* *short_channel_id*. A short-channel-id of form 1x2x3.",
        "  * JSON: string",
        "  * sqlite3: TEXT"
      ],
      "permitted_sqlite3_functions": [
        "Writing to the database is not permitted, and limits are placed on various other query parameters.",
        "",
        "Additionally, only the following functions are allowed:",
        "",
        "* abs",
        "* avg",
        "* coalesce",
        "* count",
        "* date",
        "* datetime",
        "* julianday",
        "* hex",
        "* quote",
        "* length",
        "* like",
        "* lower",
        "* upper",
        "* min",
        "* max",
        "* strftime",
        "* sum",
        "* time",
        "* timediff",
        "* total",
        "* unixepoch",
        "* json_object",
        "* json_group_array"
      ],
      "tables": [
        "Note that tables which have a `created_index` field use that as the primary key (and `rowid` is an alias to this), otherwise an explicit `rowid` integer primary key is generated, whose value changes on each refresh.  This field is used for related tables to refer to specific rows in their parent. (sqlite3 usually has this as an implicit column, but we make it explicit as the implicit version is not allowed to be used as a foreign key).",
        ""
      ],
      "errors": [
        "On failure, an error is returned."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listtransactions(7)",
        "lightning-listhtlcs(7)",
        "lightning-listinvoices(7)",
        "lightning-listoffers(7)",
        "lightning-listchannels(7)",
        "lightning-listpeers(7)",
        "lightning-listpeerchannels(7)",
        "lightning-listsendpays(7)",
        "lightning-listchainmoves(7)",
        "lightning-listchannelmoves(7)",
        "lightning-bkpr-listaccountevents(7)",
        "lightning-bkpr-listincome(7)",
        "lightning-listnodes(7)",
        "lightning-listforwards(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "description": [
            "A simple peers selection query:"
          ],
          "request": {
            "id": "example:sql#1",
            "method": "sql",
            "params": {
              "query": "SELECT id FROM peers"
            }
          },
          "response": {
            "rows": [
              [
                "nodeid020202020202020202020202020202020202020202020202020202020202"
              ]
            ]
          }
        },
        {
          "description": [
            "A statement containing `=` needs `-o` in shell:"
          ],
          "request": {
            "id": "example:sql#2",
            "method": "sql",
            "params": [
              "SELECT label, description, status FROM invoices WHERE label='label inv_l12'"
            ]
          },
          "response": {
            "rows": [
              [
                "label inv_l12",
                "description inv_l12",
                "unpaid"
              ]
            ]
          }
        },
        {
          "description": [
            "If you want to get specific nodeid values from the nodes table:"
          ],
          "request": {
            "id": "example:sql#3",
            "method": "sql",
            "params": [
              "SELECT nodeid FROM nodes WHERE nodeid != x'nodeid030303030303030303030303030303030303030303030303030303030303'"
            ]
          },
          "response": {
            "rows": [
              [
                "nodeid020202020202020202020202020202020202020202020202020202020202"
              ],
              [
                "nodeid010101010101010101010101010101010101010101010101010101010101"
              ],
              [
                "nodeid040404040404040404040404040404040404040404040404040404040404"
              ]
            ]
          }
        },
        {
          "description": [
            "If you want to compare a BLOB column, `x'hex'` or `X'hex'` are needed:"
          ],
          "request": {
            "id": "example:sql#4",
            "method": "sql",
            "params": [
              "SELECT nodeid FROM nodes WHERE nodeid IN (x'nodeid010101010101010101010101010101010101010101010101010101010101', x'nodeid030303030303030303030303030303030303030303030303030303030303')"
            ]
          },
          "response": {
            "rows": [
              [
                "nodeid010101010101010101010101010101010101010101010101010101010101"
              ],
              [
                "nodeid030303030303030303030303030303030303030303030303030303030303"
              ]
            ]
          }
        },
        {
          "description": [
            "Related tables are usually referenced by JOIN:"
          ],
          "request": {
            "id": "example:sql#5",
            "method": "sql",
            "params": [
              "SELECT peer_id, to_us_msat, total_msat, peerchannels_status.status FROM peerchannels INNER JOIN peerchannels_status ON peerchannels_status.row = peerchannels.rowid"
            ]
          },
          "response": {
            "rows": [
              [
                "nodeid020202020202020202020202020202020202020202020202020202020202",
                490493792,
                1000000000,
                "CHANNELD_NORMAL:Channel ready for use."
              ]
            ]
          }
        },
        {
          "description": [
            "Simple function usage, in this case COUNT. Strings inside arrays need \", and ' to protect them from the shell:"
          ],
          "request": {
            "id": "example:sql#6",
            "method": "sql",
            "params": [
              "SELECT COUNT(*) FROM forwards"
            ]
          },
          "response": {
            "rows": [
              [
                9
              ]
            ]
          }
        },
        {
          "request": {
            "id": "example:sql#7",
            "method": "sql",
            "params": [
              "SELECT * from peerchannels_features"
            ]
          },
          "response": {
            "rows": [
              [
                28,
                23,
                0,
                "option_static_remotekey"
              ],
              [
                30,
                23,
                2,
                "option_anchors"
              ]
            ]
          }
        }
      ]
    },
    "staticbackup.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "staticbackup",
      "title": "Command for deriving getting SCB of all the existing channels",
      "description": [
        "The **staticbackup** RPC command returns an object with SCB of all the channels in an array."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "response": {
        "required": [
          "scb"
        ],
        "additionalProperties": false,
        "properties": {
          "scb": {
            "type": "array",
            "items": {
              "type": "hex",
              "description": [
                "SCB of a channel in TLV format."
              ]
            }
          }
        }
      },
      "author": [
        "Aditya [aditya.sharma20111@gmail.com](mailto:aditya.sharma20111@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-getsharedsecret(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:staticbackup#1",
            "method": "staticbackup",
            "params": {}
          },
          "response": {
            "scb": [
              "0000000000000001channelid0340000340000340000340000340000340000340000340000340000nodeid03030303030303030303030303030303030303030303030303030303030300017f000001034003400340034003400340034003400340034003400340034003400340034003400340034003400340034003400003401000",
              "0000000000000002channelid0340200340200340200340200340200340200340200340200340200nodeid03030303030303030303030303030303030303030303030303030303030300017f000001034203420342034203420342034203420342034203420342034203420342034203420342034203420342034203420003401000",
              "0000000000000003channelid0410000410000410000410000410000410000410000410000410000nodeid01010101010101010101010101010101010101010101010101010101010100017f000001041004100410041004100410041004100410041004100410041004100410041004100410041004100410041004100003401000",
              "0000000000000004channelid0120000120000120000120000120000120000120000120000120000nodeid01010101010101010101010101010101010101010101010101010101010100017f000001012001200120012001200120012001200120012001200120012001200120012001200120012001200120012001200003401000",
              "0000000000000005channelid1520015200152001520015200152001520015200152001520015200nodeid01010101010101010101010101010101010101010101010101010101010100017f000001015201520152015201520152015201520152015201520152015201520152015201520152015201520152015201520003401000",
              "0000000000000006channelid1240012400124001240012400124001240012400124001240012400nodeid02020202020202020202020202020202020202020202020202020202020200017f000001012401240124012401240124012401240124012401240124012401240124012401240124012401240124012401240003401000"
            ]
          }
        }
      ]
    },
    "stop.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "stop",
      "title": "Command to shutdown the Core Lightning node.",
      "description": [
        "The **stop** is a RPC command to shut off the Core Lightning node."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {}
      },
      "response": {
        "required": [
          "result"
        ],
        "additionalProperties": false,
        "properties": {
          "result": {
            "type": "string",
            "added": "v24.05",
            "enum": [
              "Shutdown complete"
            ]
          }
        }
      },
      "author": [
        "Vincenzo Palazzo [vincenzo.palazzo@protonmail.com](mailto:vincenzo.palazzo@protonmail.com) wrote the initial version of this man page,",
        "but many others did the hard work of actually implementing this rpc command."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:stop#1",
            "method": "stop",
            "params": {}
          },
          "response": {
            "result": "Shutdown complete"
          }
        }
      ]
    },
    "txdiscard.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "txdiscard",
      "title": "Abandon a transaction from txprepare, release inputs",
      "description": [
        "The **txdiscard** RPC command releases inputs which were reserved for use of the *txid* from lightning-txprepare(7)."
      ],
      "request": {
        "required": [
          "txid"
        ],
        "additionalProperties": false,
        "properties": {
          "txid": {
            "type": "txid",
            "description": [
              "The transaction id, inputs should be unreseverd from."
            ]
          }
        }
      },
      "response": {
        "required": [
          "unsigned_tx",
          "txid"
        ],
        "additionalProperties": false,
        "properties": {
          "unsigned_tx": {
            "type": "hex",
            "description": [
              "The unsigned transaction."
            ]
          },
          "txid": {
            "type": "txid",
            "description": [
              "The transaction id of *unsigned_tx*."
            ]
          }
        },
        "post_return_value_notes": [
          "If there is no matching *txid*, an error is reported. Note that this may happen due to incorrect usage, such as **txdiscard** or **txsend** already being called for *txid*."
        ]
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: An unknown *txid*."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-txprepare(7)",
        "lightning-txsend(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:txdiscard#1",
            "method": "txdiscard",
            "params": [
              "txidtxprep000100001000010000100001000010000100001000010000100001"
            ]
          },
          "response": {
            "unsigned_tx": "0200000000000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006",
            "txid": "txidtxprep000100001000010000100001000010000100001000010000100001"
          }
        },
        {
          "request": {
            "id": "example:txdiscard#2",
            "method": "txdiscard",
            "params": {
              "txid": "txidtxprep000300003000030000300003000030000300003000030000300003"
            }
          },
          "response": {
            "unsigned_tx": "0200000000000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008000800080008",
            "txid": "txidtxprep000300003000030000300003000030000300003000030000300003"
          }
        }
      ]
    },
    "txprepare.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "txprepare",
      "title": "Command to prepare to withdraw funds from the internal wallet",
      "description": [
        "The **txprepare** RPC command creates an unsigned transaction which spends funds from Core Lightning's internal wallet to the outputs specified in *outputs*.",
        "",
        "**txprepare** is similar to the first part of a **withdraw** command, but supports multiple outputs and uses *outputs* as parameter. The second part is provided by **txsend**."
      ],
      "request": {
        "required": [
          "outputs"
        ],
        "additionalProperties": false,
        "properties": {
          "outputs": {
            "type": "array",
            "description": [
              "Format is like: `[{destination1: amount1}, {destination2: amount2}]` or `[{destination: *all*}]`. It supports any number of **confirmed** outputs."
            ],
            "items": {
              "type": "outputdesc"
            }
          },
          "feerate": {
            "type": "feerate",
            "description": [
              "Used for the transaction as initial feerate."
            ],
            "default": "*normal*"
          },
          "minconf": {
            "type": "u32",
            "description": [
              "The minimum number of confirmations that used outputs should have."
            ],
            "default": 1
          },
          "utxos": {
            "type": "array",
            "description": [
              "To be used to fund the transaction, as an array of `txid:vout`. These must be drawn from the node's available UTXO set."
            ],
            "items": {
              "type": "outpoint"
            }
          }
        }
      },
      "response": {
        "required": [
          "psbt",
          "unsigned_tx",
          "txid"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "The PSBT representing the unsigned transaction."
            ]
          },
          "unsigned_tx": {
            "type": "hex",
            "description": [
              "The unsigned transaction."
            ]
          },
          "txid": {
            "type": "txid",
            "description": [
              "The transaction id of *unsigned_tx*; you hand this to lightning-txsend(7) or lightning-txdiscard(7), as the inputs of this transaction are reserved."
            ]
          }
        }
      },
      "errors": [
        "On failure, an error is reported and the transaction is not created.",
        "",
        "- -1: Catchall nonspecific error.",
        "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.",
        "- 302: The dust limit is not met."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-withdraw(7)",
        "lightning-txsend(7)",
        "lightning-txdiscard(7)",
        "lightning-feerates(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:txprepare#1",
            "method": "txprepare",
            "params": [
              [
                {
                  "bcrt1p0002020202020202020202020202020202020202020202020202020202": 16777216
                }
              ]
            ]
          },
          "response": {
            "unsigned_tx": "0200000000000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006000600060006",
            "txid": "txidtxprep000100001000010000100001000010000100001000010000100001",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000101000"
          }
        },
        {
          "request": {
            "id": "example:txprepare#2",
            "method": "txprepare",
            "params": {
              "outputs": [
                {
                  "bcrt1p0003030303030303030303030303030303030303030303030303030303": 16777216
                }
              ]
            }
          },
          "response": {
            "unsigned_tx": "0200000000000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002",
            "txid": "txidtxprep000200002000020000200002000020000200002000020000200002",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000201000"
          }
        }
      ]
    },
    "txsend.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "txsend",
      "title": "Command to sign and send transaction from txprepare",
      "description": [
        "The **txsend** RPC command signs and broadcasts a transaction created by *txprepare* RPC command."
      ],
      "request": {
        "required": [
          "txid"
        ],
        "additionalProperties": false,
        "properties": {
          "txid": {
            "type": "txid",
            "description": [
              "The transaction id of the transaction created by `txprepare` rpc command."
            ]
          }
        }
      },
      "response": {
        "required": [
          "psbt",
          "tx",
          "txid"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "The completed PSBT representing the signed transaction."
            ]
          },
          "tx": {
            "type": "hex",
            "description": [
              "The fully signed transaction."
            ]
          },
          "txid": {
            "type": "txid",
            "description": [
              "The transaction id of *tx*."
            ]
          }
        }
      },
      "errors": [
        "On failure, an error is reported (from bitcoind), and the inputs from the transaction are unreserved.",
        "",
        "- -1: Catchall nonspecific error."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-txprepare(7)",
        "lightning-txdiscard(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:txsend#1",
            "method": "txsend",
            "params": [
              "txidtxprep000200002000020000200002000020000200002000020000200002"
            ]
          },
          "response": {
            "tx": "02000000000101txsend00011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011000110001100011",
            "txid": "txidtxprep000200002000020000200002000020000200002000020000200002",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100"
          }
        },
        {
          "request": {
            "id": "example:txsend#2",
            "method": "txsend",
            "params": {
              "txid": "txidtxprep000400004000040000400004000040000400004000040000400004"
            }
          },
          "response": {
            "tx": "02000000000101txsend00022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022",
            "txid": "txidtxprep000400004000040000400004000040000400004000040000400004",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200022200"
          }
        }
      ]
    },
    "unreserveinputs.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "unreserveinputs",
      "title": "Release reserved UTXOs",
      "description": [
        "The **unreserveinputs** RPC command releases (or reduces reservation) on UTXOs which were previously marked as reserved, generally by lightning-reserveinputs(7)."
      ],
      "request": {
        "required": [
          "psbt"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "Inputs to unreserve are the inputs specified in the passed-in *psbt*."
            ]
          },
          "reserve": {
            "type": "u32",
            "description": [
              "The number of blocks to decrease reservation by."
            ],
            "default": 72
          }
        }
      },
      "response": {
        "required": [
          "reservations"
        ],
        "additionalProperties": false,
        "properties": {
          "reservations": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "required": [
                "txid",
                "vout",
                "was_reserved",
                "reserved"
              ],
              "properties": {
                "txid": {
                  "type": "txid",
                  "description": [
                    "The transaction id."
                  ]
                },
                "vout": {
                  "type": "u32",
                  "description": [
                    "The output number which was reserved."
                  ]
                },
                "was_reserved": {
                  "type": "boolean",
                  "description": [
                    "Whether the input was already reserved (usually `true`)."
                  ]
                },
                "reserved": {
                  "type": "boolean",
                  "description": [
                    "Whether the input is now reserved (may still be `true` if it was reserved for a long time)."
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "additionalProperties": true,
                    "properties": {
                      "reserved": {
                        "enum": [
                          true
                        ]
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "reserved_to_block"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "txid": {},
                      "vout": {},
                      "was_reserved": {},
                      "reserved": {},
                      "reserved_to_block": {
                        "type": "u32",
                        "description": [
                          "What blockheight the reservation will expire."
                        ]
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "errors": [
        "On failure, an error is reported and no UTXOs are unreserved.",
        "",
        "- -32602: Invalid parameter, i.e. an unparseable PSBT."
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-unreserveinputs(7)",
        "lightning-signpsbt(7)",
        "lightning-sendpsbt(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:unreserveinputs#1",
            "method": "unreserveinputs",
            "params": {
              "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000310000",
              "reserve": 200
            }
          },
          "response": {
            "reservations": []
          }
        },
        {
          "request": {
            "id": "example:unreserveinputs#2",
            "method": "unreserveinputs",
            "params": [
              "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000410000"
            ]
          },
          "response": {
            "reservations": []
          }
        }
      ]
    },
    "upgradewallet.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "upgradewallet",
      "title": "Command to spend all P2SH-wrapped inputs into a Native Segwit output",
      "description": [
        "`upgradewallet` is a convenience RPC which will spend all p2sh-wrapped Segwit deposits in a wallet into a single Native Segwit P2WPKH address."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "feerate": {
            "type": "feerate",
            "description": [
              "Feerate for the upgrade transaction."
            ],
            "added": "v23.02",
            "default": "*opening*"
          },
          "reservedok": {
            "type": "boolean",
            "description": [
              "Tells the wallet to include all P2SH-wrapped inputs, including reserved ones."
            ],
            "added": "v23.02"
          }
        }
      },
      "response": {
        "required": [
          "upgraded_outs"
        ],
        "additionalProperties": false,
        "properties": {
          "upgraded_outs": {
            "type": "u64",
            "description": [
              "Count of spent/upgraded UTXOs."
            ],
            "added": "v23.02"
          },
          "psbt": {
            "type": "string",
            "description": [
              "The PSBT that was finalized and sent."
            ],
            "added": "v23.02"
          },
          "tx": {
            "type": "hex",
            "description": [
              "The raw transaction which was sent."
            ],
            "added": "v23.02"
          },
          "txid": {
            "type": "txid",
            "description": [
              "The txid of the **tx**."
            ],
            "added": "v23.02"
          }
        }
      },
      "usage": [
        "The caller is trying to buy a liquidity ad but the command keeps failing. They have funds in their wallet, but they're all P2SH-wrapped outputs.",
        "",
        "The caller can call `upgradewallet` to convert their funds to native segwit outputs, which are valid for liquidity ad buys."
      ],
      "author": [
        "Lisa Neigut [niftynei@gmail.com](mailto:niftynei@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-utxopsbt(7)",
        "lightning-reserveinputs(7)",
        "lightning-unreserveinputs(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:upgradewallet#1",
            "method": "upgradewallet",
            "params": {}
          },
          "response": {
            "upgraded_outs": 0
          }
        },
        {
          "request": {
            "id": "example:upgradewallet#2",
            "method": "upgradewallet",
            "params": {
              "feerate": "urgent",
              "reservedok": true
            }
          },
          "response": {
            "tx": "02000000000101upgd20000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000200002000020000",
            "txid": "txidupgrade200000200000200000200000200000200000200000200000200000",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000110000",
            "upgraded_outs": 1
          }
        }
      ]
    },
    "utxopsbt.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "utxopsbt",
      "title": "Command to populate PSBT inputs from given UTXOs",
      "description": [
        "*utxopsbt* is a low-level RPC command which creates a PSBT using unreserved inputs in the wallet, optionally reserving them as well.",
        "",
        "It deliberately mirrors the parameters and output of lightning-fundpsbt(7) except instead of an optional *minconf* parameter to select unreserved outputs from the wallet, it takes a compulsory list of outputs to use."
      ],
      "request": {
        "required": [
          "satoshi",
          "feerate",
          "startweight",
          "utxos"
        ],
        "additionalProperties": false,
        "properties": {
          "satoshi": {
            "type": "sat_or_all",
            "description": [
              "The minimum satoshi value of the output(s) needed (or the string `all` meaning use all unreserved inputs). If a value, it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*."
            ]
          },
          "feerate": {
            "type": "feerate",
            "description": [
              "Used for the transaction as initial feerate."
            ],
            "default": "*normal*"
          },
          "startweight": {
            "type": "u32",
            "description": [
              "The weight of the transaction before *fundpsbt* has added any inputs."
            ]
          },
          "utxos": {
            "type": "array",
            "description": [
              "An array of `txid:vout`, each of which must be reserved or available."
            ],
            "items": {
              "type": "outpoint"
            }
          },
          "reserve": {
            "type": "u32",
            "description": [
              "If not zero, then *reserveinputs* is called (successfully, with *exclusive* true) on the returned PSBT for this number of blocks."
            ],
            "default": "72 blocks"
          },
          "reservedok": {
            "type": "boolean",
            "description": [
              "If set to true, it will also fail if any of the *utxos* are already reserved."
            ],
            "default": "false"
          },
          "locktime": {
            "type": "u32",
            "description": [
              "If not set, it is set to a recent block height."
            ]
          },
          "min_witness_weight": {
            "type": "u32",
            "description": [
              "Minimum weight to use for a UTXO's witness. If the actual witness weight is greater than the provided minimum, the actual witness weight will be used."
            ]
          },
          "excess_as_change": {
            "type": "boolean",
            "description": [
              "Flag to add a change output for the excess sats."
            ]
          },
          "opening_anchor_channel": {
            "added": "v23.08",
            "type": "boolean",
            "description": [
              "To signel that it needs emergency reserve for anchors so that we can lowball our commitment tx fees, and min-emergency-msat for reserving some sats for closing anchor channels."
            ]
          }
        }
      },
      "response": {
        "required": [
          "psbt",
          "feerate_per_kw",
          "estimated_final_weight",
          "excess_msat"
        ],
        "additionalProperties": false,
        "properties": {
          "psbt": {
            "type": "string",
            "description": [
              "Unsigned PSBT which fulfills the parameters given."
            ]
          },
          "feerate_per_kw": {
            "type": "u32",
            "description": [
              "The feerate used to create the PSBT, in satoshis-per-kiloweight."
            ]
          },
          "estimated_final_weight": {
            "type": "u32",
            "description": [
              "The estimated weight of the transaction once fully signed."
            ]
          },
          "excess_msat": {
            "type": "msat",
            "description": [
              "The amount above *satoshi* which is available. This could be zero, or dust; it will be zero if *change_outnum* is also returned."
            ]
          },
          "change_outnum": {
            "type": "u32",
            "description": [
              "The 0-based output number where change was placed (only if parameter *excess_as_change* was true and there was sufficient funds)."
            ]
          },
          "reservations": {
            "type": "array",
            "description": [
              "If *reserve* was true or a non-zero number, just as per lightning- reserveinputs(7)."
            ],
            "items": {
              "type": "object",
              "required": [
                "txid",
                "vout",
                "was_reserved",
                "reserved",
                "reserved_to_block"
              ],
              "additionalProperties": false,
              "properties": {
                "txid": {
                  "type": "txid",
                  "description": [
                    "The txid of the transaction."
                  ]
                },
                "vout": {
                  "type": "u32",
                  "description": [
                    "The 0-based output number."
                  ]
                },
                "was_reserved": {
                  "type": "boolean",
                  "description": [
                    "Whether this output was previously reserved."
                  ]
                },
                "reserved": {
                  "type": "boolean",
                  "enum": [
                    true
                  ],
                  "description": [
                    "Whether this output is now reserved."
                  ]
                },
                "reserved_to_block": {
                  "type": "u32",
                  "description": [
                    "The blockheight the reservation will expire."
                  ]
                }
              }
            }
          }
        },
        "post_return_value_notes": [
          "On success, returns the *psbt* it created, containing the inputs, *feerate_per_kw* showing the exact numeric feerate it used, *estimated_final_weight* for the estimated weight of the transaction once fully signed, and *excess_msat* containing the amount above *satoshi* which is available. This could be zero, or dust. If *satoshi* was `all`, then *excess_msat* is the entire amount once fees are subtracted for the weights of the inputs and *startweight*.",
          "",
          "If *reserve* was *true* or a non-zero number, then a *reservations* array is returned, exactly like *reserveinputs*.",
          "",
          "If *excess_as_change* is true and the excess is enough to cover an additional output above the `dust_limit`, then an output is added to the PSBT for the excess amount. The *excess_msat* will be zero. A *change_outnum* will be returned with the index of the change output."
        ]
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: Catchall nonspecific error.",
        "- 301: Insufficient UTXOs to meet *satoshi* value."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-fundpsbt(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:utxopsbt#1",
            "method": "utxopsbt",
            "params": [
              1000000,
              "15000perkw",
              214,
              [
                "utxo010101010101010101010101010101010101010101010101010101010101:1"
              ],
              null,
              true,
              null,
              null,
              true
            ]
          },
          "response": {
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000510000",
            "feerate_per_kw": 15000,
            "estimated_final_weight": 657,
            "excess_msat": 0,
            "change_outnum": 0,
            "reservations": [
              {
                "txid": "utxo010101010101010101010101010101010101010101010101010101010101",
                "vout": 1,
                "was_reserved": true,
                "reserved": true,
                "reserved_to_block": 2240
              }
            ]
          }
        },
        {
          "request": {
            "id": "example:utxopsbt#2",
            "method": "utxopsbt",
            "params": {
              "satoshi": 2000000,
              "feerate": "18750perkw",
              "startweight": 214,
              "utxos": [
                "utxo010101010101010101010101010101010101010101010101010101010101:1"
              ],
              "reservedok": true,
              "excess_as_change": true
            }
          },
          "response": {
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000520000",
            "feerate_per_kw": 18750,
            "estimated_final_weight": 657,
            "excess_msat": 0,
            "change_outnum": 0,
            "reservations": [
              {
                "txid": "utxo010101010101010101010101010101010101010101010101010101010101",
                "vout": 1,
                "was_reserved": true,
                "reserved": true,
                "reserved_to_block": 2312
              }
            ]
          }
        }
      ]
    },
    "wait.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "added": "v23.08",
      "rpc": "wait",
      "title": "Command to wait for creations, changes and deletions",
      "description": [
        "The **wait** RPC command returns once the index given by *indexname* in *subsystem* reaches or exceeds *nextvalue*. All indexes start at 0, when no events have happened (**wait** with a *nextvalue* of 0 is a way of getting the current index, though naturally this is racy!)."
      ],
      "request": {
        "required": [
          "subsystem",
          "indexname",
          "nextvalue"
        ],
        "additionalProperties": false,
        "properties": {
          "subsystem": {
            "type": "string",
            "description": [
              "The subsystem to get the next index value from.",
              "  `invoices`: corresponding to `listinvoices` (added in *v23.08*).",
              "  `sendpays`: corresponding to `listsendpays` (added in *v23.11*).",
              "  `forwards`: corresponding to `listforwards` (added in *v23.11*).",
              "  `htlcs`: corresponding to `listhtlcs` (added in *v25.05*).",
              "  `chainmoves`: corresponding to `listchainmoves` (added in *v25.09*).",
              "  `channelmoves`: corresponding to `listchannelmoves` (added in *v25.09*).",
              "  `networkevents`: corresponding to `listnetworkevents` (added in *v25.12*)."
            ],
            "enum": [
              "invoices",
              "forwards",
              "sendpays",
              "htlcs",
              "chainmoves",
              "channelmoves",
              "networkevents"
            ]
          },
          "indexname": {
            "type": "string",
            "description": [
              "The name of the index to get the next value for.",
              "  `created` is incremented by one for every new object.",
              "  `updated` is incremented by one every time an object is changed.",
              "  `deleted` is incremented by one every time an object is deleted."
            ],
            "enum": [
              "created",
              "updated",
              "deleted"
            ]
          },
          "nextvalue": {
            "type": "u64",
            "description": [
              "The next value of the index."
            ]
          }
        }
      },
      "response": {
        "required": [
          "subsystem"
        ],
        "additionalProperties": false,
        "properties": {
          "subsystem": {
            "type": "string",
            "enum": [
              "invoices",
              "forwards",
              "sendpays",
              "htlcs",
              "chainmoves",
              "channelmoves",
              "networkevents"
            ]
          },
          "created": {
            "type": "u64",
            "description": [
              "1-based index indicating order entry was created."
            ]
          },
          "updated": {
            "type": "u64",
            "description": [
              "1-based index indicating order entry was updated."
            ]
          },
          "deleted": {
            "type": "u64",
            "description": [
              "1-based index indicating order entry was deleted."
            ]
          },
          "forwards": {},
          "invoices": {},
          "sendpays": {},
          "htlcs": {},
          "chainmoves": {},
          "channelmoves": {},
          "networkevents": {},
          "details": {}
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "subsystem": {
                  "type": "string",
                  "enum": [
                    "invoices"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "properties": {
                "subsystem": {},
                "created": {},
                "updated": {},
                "deleted": {},
                "details": {
                  "type": "object",
                  "additionalProperties": false,
                  "deprecated": [
                    "v25.05",
                    "v26.06"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "unpaid",
                        "paid",
                        "expired"
                      ],
                      "description": [
                        "Whether it's paid, unpaid or unpayable."
                      ]
                    },
                    "label": {
                      "type": "string",
                      "description": [
                        "Unique label supplied at invoice creation."
                      ]
                    },
                    "description": {
                      "type": "string",
                      "description": [
                        "Description used in the invoice."
                      ]
                    },
                    "bolt11": {
                      "type": "string",
                      "description": [
                        "The BOLT11 string."
                      ]
                    },
                    "bolt12": {
                      "type": "string",
                      "description": [
                        "The BOLT12 string."
                      ]
                    }
                  }
                },
                "invoices": {
                  "type": "object",
                  "added": "v25.05",
                  "additionalProperties": false,
                  "properties": {
                    "status": {
                      "added": "v25.05",
                      "type": "string",
                      "enum": [
                        "unpaid",
                        "paid",
                        "expired"
                      ],
                      "description": [
                        "Whether it's paid, unpaid or unpayable."
                      ]
                    },
                    "label": {
                      "added": "v25.05",
                      "type": "string",
                      "description": [
                        "Unique label supplied at invoice creation."
                      ]
                    },
                    "description": {
                      "added": "v25.05",
                      "type": "string",
                      "description": [
                        "Description used in the invoice."
                      ]
                    },
                    "bolt11": {
                      "added": "v25.05",
                      "type": "string",
                      "description": [
                        "The BOLT11 string."
                      ]
                    },
                    "bolt12": {
                      "added": "v25.05",
                      "type": "string",
                      "description": [
                        "The BOLT12 string."
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "subsystem": {
                  "type": "string",
                  "enum": [
                    "forwards"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "properties": {
                "subsystem": {},
                "created": {},
                "updated": {},
                "deleted": {},
                "details": {
                  "type": "object",
                  "additionalProperties": false,
                  "deprecated": [
                    "v25.05",
                    "v26.06"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "offered",
                        "settled",
                        "failed",
                        "local_failed"
                      ],
                      "description": [
                        "Still ongoing, completed, failed locally, or failed after forwarding."
                      ]
                    },
                    "in_channel": {
                      "type": "short_channel_id",
                      "description": [
                        "Unique label supplied at invoice creation."
                      ]
                    },
                    "in_htlc_id": {
                      "type": "u64",
                      "description": [
                        "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)."
                      ]
                    },
                    "in_msat": {
                      "type": "msat",
                      "description": [
                        "The value of the incoming HTLC."
                      ]
                    },
                    "out_channel": {
                      "type": "short_channel_id",
                      "description": [
                        "The channel that the HTLC (trying to) forward to."
                      ]
                    }
                  }
                },
                "forwards": {
                  "added": "v25.05",
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "status": {
                      "added": "v25.05",
                      "type": "string",
                      "enum": [
                        "offered",
                        "settled",
                        "failed",
                        "local_failed"
                      ],
                      "description": [
                        "Still ongoing, completed, failed locally, or failed after forwarding."
                      ]
                    },
                    "in_channel": {
                      "added": "v25.05",
                      "type": "short_channel_id",
                      "description": [
                        "Unique label supplied at invoice creation."
                      ]
                    },
                    "in_htlc_id": {
                      "added": "v25.05",
                      "type": "u64",
                      "description": [
                        "The unique HTLC id the sender gave this (not present if incoming channel was closed before upgrade to v22.11)."
                      ]
                    },
                    "in_msat": {
                      "added": "v25.05",
                      "type": "msat",
                      "description": [
                        "The value of the incoming HTLC."
                      ]
                    },
                    "out_channel": {
                      "added": "v25.05",
                      "type": "short_channel_id",
                      "description": [
                        "The channel that the HTLC (trying to) forward to."
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "subsystem": {
                  "type": "string",
                  "enum": [
                    "sendpays"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "properties": {
                "subsystem": {},
                "created": {},
                "updated": {},
                "deleted": {},
                "details": {
                  "type": "object",
                  "additionalProperties": false,
                  "deprecated": [
                    "v25.05",
                    "v26.06"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "failed",
                        "complete"
                      ],
                      "description": [
                        "Status of the payment."
                      ]
                    },
                    "partid": {
                      "type": "u64",
                      "description": [
                        "Part number (for multiple parts to a single payment)."
                      ]
                    },
                    "groupid": {
                      "type": "u64",
                      "description": [
                        "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
                      ]
                    },
                    "payment_hash": {
                      "type": "hash",
                      "description": [
                        "The hash of the *payment_preimage* which will prove payment."
                      ]
                    }
                  }
                },
                "sendpays": {
                  "type": "object",
                  "added": "v25.05",
                  "additionalProperties": false,
                  "properties": {
                    "status": {
                      "added": "v25.05",
                      "type": "string",
                      "enum": [
                        "pending",
                        "failed",
                        "complete"
                      ],
                      "description": [
                        "Status of the payment."
                      ]
                    },
                    "partid": {
                      "added": "v25.05",
                      "type": "u64",
                      "description": [
                        "Part number (for multiple parts to a single payment)."
                      ]
                    },
                    "groupid": {
                      "added": "v25.05",
                      "type": "u64",
                      "description": [
                        "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
                      ]
                    },
                    "payment_hash": {
                      "added": "v25.05",
                      "type": "hash",
                      "description": [
                        "The hash of the *payment_preimage* which will prove payment."
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "subsystem": {
                  "type": "string",
                  "enum": [
                    "htlcs"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "properties": {
                "subsystem": {},
                "created": {},
                "updated": {},
                "deleted": {},
                "htlcs": {
                  "added": "v25.05",
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "state": {
                      "type": "string",
                      "enum": [
                        "SENT_ADD_HTLC",
                        "SENT_ADD_COMMIT",
                        "RCVD_ADD_REVOCATION",
                        "RCVD_ADD_ACK_COMMIT",
                        "SENT_ADD_ACK_REVOCATION",
                        "RCVD_REMOVE_HTLC",
                        "RCVD_REMOVE_COMMIT",
                        "SENT_REMOVE_REVOCATION",
                        "SENT_REMOVE_ACK_COMMIT",
                        "RCVD_REMOVE_ACK_REVOCATION",
                        "RCVD_ADD_HTLC",
                        "RCVD_ADD_COMMIT",
                        "SENT_ADD_REVOCATION",
                        "SENT_ADD_ACK_COMMIT",
                        "RCVD_ADD_ACK_REVOCATION",
                        "SENT_REMOVE_HTLC",
                        "SENT_REMOVE_COMMIT",
                        "RCVD_REMOVE_REVOCATION",
                        "RCVD_REMOVE_ACK_COMMIT",
                        "SENT_REMOVE_ACK_REVOCATION"
                      ],
                      "added": "v25.05",
                      "description": [
                        "The first 10 states are for `out`, the next 10 are for `in`."
                      ]
                    },
                    "htlc_id": {
                      "added": "v25.05",
                      "type": "u64",
                      "description": [
                        "The `id` field which uniquely identifies this HTLC for this channel and direction."
                      ]
                    },
                    "short_channel_id": {
                      "added": "v25.05",
                      "type": "short_channel_id",
                      "description": [
                        "The channel that contains/contained the HTLC."
                      ]
                    },
                    "cltv_expiry": {
                      "added": "v25.05",
                      "type": "u32",
                      "description": [
                        "The block number where this HTLC expires/expired."
                      ]
                    },
                    "amount_msat": {
                      "type": "msat",
                      "added": "v25.05",
                      "description": [
                        "The value of the HTLC."
                      ]
                    },
                    "direction": {
                      "type": "string",
                      "added": "v25.05",
                      "enum": [
                        "out",
                        "in"
                      ],
                      "description": [
                        "Out if we offered this to the peer, in if they offered it."
                      ]
                    },
                    "payment_hash": {
                      "added": "v25.05",
                      "type": "hash",
                      "description": [
                        "Payment hash sought by HTLC."
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "subsystem": {
                  "type": "string",
                  "enum": [
                    "chainmoves"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "properties": {
                "subsystem": {},
                "created": {},
                "updated": {},
                "deleted": {},
                "channelmoves": {},
                "chainmoves": {
                  "added": "v25.09",
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "account",
                    "credit_msat",
                    "debit_msat"
                  ],
                  "properties": {
                    "account": {
                      "added": "v25.09",
                      "type": "string",
                      "description": [
                        "The account (e.g. channel id) associated with this movement."
                      ]
                    },
                    "credit_msat": {
                      "added": "v25.09",
                      "type": "msat",
                      "description": [
                        "The amount incoming"
                      ]
                    },
                    "debit_msat": {
                      "added": "v25.09",
                      "type": "msat",
                      "description": [
                        "The amount outgoing"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "subsystem": {
                  "type": "string",
                  "enum": [
                    "channelmoves"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "properties": {
                "subsystem": {},
                "created": {},
                "updated": {},
                "deleted": {},
                "chainmoves": {},
                "channelmoves": {
                  "added": "v25.09",
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "account",
                    "credit_msat",
                    "debit_msat"
                  ],
                  "properties": {
                    "account": {
                      "added": "v25.09",
                      "type": "string",
                      "description": [
                        "The account (e.g. channel id) associated with this movement."
                      ]
                    },
                    "credit_msat": {
                      "added": "v25.09",
                      "type": "msat",
                      "description": [
                        "The amount incoming"
                      ]
                    },
                    "debit_msat": {
                      "added": "v25.09",
                      "type": "msat",
                      "description": [
                        "The amount outgoing"
                      ]
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "subsystem": {
                  "type": "string",
                  "enum": [
                    "networkevents"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "properties": {
                "subsystem": {},
                "created": {},
                "updated": {},
                "deleted": {},
                "networkevents": {
                  "added": "v25.12",
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "created_index": {
                      "added": "v25.12",
                      "type": "u64",
                      "description": [
                        "The created_index of the record added/deleted"
                      ]
                    },
                    "type": {
                      "added": "v25.12",
                      "type": "string",
                      "enum": [
                        "connect",
                        "connect_fail",
                        "ping",
                        "disconnect"
                      ],
                      "description": [
                        "The kind of network event"
                      ]
                    },
                    "peer_id": {
                      "added": "v25.12",
                      "type": "pubkey",
                      "description": [
                        "The peer this network event was with"
                      ]
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "reliability": [
        "Indices can go forward by more than one; in particular, if multiple objects were created and the one deleted, you could see this effect (a channel closing will delete all the htlcs, for example).  You can also see if it changes happen more rapidly than you can call wait again.",
        "",
        "Indices only monotoncally increase."
      ],
      "usage": [
        "The **wait** RPC is used to track changes in the system. Consider tracking invoices being paid or expiring.",
        "",
        "The simplest (and inefficient method) would be:",
        "",
        "1: Call `listinvoices` to get the current state of all invoices, and remember the highest `updated_index`. Say it was 5.",
        "",
        "2: Call `wait invoices updated 6`.",
        "",
        "3: When it returns, call `listinvoices` again to see what changed.",
        "",
        "This is obviously inefficient, so there are two optimizations:",
        "",
        "1: Call `listinvoices` with `index=updated` and `start=6` to only see invoices with `updated_index` greater than or equal to 6.",
        "",
        "2: `wait` itself may also return some limited subset of fields from the list command (it can't do this in all cases); for `invoices` this is `label` and `status`, allowing many callers to avoid the `listinvoices` call."
      ],
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-listinvoices(7)",
        "lightning-listforwards(7)",
        "lightning-listsendpays(7)",
        "lightning-listhtlcs(7)",
        "lightning-listchainmoves(7)",
        "lightning-listchannelmoves(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:wait#1",
            "method": "wait",
            "params": {
              "subsystem": "invoices",
              "indexname": "created",
              "nextvalue": 0
            }
          },
          "response": {
            "subsystem": "invoices",
            "created": 16
          }
        },
        {
          "request": {
            "id": "example:wait#2",
            "method": "wait",
            "params": {
              "subsystem": "sendpays",
              "indexname": "created",
              "nextvalue": 18
            }
          },
          "response": {
            "subsystem": "sendpays",
            "created": 18,
            "details": {
              "status": "pending",
              "partid": 0,
              "groupid": 1,
              "payment_hash": "paymenthashwtspct20101010101010101010101010101010101010101010101"
            },
            "sendpays": {
              "status": "pending",
              "partid": 0,
              "groupid": 1,
              "payment_hash": "paymenthashwtspct20101010101010101010101010101010101010101010101"
            }
          }
        },
        {
          "request": {
            "id": "example:wait#3",
            "method": "wait",
            "params": [
              "sendpays",
              "updated",
              18
            ]
          },
          "response": {
            "subsystem": "sendpays",
            "updated": 18,
            "details": {
              "status": "complete",
              "partid": 0,
              "groupid": 1,
              "payment_hash": "paymenthashwtspct20101010101010101010101010101010101010101010101"
            },
            "sendpays": {
              "status": "complete",
              "partid": 0,
              "groupid": 1,
              "payment_hash": "paymenthashwtspct20101010101010101010101010101010101010101010101"
            }
          }
        }
      ]
    },
    "waitanyinvoice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "waitanyinvoice",
      "title": "Command for waiting for payments",
      "description": [
        "The **waitanyinvoice** RPC command waits until an invoice is paid, then returns a single entry as per **listinvoices**. It will not return for any invoices paid prior to or including the *lastpay_index*.",
        "",
        "This is usually called iteratively: once with no arguments, then repeatedly with the returned *pay_index* entry. This ensures that no paid invoice is missed. The *pay_index* is a monotonically-increasing number assigned to an invoice when it gets paid. The first valid *pay_index* is 1."
      ],
      "request": {
        "required": [],
        "additionalProperties": false,
        "properties": {
          "lastpay_index": {
            "type": "u64",
            "description": [
              "Ignores any invoices paid prior to or including this index. 0 is equivalent to not specifying and negative value is invalid."
            ]
          },
          "timeout": {
            "type": "u64",
            "description": [
              "If specified, wait at most that number of seconds, which must be an integer. If the specified *timeout* is reached, this command will return with an error. You can specify this to 0 so that **waitanyinvoice** will return immediately with an error if no pending invoice is available yet. If unspecified, this command will wait indefinitely."
            ]
          }
        }
      },
      "response": {
        "required": [
          "label",
          "payment_hash",
          "status",
          "created_index",
          "expires_at"
        ],
        "additionalProperties": true,
        "properties": {
          "label": {
            "type": "string",
            "description": [
              "Unique label supplied at invoice creation."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "Description used in the invoice."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "paid",
              "expired"
            ],
            "description": [
              "Whether it's paid or expired."
            ]
          },
          "expires_at": {
            "type": "u64",
            "description": [
              "UNIX timestamp of when it will become / became unpayable."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount required to pay this invoice."
            ]
          },
          "bolt11": {
            "type": "string",
            "description": [
              "The BOLT11 string (always present unless *bolt12* is)."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The BOLT12 string (always present unless *bolt11* is)."
            ]
          },
          "created_index": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "1-based index indicating order this invoice was created in."
            ]
          },
          "updated_index": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "1-based index indicating order this invoice was changed (only present if it has changed since creation)."
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "paid"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "pay_index",
                "amount_received_msat",
                "paid_at",
                "payment_preimage"
              ],
              "properties": {
                "label": {},
                "description": {},
                "payment_hash": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "bolt11": {},
                "bolt12": {},
                "expires_at": {},
                "created_index": {},
                "updated_index": {},
                "pay_index": {
                  "type": "u64",
                  "description": [
                    "Unique incrementing index for this payment."
                  ]
                },
                "amount_received_msat": {
                  "type": "msat",
                  "description": [
                    "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)."
                  ]
                },
                "paid_at": {
                  "type": "u64",
                  "description": [
                    "UNIX timestamp of when it was paid."
                  ]
                },
                "paid_outpoint": {
                  "type": "object",
                  "description": [
                    "Outpoint this invoice was paid with."
                  ],
                  "added": "v23.11",
                  "additionalProperties": false,
                  "required": [
                    "txid",
                    "outnum"
                  ],
                  "properties": {
                    "txid": {
                      "added": "v23.11",
                      "type": "txid",
                      "description": [
                        "ID of the transaction that paid the invoice."
                      ]
                    },
                    "outnum": {
                      "added": "v23.11",
                      "type": "u32",
                      "description": [
                        "The 0-based output number of the transaction that paid the invoice."
                      ]
                    }
                  }
                },
                "payment_preimage": {
                  "type": "secret",
                  "description": [
                    "Proof of payment."
                  ]
                }
              }
            },
            "else": {
              "additionalProperties": false,
              "properties": {
                "label": {},
                "description": {},
                "payment_hash": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "bolt11": {},
                "bolt12": {},
                "created_index": {},
                "updated_index": {},
                "expires_at": {}
              }
            }
          }
        ]
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- 904: The *timeout* was reached without an invoice being paid."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-waitinvoice(7)",
        "lightning-listinvoices(7)",
        "lightning-delinvoice(7)",
        "lightning-invoice(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:waitanyinvoice#1",
            "method": "waitanyinvoice",
            "params": {}
          },
          "response": {
            "label": "lbl balance l1 to l2",
            "bolt11": "lnbcrt222n1pnt3005720bolt114000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
            "payment_hash": "paymenthashdelpay10101010101010101010101010101010101010101010101",
            "amount_msat": 500000000,
            "status": "paid",
            "pay_index": 1,
            "amount_received_msat": 500000000,
            "paid_at": 1738500000,
            "payment_preimage": "paymentpreimgdp1010101010101010101010101010101010101010101010101",
            "description": "description send some sats l1 to l2",
            "expires_at": 1739000000,
            "created_index": 1,
            "updated_index": 1
          }
        },
        {
          "request": {
            "id": "example:waitanyinvoice#2",
            "method": "waitanyinvoice",
            "params": {
              "lastpay_index": 1,
              "timeout": 0
            }
          },
          "response": {
            "label": "test_injectpaymentonion1",
            "bolt11": "lnbcrt100n1pnt2bolt11invl020700000000bolt11invl020700000000bolt11invl020700000000bolt11invl020700000000bolt11invl020700000000bolt11invl020700000000bolt11invl020700000000bolt11invl020700000000bolt11invl020700000000bolt11invl020700000000",
            "payment_hash": "paymenthashinvl0270027002700270027002700270027002700270027002700",
            "amount_msat": 1000,
            "status": "paid",
            "pay_index": 2,
            "amount_received_msat": 1000,
            "paid_at": 1738500000,
            "payment_preimage": "paymentpreimgio1030303030303030303030303030303030303030303030303",
            "description": "test injectpaymentonion1 description",
            "expires_at": 1739000000,
            "created_index": 8,
            "updated_index": 2
          }
        }
      ]
    },
    "waitblockheight.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "waitblockheight",
      "title": "Command for waiting for blocks on the blockchain",
      "description": [
        "The **waitblockheight** RPC command waits until the blockchain has reached the specified *blockheight*."
      ],
      "request": {
        "required": [
          "blockheight"
        ],
        "additionalProperties": false,
        "properties": {
          "blockheight": {
            "type": "u32",
            "description": [
              "Current blockheight of the blockchain if the value is greater than this number. If it is a present or past block height, then the command returns immediately."
            ]
          },
          "timeout": {
            "type": "u32",
            "description": [
              "Only wait up to specified seconds."
            ],
            "default": "60 seconds"
          }
        }
      },
      "response": {
        "required": [
          "blockheight"
        ],
        "additionalProperties": false,
        "properties": {
          "blockheight": {
            "type": "u32",
            "description": [
              "The current block height (>= *blockheight* parameter)."
            ]
          }
        },
        "post_return_value_notes": [
          "If *timeout* seconds is reached without the specified blockheight being reached, this command will fail with a code of `2000`."
        ]
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- 2000: Timed out."
      ],
      "author": [
        "ZmnSCPxj [ZmnSCPxj@protonmail.com](mailto:ZmnSCPxj@protonmail.com) is mainly responsible."
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "description": [
            "This will return immediately since the current blockheight exceeds the requested waitblockheight."
          ],
          "request": {
            "id": "example:waitblockheight#1",
            "method": "waitblockheight",
            "params": {
              "blockheight": 126
            }
          },
          "response": {
            "blockheight": 130
          }
        },
        {
          "description": [
            "This will return after the next block is mined because requested waitblockheight is one block higher than the current blockheight."
          ],
          "request": {
            "id": "example:waitblockheight#2",
            "method": "waitblockheight",
            "params": {
              "blockheight": 131,
              "timeout": 600
            }
          },
          "response": {
            "blockheight": 131
          }
        }
      ]
    },
    "waitinvoice.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "waitinvoice",
      "title": "Command for waiting for specific payment",
      "description": [
        "The **waitinvoice** RPC command waits until a specific invoice is paid, then returns that single entry as per **listinvoices**."
      ],
      "request": {
        "required": [
          "label"
        ],
        "additionalProperties": true,
        "properties": {
          "label": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ],
            "description": [
              "Unique label of the invoice waiting to be paid."
            ]
          }
        }
      },
      "response": {
        "required": [
          "label",
          "payment_hash",
          "status",
          "created_index",
          "expires_at"
        ],
        "additionalProperties": true,
        "properties": {
          "label": {
            "type": "string",
            "description": [
              "Unique label supplied at invoice creation."
            ]
          },
          "description": {
            "type": "string",
            "description": [
              "Description used in the invoice."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "paid",
              "expired"
            ],
            "description": [
              "Whether it's paid or expired."
            ]
          },
          "expires_at": {
            "type": "u64",
            "description": [
              "UNIX timestamp of when it will become / became unpayable."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount required to pay this invoice."
            ]
          },
          "bolt11": {
            "type": "string",
            "description": [
              "The BOLT11 string (always present unless *bolt12* is)."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The BOLT12 string (always present unless *bolt11* is)."
            ]
          },
          "created_index": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "1-based index indicating order this invoice was created in."
            ]
          },
          "updated_index": {
            "type": "u64",
            "added": "v23.08",
            "description": [
              "1-based index indicating order this invoice was changed (only present if it has changed since creation)."
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "paid"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "pay_index",
                "amount_received_msat",
                "paid_at",
                "payment_preimage"
              ],
              "properties": {
                "label": {},
                "description": {},
                "payment_hash": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "bolt11": {},
                "bolt12": {},
                "expires_at": {},
                "created_index": {},
                "updated_index": {},
                "pay_index": {
                  "type": "u64",
                  "description": [
                    "Unique incrementing index for this payment."
                  ]
                },
                "amount_received_msat": {
                  "type": "msat",
                  "description": [
                    "The amount actually received (could be slightly greater than *amount_msat*, since clients may overpay)."
                  ]
                },
                "paid_at": {
                  "type": "u64",
                  "description": [
                    "UNIX timestamp of when it was paid."
                  ]
                },
                "paid_outpoint": {
                  "type": "object",
                  "description": [
                    "Outpoint this invoice was paid with."
                  ],
                  "added": "v23.11",
                  "additionalProperties": false,
                  "required": [
                    "txid",
                    "outnum"
                  ],
                  "properties": {
                    "txid": {
                      "added": "v23.11",
                      "type": "txid",
                      "description": [
                        "ID of the transaction that paid the invoice."
                      ]
                    },
                    "outnum": {
                      "added": "v23.11",
                      "type": "u32",
                      "description": [
                        "The 0-based output number of the transaction that paid the invoice."
                      ]
                    }
                  }
                },
                "payment_preimage": {
                  "type": "secret",
                  "description": [
                    "Proof of payment."
                  ]
                }
              }
            },
            "else": {
              "additionalProperties": false,
              "properties": {
                "label": {},
                "description": {},
                "payment_hash": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "bolt11": {},
                "bolt12": {},
                "created_index": {},
                "updated_index": {},
                "expires_at": {}
              }
            }
          }
        ]
      },
      "errors": [
        "On error the returned object will contain `code` and `message` properties, with `code` being one of the following:",
        "",
        "- -32602: If the given parameters are wrong.",
        "- -1: If the invoice is deleted while unpaid, or the invoice does not exist.",
        "- 903: If the invoice expires before being paid, or is already expired."
      ],
      "author": [
        "Christian Decker [decker.christian@gmail.com](mailto:decker.christian@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-waitanyinvoice(7)",
        "lightning-listinvoices(7)",
        "lightning-delinvoice(7)",
        "lightning-invoice(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:waitinvoice#1",
            "method": "waitinvoice",
            "params": {
              "label": "inv2"
            }
          },
          "response": {
            "label": "inv2",
            "bolt11": "lnbcrt222n1pnt3005720bolt11wtinv01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101",
            "payment_hash": "paymenthashwaitinv0101010101010101010101010101010101010101010101",
            "amount_msat": 2000,
            "status": "paid",
            "pay_index": 5,
            "amount_received_msat": 2000,
            "paid_at": 1738500000,
            "payment_preimage": "paymentpreimagewaitinv0010101010101010101010101010101010101010101",
            "description": "inv2",
            "expires_at": 1739000000,
            "created_index": 13,
            "updated_index": 5
          }
        },
        {
          "request": {
            "id": "example:waitinvoice#2",
            "method": "waitinvoice",
            "params": [
              "inv3"
            ]
          },
          "response": {
            "label": "inv3",
            "bolt11": "lnbcrt222n1pnt3005720bolt11wtinv02020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202",
            "payment_hash": "paymenthashwaitinv0202020202020202020202020202020202020202020202",
            "amount_msat": 3000,
            "status": "paid",
            "pay_index": 6,
            "amount_received_msat": 3000,
            "paid_at": 1738500000,
            "payment_preimage": "paymentpreimagewaitinv0020202020202020202020202020202020202020202",
            "description": "inv3",
            "expires_at": 1739000000,
            "created_index": 14,
            "updated_index": 6
          }
        }
      ]
    },
    "waitsendpay.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "waitsendpay",
      "title": "Command for sending a payment via a route",
      "description": [
        "The **waitsendpay** RPC command polls or waits for the status of an outgoing payment that was initiated by a previous **sendpay** invocation.",
        "",
        "If the payment completed with success, this command returns with success. Otherwise, if the payment completed with failure, this command returns an error."
      ],
      "request": {
        "required": [
          "payment_hash"
        ],
        "additionalProperties": false,
        "properties": {
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage*."
            ]
          },
          "timeout": {
            "type": "u32",
            "description": [
              "A timeout in seconds, for this RPC command to return. If the *timeout* is provided and the given amount of time passes without the payment definitely succeeding or definitely failing, this command returns with a 200 error code (payment still in progress). If *timeout* is not provided this call will wait indefinitely. Indicating a *timeout* of 0 effectively makes this call a pollable query of the status of the payment."
            ]
          },
          "partid": {
            "type": "u64",
            "description": [
              "Unique ID within this (multi-part) payment. It must match that of the **sendpay** command."
            ]
          },
          "groupid": {
            "type": "u64",
            "description": [
              "Grouping key to disambiguate multiple attempts to pay the same payment_hash."
            ]
          }
        },
        "pairedWith": [
          [
            "partid",
            "groupid"
          ]
        ]
      },
      "response": {
        "required": [
          "id",
          "created_index",
          "payment_hash",
          "status",
          "created_at",
          "amount_sent_msat"
        ],
        "additionalProperties": false,
        "properties": {
          "created_index": {
            "added": "v23.11",
            "type": "u64",
            "description": [
              "1-based index indicating order this payment was created in."
            ]
          },
          "id": {
            "type": "u64",
            "description": [
              "Old synonym for created_index."
            ]
          },
          "groupid": {
            "type": "u64",
            "description": [
              "Grouping key to disambiguate multiple attempts to pay an invoice or the same payment_hash."
            ]
          },
          "payment_hash": {
            "type": "hash",
            "description": [
              "The hash of the *payment_preimage* which will prove payment."
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "complete"
            ],
            "description": [
              "Status of the payment."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "The amount delivered to destination (if known)."
            ]
          },
          "destination": {
            "type": "pubkey",
            "description": [
              "The final destination of the payment if known."
            ]
          },
          "created_at": {
            "type": "u64",
            "description": [
              "The UNIX timestamp showing when this payment was initiated."
            ]
          },
          "updated_index": {
            "added": "v23.11",
            "type": "u64",
            "description": [
              "1-based index indicating order this payment was changed (only present if it has changed since creation)."
            ]
          },
          "completed_at": {
            "type": "number",
            "description": [
              "The UNIX timestamp showing when this payment was completed."
            ]
          },
          "amount_sent_msat": {
            "type": "msat",
            "description": [
              "The amount sent."
            ]
          },
          "label": {
            "type": "string",
            "description": [
              "The label, if given to sendpay."
            ]
          },
          "partid": {
            "type": "u64",
            "description": [
              "The *partid*, if given to sendpay."
            ]
          },
          "bolt11": {
            "type": "string",
            "description": [
              "The bolt11 string (if pay supplied one)."
            ]
          },
          "bolt12": {
            "type": "string",
            "description": [
              "The bolt12 string (if supplied for pay)."
            ]
          },
          "message": {},
          "payment_preimage": {}
        },
        "allOf": [
          {
            "if": {
              "additionalProperties": true,
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "complete"
                  ]
                }
              }
            },
            "then": {
              "additionalProperties": false,
              "required": [
                "payment_preimage"
              ],
              "properties": {
                "id": {},
                "created_index": {},
                "updated_index": {},
                "groupid": {},
                "payment_hash": {},
                "status": {},
                "msatoshi": {},
                "amount_msat": {},
                "destination": {},
                "created_at": {},
                "completed_at": {},
                "msatoshi_sent": {},
                "amount_sent_msat": {},
                "label": {},
                "partid": {},
                "bolt11": {},
                "bolt12": {},
                "payment_preimage": {
                  "type": "secret",
                  "description": [
                    "The proof of payment: SHA256 of this **payment_hash**."
                  ]
                }
              }
            }
          }
        ]
      },
      "errors": [
        "On error, and even if the error occurred from a node other than the final destination, the route table will no longer be updated. Use the *exclude* parameter of the `getroute` command to ignore the failing route.",
        "",
        "- -1: Catchall nonspecific error.",
        "- 200: Timed out before the payment could complete.",
        "- 202: Unparseable onion reply. The *data* field of the error will have an *onionreply* field, a hex string representation of the raw onion reply.",
        "- 203: Permanent failure at destination. The *data* field of the error will be routing failure object.",
        "- 204: Failure along route; retry a different route. The *data* field of the error will be routing failure object.",
        "- 208: A payment for *payment_hash* was never made and there is nothing to wait for.",
        "- 209: The payment already failed, but the reason for failure was not stored. This should only occur when querying failed payments on very old databases.",
        "",
        "A routing failure object has the fields below:",
        "",
        "*erring_index*: The index of the node along the route that reported the error. 0 for the local node, 1 for the first hop, and so on.",
        "*erring_node*: The hex string of the pubkey id of the node that reported the error.",
        "*erring_channel*: The short channel ID of the channel that has the error (or the final channel if the destination raised the error).",
        "*erring_direction*: The direction of traversing the *erring_channel*:",
        "*failcode*: The failure code, as per BOLT #4.",
        "*failcodename*: The human-readable name corresponding to *failcode*, if known."
      ],
      "author": [
        "ZmnSCPxj [ZmnSCPxj@protonmail.com](mailto:ZmnSCPxj@protonmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-sendpay(7)",
        "lightning-pay(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:waitsendpay#1",
            "method": "waitsendpay",
            "params": {
              "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100"
            }
          },
          "response": {
            "created_index": 2,
            "id": 2,
            "payment_hash": "paymenthashinvl0310031003100310031003100310031003100310031003100",
            "groupid": 1,
            "updated_index": 2,
            "destination": "nodeid030303030303030303030303030303030303030303030303030303030303",
            "amount_msat": 10000,
            "amount_sent_msat": 10001,
            "created_at": 1738000000,
            "completed_at": 1739000000,
            "status": "complete",
            "payment_preimage": "paymentpreimagew010101010101010101010101010101010101010101010101"
          }
        }
      ]
    },
    "withdraw.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "rpc": "withdraw",
      "title": "Command for withdrawing funds from the internal wallet",
      "description": [
        "The **withdraw** RPC command sends funds from Core Lightning's internal wallet to the address specified in *destination*."
      ],
      "request": {
        "required": [
          "destination",
          "satoshi"
        ],
        "additionalProperties": false,
        "properties": {
          "destination": {
            "type": "string",
            "description": [
              "Any Bitcoin accepted type, including bech32."
            ]
          },
          "satoshi": {
            "type": "sat_or_all",
            "description": [
              "The amount to be withdrawn from the internal wallet (expressed, as name suggests, in satoshi). The string *all* can be used to specify withdrawal of all available funds (possibly restricted by the `utxos` parameter, and note that if we have any anchor channels, this will always leave at least `min-emergency-msat` as change).  Otherwise, it is in satoshi precision; it can be a whole number, a whole number ending in *sat*, a whole number ending in *000msat*, or a number with 1 to 8 decimal places ending in *btc*."
            ]
          },
          "feerate": {
            "type": "feerate",
            "description": [
              "Used for the withdrawal as initial feerate."
            ],
            "default": "*normal*"
          },
          "minconf": {
            "type": "u16",
            "description": [
              "Minimum number of confirmations that used outputs should have."
            ],
            "default": 1
          },
          "utxos": {
            "type": "array",
            "description": [
              "Specifies the utxos to be used to be withdrawn from, as an array of `txid:vout`. These must be drawn from the node's available UTXO set."
            ],
            "items": {
              "type": "outpoint"
            }
          }
        }
      },
      "response": {
        "required": [
          "psbt",
          "tx",
          "txid"
        ],
        "additionalProperties": false,
        "properties": {
          "tx": {
            "type": "hex",
            "description": [
              "The fully signed bitcoin transaction."
            ]
          },
          "txid": {
            "type": "txid",
            "description": [
              "The transaction id of *tx*."
            ]
          },
          "psbt": {
            "type": "string",
            "description": [
              "The PSBT representing the unsigned transaction."
            ]
          }
        }
      },
      "errors": [
        "On failure, an error is reported and the withdrawal transaction is not created.",
        "",
        "- -1: Catchall nonspecific error.",
        "- 301: There are not enough funds in the internal wallet (including fees) to create the transaction.",
        "- 302: The dust limit is not met.",
        "- 313: The `min-emergency-msat` reserve not be preserved (and we have anchor channels)."
      ],
      "author": [
        "Felix [fixone@gmail.com](mailto:fixone@gmail.com) is mainly responsible."
      ],
      "see_also": [
        "lightning-listfunds(7)",
        "lightning-fundchannel(7)",
        "lightning-newaddr(7)",
        "lightning-txprepare(7)",
        "lightning-feerates(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:withdraw#1",
            "method": "withdraw",
            "params": {
              "destination": "bcrt1qcqqv0101010101010101010101010101010101",
              "satoshi": 555555
            }
          },
          "response": {
            "tx": "020000000001wthdrw91000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000910009100091000",
            "txid": "txidwithdraw2191000910009100091000910009100091000910009100091000",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000911000"
          }
        },
        {
          "request": {
            "id": "example:withdraw#2",
            "method": "withdraw",
            "params": {
              "destination": "bcrt1phtprcvhz02020202020202020202020202020202020202020202020202",
              "satoshi": "all",
              "feerate": "20000perkb",
              "minconf": 0,
              "utxos": [
                "utxo020202020202020202020202020202020202020202020202020202020202:1"
              ]
            }
          },
          "response": {
            "tx": "020000000002wthdrw92000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000920009200092000",
            "txid": "txidwithdraw2292000920009200092000920009200092000920009200092000",
            "psbt": "cHNidP8BAgQCAAAAAQMEbwAAAAEEAQpsbt922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000922000"
          }
        }
      ]
    },
    "xpay.json": {
      "$schema": "../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "rpc": "xpay",
      "title": "Command for sending a payment for an invoice",
      "description": [
        "The **xpay** RPC command attempts to find routes to the given destination, and send the funds it asks for.",
        "",
        "This plugin is simpler and more sophisticated than the older 'pay' plugin, but does not have all the same features."
      ],
      "request": {
        "required": [
          "invstring"
        ],
        "properties": {
          "invstring": {
            "type": "string",
            "description": [
              "bolt11 or bolt12 invoice, a bolt12 (non-recursive) offer or a BIP353 name.  If it's a bip353 name, an offer is fetched with `fetchbip353` if available.  If it's an offer, the invoice is fetched using `fetchinvoice` automatically."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Only possible for a bolt11 invoice which does not have an amount (in which case, it's compulsory).  *amount_msat* is in millisatoshi precision; it can be a whole number, or a whole number with suffix *msat* or *sat*, or a three decimal point number with suffix *sat*, or an 1 to 11 decimal point number suffixed by *btc*."
            ]
          },
          "maxfee": {
            "type": "msat",
            "description": [
              "*maxfee* creates an absolute limit on what fee we will pay."
            ],
            "default": "5000msat, or 1% (whatever is greater)"
          },
          "layers": {
            "type": "array",
            "description": [
              "These are askrene layers to apply in addition to xpay's own: these can alter the topology or provide additional information on the lightning network.  See askrene-create-layer."
            ],
            "items": {
              "type": "string",
              "description": [
                "name of an existing layer"
              ]
            }
          },
          "retry_for": {
            "type": "u32",
            "description": [
              "Until *retry_for* seconds passes, the command will keep finding routes and retrying the payment."
            ],
            "default": "60 seconds"
          },
          "partial_msat": {
            "type": "msat",
            "description": [
              "Explicitly state that you are only paying some part of the invoice.  Presumably someone else is paying the rest (otherwise the payment will time out at the recipient)."
            ]
          },
          "maxdelay": {
            "type": "u32",
            "added": "v25.02",
            "description": [
              "A payment may be delayed for up to `maxdelay` blocks by another node; clients should be prepared for this worst case."
            ],
            "default": "2016"
          },
          "payer_note": {
            "type": "string",
            "added": "v26.04",
            "description": [
              "A message that a payer is willing to send to a payee within an invoice request."
            ]
          }
        }
      },
      "response": {
        "required": [
          "payment_preimage",
          "failed_parts",
          "successful_parts",
          "amount_msat",
          "amount_sent_msat"
        ],
        "properties": {
          "payment_preimage": {
            "type": "secret",
            "description": [
              "The proof of payment: SHA256 of this **payment_hash**."
            ]
          },
          "failed_parts": {
            "type": "u64",
            "description": [
              "How many separate payment parts failed."
            ]
          },
          "successful_parts": {
            "type": "u64",
            "description": [
              "How many separate payment parts succeeded (or are anticipated to succeed).  This will be at least one."
            ]
          },
          "amount_msat": {
            "type": "msat",
            "description": [
              "Amount the recipient received."
            ]
          },
          "amount_sent_msat": {
            "type": "msat",
            "description": [
              "Total amount we sent (including fees)."
            ]
          }
        }
      },
      "errors": [
        "The following error codes may occur:",
        "",
        "- -1: Catchall nonspecific error.",
        "- 203: Permanent failure from destination (e.g. it said it didn't recognize invoice)",
        "- 205: Couldn't find, or find a way to, the destination.",
        "- 207: Invoice has expired.",
        "- 219: Invoice has already been paid.",
        "- 209: Other payment error."
      ],
      "author": [
        "Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
      ],
      "see_also": [
        "lightning-pay(7)",
        "lightning-decode(7)"
      ],
      "resources": [
        "Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
      ],
      "examples": [
        {
          "request": {
            "id": "example:xpay#1",
            "method": "xpay",
            "params": [
              "lnbcrt100n1pnt2bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000bolt11invl040100000000"
            ]
          },
          "response": {
            "payment_preimage": "paymentpreimgxp1010101010101010101010101010101010101010101010101",
            "amount_msat": 10000,
            "amount_sent_msat": 10002,
            "failed_parts": 0,
            "successful_parts": 1
          }
        },
        {
          "request": {
            "id": "example:xpay#2",
            "method": "xpay",
            "params": {
              "invstring": "lni1qqg0qe03030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303",
              "payer_note": "Coffee payment"
            }
          },
          "response": {
            "payment_preimage": "paymentpreimgxp2020202020202020202020202020202020202020202020202",
            "amount_msat": 1000,
            "amount_sent_msat": 1000,
            "failed_parts": 0,
            "successful_parts": 1
          }
        }
      ]
    }
  },
  "notifications": {
    "block_added.json": {
      "$schema": "../../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "notification": "block_added",
      "title": "Notification that a block has been added to the blockchain",
      "description": [
        "The **block_added** notification is sent whenever the node receives a new block from the blockchain."
      ],
      "added": "v22.11",
      "request": {},
      "response": {
        "required": [
          "hash",
          "height"
        ],
        "properties": {
          "hash": {
            "type": "hash",
            "description": [
              "The hash of the block."
            ],
            "added": "v22.11"
          },
          "height": {
            "type": "u32",
            "description": [
              "The total block height."
            ],
            "added": "v22.11"
          }
        }
      }
    },
    "channel_open_failed.json": {
      "$schema": "../../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "notification": "channel_open_failed",
      "title": "Notification that the channel open request failed",
      "description": [
        "The **channel_open_failed** notification is sent whenever the channel opening request is failed."
      ],
      "added": "pre-v0.10.1",
      "request": {},
      "response": {
        "required": [
          "channel_id"
        ],
        "properties": {
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel id of the channel."
            ],
            "added": "pre-v0.10.1"
          }
        }
      }
    },
    "channel_opened.json": {
      "$schema": "../../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "notification": "channel_opened",
      "title": "Notification for channel opening",
      "description": [
        "The **channel_opened** notification is sent whenever the channel opened successfully."
      ],
      "added": "pre-v0.10.1",
      "request": {},
      "response": {
        "required": [
          "id",
          "funding_msat",
          "funding_txid",
          "channel_ready"
        ],
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "The id of the peer which opened the channel"
            ],
            "added": "pre-v0.10.1"
          },
          "funding_msat": {
            "type": "msat",
            "description": [
              "The amount of the funding transaction"
            ],
            "added": "pre-v0.10.1"
          },
          "funding_txid": {
            "type": "txid",
            "description": [
              "The transaction id of the funding transaction"
            ],
            "added": "pre-v0.10.1"
          },
          "channel_ready": {
            "type": "boolean",
            "description": [
              "true if the channel is ready"
            ],
            "added": "pre-v0.10.1"
          }
        }
      }
    },
    "channel_state_changed.json": {
      "$schema": "../../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "notification": "channel_state_changed",
      "title": "Notification for channel state change",
      "description": [
        "The **channel_state_changed** informs whenever the state of the channel has been updated."
      ],
      "added": "pre-v0.10.1",
      "request": {},
      "response": {
        "required": [
          "peer_id",
          "channel_id",
          "timestamp",
          "new_state",
          "cause"
        ],
        "properties": {
          "peer_id": {
            "type": "pubkey",
            "description": [
              "The peer id of the channel."
            ],
            "added": "pre-v0.10.1"
          },
          "channel_id": {
            "type": "hash",
            "description": [
              "The channel id of the channel."
            ],
            "added": "pre-v0.10.1"
          },
          "short_channel_id": {
            "type": "short_channel_id",
            "description": [
              "The short channel id of the channel. If the channel is not yet confirmed, this field will be null."
            ],
            "added": "pre-v0.10.1"
          },
          "timestamp": {
            "type": "string",
            "description": [
              "The timestamp of the state change."
            ],
            "added": "pre-v0.10.1"
          },
          "old_state": {
            "type": "string",
            "enum": [
              "OPENINGD",
              "CHANNELD_AWAITING_LOCKIN",
              "CHANNELD_NORMAL",
              "CHANNELD_SHUTTING_DOWN",
              "CLOSINGD_SIGEXCHANGE",
              "CLOSINGD_COMPLETE",
              "AWAITING_UNILATERAL",
              "FUNDING_SPEND_SEEN",
              "ONCHAIN",
              "DUALOPEND_OPEN_INIT",
              "DUALOPEND_AWAITING_LOCKIN",
              "CHANNELD_AWAITING_SPLICE",
              "DUALOPEND_OPEN_COMMITTED",
              "DUALOPEND_OPEN_COMMIT_READY"
            ],
            "description": [
              "The channel state, in particular \"CHANNELD_NORMAL\" and \"CHANNELD_AWAITING_SPLICE\" mean the channel can be used normally.",
              "The deprecated value 'unknown' is also present for new channels: after v26.03 this field will be omitted instead."
            ],
            "added": "pre-v0.10.1"
          },
          "new_state": {
            "type": "string",
            "enum": [
              "OPENINGD",
              "CHANNELD_AWAITING_LOCKIN",
              "CHANNELD_NORMAL",
              "CHANNELD_SHUTTING_DOWN",
              "CLOSINGD_SIGEXCHANGE",
              "CLOSINGD_COMPLETE",
              "AWAITING_UNILATERAL",
              "FUNDING_SPEND_SEEN",
              "ONCHAIN",
              "DUALOPEND_OPEN_INIT",
              "DUALOPEND_AWAITING_LOCKIN",
              "CHANNELD_AWAITING_SPLICE",
              "DUALOPEND_OPEN_COMMITTED",
              "DUALOPEND_OPEN_COMMIT_READY",
              "CLOSED"
            ],
            "description": [
              "The channel state, in particular \"CHANNELD_NORMAL\" and \"CHANNELD_AWAITING_SPLICE\" mean the channel can be used normally",
              "Note: *CLOSED* state was only added in v25.12."
            ],
            "added": "pre-v0.10.1"
          },
          "cause": {
            "type": "string",
            "enum": [
              "unknown",
              "local",
              "user",
              "remote",
              "protocol",
              "onchain"
            ],
            "description": [
              "The cause of the state change."
            ],
            "added": "pre-v0.10.1"
          },
          "message": {
            "type": "string",
            "description": [
              "The state change message."
            ],
            "added": "pre-v0.10.1"
          }
        }
      }
    },
    "connect.json": {
      "$schema": "../../rpc-schema-draft.json",
      "type": "object",
      "notification": "connect",
      "title": "Notification for connection with a peer",
      "description": [
        "The **connect** informs whenever the node is connected to a peer."
      ],
      "additionalProperties": false,
      "added": "pre-v0.10.1",
      "request": {},
      "response": {
        "required": [
          "id",
          "direction",
          "address"
        ],
        "properties": {
          "id": {
            "type": "pubkey",
            "description": [
              "The id of the peer which sent the custom message"
            ],
            "added": "pre-v0.10.1"
          },
          "direction": {
            "type": "string",
            "enum": [
              "in",
              "out"
            ],
            "description": [
              "Direction of the connection"
            ],
            "added": "pre-v0.10.1"
          },
          "address": {
            "type": "object",
            "description": [
              "Address information (mainly useful if **direction** is *out*)"
            ],
            "added": "pre-v0.10.1",
            "additionalProperties": true,
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "type": "string",
                "added": "pre-v0.10.1",
                "enum": [
                  "local socket",
                  "ipv4",
                  "ipv6",
                  "torv2",
                  "torv3",
                  "websocket"
                ],
                "description": [
                  "Type of connection (*torv2*/*torv3* only if **direction** is *out*)"
                ]
              }
            },
            "allOf": [
              {
                "if": {
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "local socket"
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "socket"
                  ],
                  "properties": {
                    "type": {},
                    "socket": {
                      "type": "string",
                      "added": "pre-v0.10.1",
                      "description": [
                        "Socket filename"
                      ]
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "ipv4",
                        "ipv6",
                        "torv2",
                        "torv3"
                      ]
                    }
                  }
                },
                "then": {
                  "additionalProperties": false,
                  "required": [
                    "address",
                    "port"
                  ],
                  "properties": {
                    "type": {},
                    "address": {
                      "type": "string",
                      "added": "pre-v0.10.1",
                      "description": [
                        "Address in expected format for **type**"
                      ]
                    },
                    "port": {
                      "type": "u16",
                      "added": "pre-v0.10.1",
                      "description": [
                        "Port number"
                      ]
                    }
                  }
                }
              }
            ]
          }
        }
      }
    },
    "custommsg.json": {
      "$schema": "../../rpc-schema-draft.json",
      "type": "object",
      "additionalProperties": false,
      "notification": "custommsg",
      "title": "Notification for custom messages",
      "description": [
        "The **custommsg** notifies whenever the node receives a custom message from a peer."
      ],
      "added": "v24.02",
      "request": {},
      "response": {
        "required": [
          "peer_id",
          "payload"
        ],
        "properties": {
          "peer_id": {
            "type": "pubkey",
            "description": [
              "The id of the peer which sent the custom message"
            ],
            "added": "v24.02"
          },
          "payload": {
            "type": "hex",
            "description": [
              "The hex-encoded payload. The first 2 bytes represent the BOLT-8 message type followed by the message content"
            ],
            "added": "v24.02"
          }
        }
      }
    }
  }
}