Invoice encoding and parsing
authorJeffrey Czyz <jkczyz@gmail.com>
Mon, 12 Sep 2022 14:30:06 +0000 (09:30 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Fri, 20 Jan 2023 22:04:37 +0000 (16:04 -0600)
commite1aa18aed800d575da555df1d84a468cd585f3f3
treedeb6f797acc5a06d190789846f37b7578fdc725e
parent243f4487017f43712ebb1aa76806329f7e147593
Invoice encoding and parsing

Define an interface for BOLT 12 `invoice` messages. The underlying
format consists of the original bytes and the parsed contents.

The bytes are later needed for serialization. This is because it must
mirror all the `offer` and `invoice_request` TLV records, including
unknown ones, which aren't represented in the contents.

Invoices may be created for an Offer (from an InvoiceRequest) or for a
Refund. The primary difference is how the signing pubkey is given -- by
the writer of the offer or the reader of the refund.
lightning/src/offers/invoice.rs [new file with mode: 0644]
lightning/src/offers/invoice_request.rs
lightning/src/offers/mod.rs
lightning/src/offers/offer.rs
lightning/src/offers/parse.rs
lightning/src/offers/refund.rs