2024-01-15 13:35:14 -08:00
{
"$schema" : "../rpc-schema-draft.json" ,
"type" : "object" ,
"rpc" : "sendonion" ,
"title" : "Send a payment with a custom onion packet" ,
"description" : [
"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"
] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : false ,
2024-01-15 13:35:14 -08:00
"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" : [
doc: fix up missing fields from schemas.
This allows the next patch (which makes the schemas stricter) to not
break our tests.
We add some missing fields (including dev fields, but they're empty and hidden),
and add a few minor clarifications and a spelling fix. Most of these are new
schemas for this release, so no mention in Changelog.
Here is the difference in the man pages:
--- doc/lightning-askrene-inform-channel.7.md.old 2024-10-29 17:33:07.714521584 +1030
+++ doc/lightning-askrene-inform-channel.7.md 2024-10-29 17:42:37.434280109 +1030
@@ -24,6 +24,8 @@
- **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction
+- **layer** (string): The name of the layer to apply this change to.
+- **timestamp** (u64): The UNIX timestamp when this constraint was created.
- **maximum\_msat** (msat, optional): The maximum value which this channel could pass.
--- doc/lightning-askrene-listlayers.7.md.old 2024-10-29 17:33:07.716521571 +1030
+++ doc/lightning-askrene-listlayers.7.md 2024-10-29 17:42:37.424280316 +1030
@@ -29,13 +29,16 @@
- **channel\_updates** (array of objects):
+ - **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction this update applies to.
+ - **enabled** (boolean, optional): True if this can be used, false otherwise.
- **htlc\_minimum\_msat** (msat, optional): The minimum value allowed in this direction.
- **htlc\_maximum\_msat** (msat, optional): The maximum value allowed in this direction.
- **fee\_base\_msat** (msat, optional): The base fee to apply to use the channel in this direction.
- **fee\_proportional\_millionths** (u32, optional): The proportional fee (in parts per million) to apply to use the channel in this direction.
- - **delay** (u16, optional): The CLTV delay required for this direction.
+ - **cltv\_expiry\_delta** (u16, optional): The CLTV delay required for this direction.
- **constraints** (array of objects):
- **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction
+ - **timestamp** (u64, optional): The UNIX timestamp when this constraint was created.
- **maximum\_msat** (msat, optional): The maximum value which this channel could pass.
--- doc/lightning-askrene-listreservations.7.md.old 2024-10-29 17:33:07.719521550 +1030
+++ doc/lightning-askrene-listreservations.7.md 2024-10-29 17:42:37.428280233 +1030
@@ -16,7 +16,7 @@
-On success, an object containing **layers** is returned. It is an array of objects, where each object contains:
+On success, an object containing **reservations** is returned. It is an array of objects, where each object contains:
--- doc/lightning-autoclean-status.7.md.old 2024-10-29 17:33:07.732521462 +1030
+++ doc/lightning-autoclean-status.7.md 2024-10-29 17:42:37.441279965 +1030
@@ -9,7 +9,7 @@
-The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem.
+The **autoclean-status** RPC command tells you about the status of the autoclean plugin, optionally for only one subsystem.
--- doc/lightning-renepay.7.md.old 2024-10-29 17:33:07.927520140 +1030
+++ doc/lightning-renepay.7.md 2024-10-29 17:42:37.996268504 +1030
@@ -58,6 +58,9 @@
- **status** (string) (one of "complete", "pending", "failed"): Status of payment.
+- **bolt11** (string, optional): The bolt11 invoice paid. *(added v23.08)*
+- **bolt12** (string, optional): The bolt12 invoice paid. *(added v23.08)*
+- **groupid** (u64, optional): The groupid used for these payment parts (as can be seen in listsendpays) *(added v23.08)*
- **destination** (pubkey, optional): The final destination of the payment.
--- doc/lightning-sendonion.7.md.old 2024-10-29 17:33:07.937520073 +1030
+++ doc/lightning-sendonion.7.md 2024-10-29 17:42:37.957269309 +1030
@@ -22,7 +22,7 @@
-- **first\_hop** (object): 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*.:
+- **first\_hop** (object): 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).:
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: `renepay` return fields documented in schema (`bolt11`, `bolt12` and `groupid`)
2024-10-29 17:50:40 +10:30
"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)."
2024-01-15 13:35:14 -08:00
] ,
"required" : [
"id" ,
"amount_msat" ,
"delay"
] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : true ,
2024-01-15 13:35:14 -08:00
"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."
]
}
}
} ,
"response" : {
"required" : [
"created_index" ,
"id" ,
"payment_hash" ,
"status" ,
"created_at" ,
"amount_sent_msat"
] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : true ,
2024-01-15 13:35:14 -08:00
"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" : [
2024-11-18 15:10:55 +10:30
"The bolt12 string (if supplied)."
2024-01-15 13:35:14 -08:00
]
} ,
"partid" : {
"type" : "u64" ,
"description" : [
"The partid (if supplied) to sendonion/sendpay."
]
}
} ,
"allOf" : [
{
"if" : {
2024-10-30 09:38:42 +10:30
"additionalProperties" : true ,
2024-01-15 13:35:14 -08:00
"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" : {
2024-10-30 09:38:42 +10:30
"additionalProperties" : true ,
2024-01-15 13:35:14 -08:00
"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"
] ,
2024-06-20 14:57:02 -07:00
"author" : [
"Christian Decker <<decker.christian@gmail.com>> is mainly responsible."
] ,
"see_also" : [
"lightning-createonion(7)" ,
"lightning-sendpay(7)" ,
"lightning-listsendpays(7)"
] ,
"resources" : [
"Main web site: <https://github.com/ElementsProject/lightning>" ,
"" ,
"[bolt04]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md"
] ,
"examples" : [
2024-01-15 13:35:14 -08:00
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:sendonion#1" ,
"method" : "sendonion" ,
"params" : {
2024-08-09 22:44:53 -07:00
"onion" : "onion10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" ,
2024-03-27 18:45:18 -07:00
"first_hop" : {
2024-08-09 22:44:53 -07:00
"id" : "nodeid020202020202020202020202020202020202020202020202020202020202" ,
2024-07-18 00:28:22 -07:00
"channel" : "109x1x1" ,
2024-03-27 18:45:18 -07:00
"direction" : 1 ,
"amount_msat" : 1002 ,
"delay" : 21 ,
"style" : "tlv"
} ,
2024-08-09 22:44:53 -07:00
"payment_hash" : "assocdata0010101010101010101010101010101010101010101010101010101"
2024-03-27 18:45:18 -07:00
}
} ,
"response" : {
"message" : "Monitor status with listpays or waitsendpay" ,
2024-08-09 22:44:53 -07:00
"created_index" : 10 ,
"id" : 10 ,
"payment_hash" : "assocdata0010101010101010101010101010101010101010101010101010101" ,
2024-03-27 18:45:18 -07:00
"groupid" : 1 ,
"amount_sent_msat" : 1002 ,
2024-08-09 22:44:53 -07:00
"created_at" : 1738000000 ,
2024-03-27 18:45:18 -07:00
"status" : "pending"
2024-01-15 13:35:14 -08:00
}
}
]
}