From 975d2bbcad940638e5510b49adf1003260a0a437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Gawe=C5=82?= Date: Sun, 19 Nov 2023 20:17:48 +0100 Subject: [PATCH] Create 21.md --- 21.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 21.md diff --git a/21.md b/21.md new file mode 100644 index 0000000..8bdd25f --- /dev/null +++ b/21.md @@ -0,0 +1,40 @@ +LUD-21: Expiry in `payRequest`. +================================= + +`authors: rav3r, jackeveritt` + +--- + +## Support for LNURL-pay expiry + +This allows for a `CLIENT` to pass a custom expiry property to a `SERVICE` that accepts it. This will enable clients to request time-sensitive invoices that can be used for example by escrow systems. + +This is completely additional/ad-hoc, so current implementations are not affected by this. Any services and clients that wish to support it do need to add some more business logic. + +### Service-side + +`SERVICE` must alter its JSON response to the first callback to include a `minExpiry`/`maxExpiry` fields, as follows: + +```diff + { + "callback": string, + "maxSendable": number, + "minSendable": number, + "metadata": string, + "commentAllowed": number, ++ "minExpiry": number, ++ "maxExpiry": number, + "tag": "payRequest" + } +``` + +The value of `minExpiry`/`maxExpiry` must be the inclusive range of seconds accepted for the `expiry` query parameter on subsequent callback. + +### Client-side + +`CLIENT` can include the expiry in its second callback to `SERVICE`: + +```diff +- amount= ++ amount=&expiry= +```