Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions 21.md
Original file line number Diff line number Diff line change
@@ -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
- <callback><?|&>amount=<milliSatoshi>
+ <callback><?|&>amount=<milliSatoshi>&expiry=<seconds>
```