Skip to content

Commit f150782

Browse files
committed
fixup! BOLT 12: offers, sixth draft
Make offer_description optional if there's no amount; this is the common "tip" case. Note that this implies a minimal offer is simply a bech32 encoding of the offer_node_id field, or "lno1" + bech32(0x2242<node_id>). This might become normalized as the "default offer" to which you can throw sats to a node directly?
1 parent be3ab13 commit f150782

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

12-offer-encoding.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,6 @@ The human-readable prefix for offers is `lno`.
228228

229229
A writer of an offer:
230230
- MUST NOT set any tlv fields greater or equal to 80, or tlv field 0.
231-
- MUST set `offer_description` to a complete description of the purpose
232-
of the payment.
233231
- if the chain for the invoice is not solely bitcoin:
234232
- MUST specify `offer_chains` the offer is valid for.
235233
- otherwise:
@@ -243,9 +241,12 @@ A writer of an offer:
243241
- MUST specify `offer_currency` `iso4217` as an ISO 4712 three-letter code.
244242
- MUST specify `offer_amount` in the currency unit adjusted by the ISO 4712
245243
exponent (e.g. USD cents).
244+
- MUST set `offer_description` to a complete description of the purpose
245+
of the payment.
246246
- otherwise:
247247
- MUST NOT set `offer_amount`
248248
- MUST NOT set `offer_currency`
249+
- MAY set `offer_description`
249250
- MAY set `offer_metadata` for its own use.
250251
- if it supports bolt12 offer features:
251252
- MUST set `offer_features`.`features` to the bitmap of bolt12 features.
@@ -291,7 +292,7 @@ A reader of an offer:
291292
- otherwise: (`offer_chains` is set):
292293
- if the node does not accept invoices for any of the `chains`:
293294
- MUST NOT respond to the offer
294-
- if `offer_description` is not set:
295+
- if `offer_amount` is set and `offer_description` is not set:
295296
- MUST NOT respond to the offer.
296297
- if neither `offer_node_id` nor `offer_paths` are set:
297298
- MUST NOT respond to the offer.
@@ -332,6 +333,8 @@ Because `offer_amount` can be in a different currency (using the `offer_currency
332333
useful in a system which bases it on available stock. It would be
333334
painful to have to special-case the "only one left" offer generation.
334335

336+
Offers can be used to simply send money without expecting anything in return (tips, kudos, donations, etc), which means the description field is optional (the `offer_issuer` field is very useful for this case!); if you are charging for something specific, the description is vital for the user to know what it was they paid for.
337+
335338
# Invoice Requests
336339

337340
Invoice Requests are a request for an invoice; the human-readable prefix for
@@ -449,7 +452,8 @@ The writer:
449452
- otherwise:
450453
- MUST NOT set `invreq_quantity`
451454
- otherwise (not responding to an offer):
452-
- MUST set (or not set) `offer_description`, `offer_absolute_expiry` and `offer_issuer` as it would for an offer.
455+
- MUST set `offer_description` to a complete description of the purpose of the payment.
456+
- MUST set (or not set) `offer_absolute_expiry` and `offer_issuer` as it would for an offer.
453457
- MUST set `invreq_payer_id` (as it would set `offer_node_id` for an offer).
454458
- MUST set `invreq_paths` as it would set (or not set) `offer_paths` for an offer.
455459
- MUST NOT include `signature`, `offer_metadata`, `offer_chains`, `offer_amount`, `offer_currency`, `offer_features`, `offer_quantity_max`, `offer_paths` or `offer_node_id`

0 commit comments

Comments
 (0)