Skip to content

Commit d6dd3c5

Browse files
committed
Introduce recurrence fields in Offer (BOLT12 PoC)
This commit begins the introduction of BOLT12 recurrence support in LDK. It adds the core recurrence-related fields to `Offer`, enabling subscription-style and periodic payments as described in the draft spec. Since this is a PoC, the focus is on establishing the data model and documenting the intended semantics. Where the spec is ambiguous or redundant, accompanying comments note possible simplifications or improvements. This lays the foundation for the following commits, which will implement invoice-request parsing, payee-side validation, and period/paywindow handling. Spec reference: https://github.com/rustyrussell/bolts/blob/guilt/offers-recurrence/12-offer-encoding.md#tlv-fields-for-offers
1 parent fe5d942 commit d6dd3c5

File tree

6 files changed

+419
-0
lines changed

6 files changed

+419
-0
lines changed

lightning/src/offers/invoice.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,11 @@ mod tests {
19871987
issuer: None,
19881988
quantity_max: None,
19891989
issuer_id: Some(&recipient_pubkey()),
1990+
recurrence_compulsory: None,
1991+
recurrence_optional: None,
1992+
recurrence_base: None,
1993+
recurrence_paywindow: None,
1994+
recurrence_limit: None,
19901995
},
19911996
InvoiceRequestTlvStreamRef {
19921997
chain: None,
@@ -2090,6 +2095,11 @@ mod tests {
20902095
issuer: None,
20912096
quantity_max: None,
20922097
issuer_id: None,
2098+
recurrence_compulsory: None,
2099+
recurrence_optional: None,
2100+
recurrence_base: None,
2101+
recurrence_paywindow: None,
2102+
recurrence_limit: None,
20932103
},
20942104
InvoiceRequestTlvStreamRef {
20952105
chain: None,

lightning/src/offers/invoice_request.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,11 @@ mod tests {
16471647
issuer: None,
16481648
quantity_max: None,
16491649
issuer_id: Some(&recipient_pubkey()),
1650+
recurrence_compulsory: None,
1651+
recurrence_optional: None,
1652+
recurrence_base: None,
1653+
recurrence_paywindow: None,
1654+
recurrence_limit: None,
16501655
},
16511656
InvoiceRequestTlvStreamRef {
16521657
chain: None,

0 commit comments

Comments
 (0)