Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental offer TLVs #3237

Merged
merged 19 commits into from
Nov 5, 2024

Commits on Oct 29, 2024

  1. Configuration menu
    Copy the full SHA
    bbdd873 View commit details
    Browse the repository at this point in the history
  2. Add optional lifetime to tlv_stream macro

    Using the tlv_stream macro without a type needing a reference results in
    a compilation error because of an unused lifetime parameter. To avoid
    this, add an optional lifetime parameter to the macro. This allows for
    experimental TLVs, which will be empty initially, and TLVs of entirely
    primitive types.
    jkczyz committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    a773001 View commit details
    Browse the repository at this point in the history
  3. Remove unneeded Eq and PartialEq derives

    TlvRecord has a few fields, but comparing only the record_bytes is
    sufficient for equality since the other fields are initialized from it.
    Remove the Eq and PartialEq derives as they compare these other fields.
    jkczyz committed Oct 29, 2024
    Configuration menu
    Copy the full SHA
    e23f89c View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. Separate bytes for experimental TLVs

    When constructing UnsignedInvoiceRequest or UnsignedBolt12Invoice, use a
    separate field for experimental TLV bytes. This allows for properly
    inserting the signature TLVs before the experimental TLVs when signing.
    jkczyz committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    771aa8e View commit details
    Browse the repository at this point in the history
  2. Function for iterating over Offer TLV records

    Add a utility function for iterating over Offer TLV records contained in
    any valid TLV stream bytes. Using a common function ensures that
    experimental TLV records are included once they are supported.
    jkczyz committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    1eb5baa View commit details
    Browse the repository at this point in the history
  3. Pass bytes instead of TlvStream to verify

    Passing bytes directly to InvoiceContents::verify improves readability
    as then a TlvStream for each TLV record range can be created from the
    bytes instead of needing to clone the TlvStream upfront. In an upcoming
    commit, the experimental TLV record range will utilize this.
    jkczyz committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    63c687f View commit details
    Browse the repository at this point in the history
  4. Include experimental TLV records when verifying

    Upcoming commits will allow parsing BOLT12 messages that include TLV
    records in the experimental range. Include these ranges when verifying
    messages since they will be included in the message bytes.
    jkczyz committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    bcc7c1d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    38e9457 View commit details
    Browse the repository at this point in the history
  6. Parse experimental offer TLV records

    The BOLT12 spec defines an experimental TLV range that are allowed in
    offer messages. Allow this range when parsing an offer and include those
    bytes in any invoice requests. Also include those bytes when computing
    an OfferId and verifying that an InvoiceRequest is for a valid Offer.
    jkczyz committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    e01e731 View commit details
    Browse the repository at this point in the history
  7. Test verification with experimental offer TLVs

    Offer metadata is generated from the offer TLVs and should included
    those in the experimental range. When verifying invoice request and
    invoice messages, these TLVs must be included. Similarly, OfferId
    construction should included these TLVs as well. Modify the BOLT12
    verification tests to cover these TLVs.
    jkczyz committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    6a708e2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    a728d1d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    62cddb7 View commit details
    Browse the repository at this point in the history
  10. Parse experimental invreq TLV records

    The BOLT12 spec defines an experimental TLV range that are allowed in
    invoice_request messages. Allow this range when parsing an invoice
    request and include those bytes in any invoice. Also include those bytes
    when verifying that a Bolt12Invoice is for a valid InvoiceRequest.
    jkczyz committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    5590bc2 View commit details
    Browse the repository at this point in the history
  11. Test verification with experimental invreq TLVs

    Payer metadata is generated from the invreq TLVs and should included
    those in the experimental range. When verifying invoice messages, these
    TLVs must be included. Modify the BOLT12 verification tests to cover
    them.
    jkczyz committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    e217c62 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9cf178f View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    22d30e6 View commit details
    Browse the repository at this point in the history
  14. Parse experimental invoice TLV records

    The BOLT12 spec defines an experimental TLV range that is allowed in
    offer and invoice_request messages. The remaining TLV-space is for
    experimental use in invoice messages. Allow this range when parsing an
    invoice and include it when signing one.
    jkczyz committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    8e279f7 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    7668240 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    169b260 View commit details
    Browse the repository at this point in the history