<p>I think it is not explicitly specified. But <a href="https://github.com/ElementsProject/lightning/blob/01e5f1886e31816e652f417a1ff789a26aaeec3b/common/bolt11.h#L59" rel="nofollow noreferrer">c-lightning uses for example an unsigned int 64</a>. Overall the expiry is obviously created to allow nodes to not store payment preimages for requested invoices for too much time. So therefor it makes sense to use values that don't extend too much actual time. I don't see why an invoice should for example be valid for a year. But technically it is certainly possible.</p>

CC BY-SA 4.0
2022-06-21T11:25:36.377Z
Thank you for clarifying. At the moment my solution is to mark the payment as Failed if it has been in flight for more than 7 days and I do not have the payment request and cannot find the expiry time in any other way. ofc. if I have the expiry time I simply use that.
Ole Henrik Skogstrøm
CC BY-SA 4.0
2022-06-21T11:26:48.033Z
Forgot the question in the comment above. Do you think 7 days is enough to safely assume that they payment has failed? or perhaps could I assume it earlier?
Ole Henrik Skogstrøm
CC BY-SA 4.0
2022-06-21T13:34:05.160Z
That seems to be a totally different beast! For example the htlc could have been arrived at the destination and there is a delay in settlement. Also I think some implementations ignored the expiry and still released the preimage if they could
Rene Pickhardt
CC BY-SA 4.0
2022-06-21T14:51:24.430Z
That sounds dangerous, can't that lead to a lot of trouble? I guess as long as no nodes on the route fail the payment and your node is still up, then an invoice can just remain until the HTLC has to fail to prevent loss of funds? So the limit would be the cltv_expiry?
Ole Henrik Skogstrøm
CC BY-SA 4.0
2022-06-22T12:58:22.210Z
Yes absolutely. And when you say cltv expiry i hope you meant the one of the htlc that you offered
Rene Pickhardt
CC BY-SA 4.0
2022-06-21T10:24:31.437Z
2022-06-21T10:24:31.437Z
Rene Pickhardt
<p>Is there an absolute limit the payment request expiry?</p>
<p>I can't find this in the <a href="https://github.com/lightning/bolts/blob/master/11-payment-encoding.md#tagged-fields" rel="nofollow noreferrer">BOLTs</a>, but maybe this is up to the implementations?</p>

<lightning-network><invoices>
Is there an absolute limit the payment request expiry?
Ole Henrik Skogstrøm
# Is there an absolute limit the payment request expiry?

(Asked by: username_0 on 2022-06-21)

Is there an absolute limit the payment request expiry?

I can't find this in the [BOLTs](https://github.com/lightning/bolts/blob/master/11-payment-encoding.md#tagged-fields), but maybe this is up to the implementations?

**Tags:** lightning-network, invoices


---

## 1 answers

### Answer by username_1 on 2022-06-21. Score: 2 | Accepted answer

I think it is not explicitly specified. But [c-lightning uses for example an unsigned int 64](https://github.com/ElementsProject/lightning/blob/01e5f1886e31816e652f417a1ff789a26aaeec3b/common/bolt11.h#L59). Overall the expiry is obviously created to allow nodes to not store payment preimages for requested invoices for too much time. So therefor it makes sense to use values that don't extend too much actual time. I don't see why an invoice should for example be valid for a year. But technically it is certainly possible.

> **Comments:**
> **username_0**: Thank you for clarifying. At the moment my solution is to mark the payment as Failed if it has been in flight for more than 7 days and I do not have the payment request and cannot find the expiry time in any other way. ofc. if I have the expiry time I simply use that.  
> **username_0**: Forgot the question in the comment above. Do you think 7 days is enough to safely assume that they payment has failed? or perhaps could I assume it earlier?  
> **username_1**: That seems to be a totally different beast! For example the htlc could have been arrived at the destination and there is a delay in settlement. Also I think some implementations ignored the expiry and still released the preimage if they could  
> **username_0**: That sounds dangerous, can't that lead to a lot of trouble? I guess as long as no nodes on the route fail the payment and your node is still up, then an invoice can just remain until the HTLC has to fail to prevent loss of funds? So the limit would be the cltv_expiry?  
> **username_1**: Yes absolutely. And when you say cltv expiry i hope you meant the one of the htlc that you offered  

---

