Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion 12-offer-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ A reader of an offer:
- if the node does not accept bitcoin invoices:
- MUST NOT respond to the offer
- otherwise: (`offer_chains` is set):
- if the node does not accept invoices for any of the `chains`:
- if the node does not accept invoices for at least one of the `chains`:
- MUST NOT respond to the offer
- if `offer_amount` is set and `offer_description` is not set:
- MUST NOT respond to the offer.
Expand Down Expand Up @@ -348,6 +348,12 @@ painful to have to special-case the "only one left" offer generation.

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.

An empty `offer_chains` (present but with zero entries) is explicitly invalid
because it would make invoice requests impossible. The payer cannot set
`invreq_chain` to "one of `offer_chains`" when there are no chains listed.
Rejecting such offers early provides clear feedback rather than leaving
implementations to fail at the invoice request stage.

# Invoice Requests

Invoice Requests are a request for an invoice; the human-readable prefix for
Expand Down
5 changes: 5 additions & 0 deletions bolt12/offers-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -582,5 +582,10 @@
"description": "Second offer_path is empty",
"valid": false,
"bolt12": "lno1pgx9getnwss8vetrw3hhyucsespjgef743p5fzqq9nqxh0ah7y87rzv3ud0eleps9kl2d5348hq2k8qzqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgqpqqqqqqqqqqqqqqqqqqqqqqqqqqqzqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqqzq3zyg3zyg3zygszqqqqyqqqqsqqvpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqsq"
},
{
"description": "offer_chains with zero entries",
"valid": false,
"bolt12": "lno1qgqpvggrt0j7j3uzp9n549hxpu0sxlmpwe2ql5qplgwkg628wrzk5acfcskq"
}
]