-
Notifications
You must be signed in to change notification settings - Fork 358
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
Disallow user-provided payer_signing_pubkey
#3264
base: main
Are you sure you want to change the base?
Disallow user-provided payer_signing_pubkey
#3264
Commits on Sep 16, 2024
-
Rename Offer::signing_pubkey to Offer::issuer_signing_pubkey
The spec was recently changed to use offer_issuer_id instead of offer_node_id. LDK always used signing_pubkey to avoid confusion with a node_id. Rename it to issuer_signing_pubkey now as InvoiceRequest and Bolt12Invoice will have similarly named methods in upcoming commits.
Configuration menu - View commit details
-
Copy full SHA for df58f26 - Browse repository at this point
Copy the full SHA df58f26View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7351270 - Browse repository at this point
Copy the full SHA 7351270View commit details -
Add issuer_signing_pubkey to Bolt12Invoice
Useful for determining if the signing_pubkey is the issuer_signing_pubkey or is from a blinded path.
Configuration menu - View commit details
-
Copy full SHA for a466f2e - Browse repository at this point
Copy the full SHA a466f2eView commit details -
Configuration menu - View commit details
-
Copy full SHA for cfe8430 - Browse repository at this point
Copy the full SHA cfe8430View commit details -
Configuration menu - View commit details
-
Copy full SHA for de29295 - Browse repository at this point
Copy the full SHA de29295View commit details -
Rename InvoiceRequest::payer_id
For consistency with Offer::issuer_signing_pubkey, rename InvoiceRequest::payer_id to use "signing_pubkey" instead of "id".
Configuration menu - View commit details
-
Copy full SHA for dd8f744 - Browse repository at this point
Copy the full SHA dd8f744View commit details -
For consistency with Offer::issuer_signing_pubkey, rename Refund::payer_id to use "signing_pubkey" instead of "id".
Configuration menu - View commit details
-
Copy full SHA for e11025f - Browse repository at this point
Copy the full SHA e11025fView commit details -
Configuration menu - View commit details
-
Copy full SHA for acd36a8 - Browse repository at this point
Copy the full SHA acd36a8View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 6982edb - Browse repository at this point
Copy the full SHA 6982edbView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 6cf494f - Browse repository at this point
Copy the full SHA 6cf494fView commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 0eee6ea - Browse repository at this point
Copy the full SHA 0eee6eaView commit details -
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 th
Configuration menu - View commit details
-
Copy full SHA for 44c50d6 - Browse repository at this point
Copy the full SHA 44c50d6View commit details -
Pass bytes instead of TlvStream to verify
Passing bytes directly to InvoiceContents::verify improves readability.
Configuration menu - View commit details
-
Copy full SHA for 63ce591 - Browse repository at this point
Copy the full SHA 63ce591View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 5726c08 - Browse repository at this point
Copy the full SHA 5726c08View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for dd1db79 - Browse repository at this point
Copy the full SHA dd1db79View commit details -
Configuration menu - View commit details
-
Copy full SHA for f0631db - Browse repository at this point
Copy the full SHA f0631dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 51a7994 - Browse repository at this point
Copy the full SHA 51a7994View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 49fc178 - Browse repository at this point
Copy the full SHA 49fc178View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for cc749b8 - Browse repository at this point
Copy the full SHA cc749b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad638a5 - Browse repository at this point
Copy the full SHA ad638a5View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 575433d - Browse repository at this point
Copy the full SHA 575433dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1fc4d51 - Browse repository at this point
Copy the full SHA 1fc4d51View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a89807 - Browse repository at this point
Copy the full SHA 7a89807View commit details -
Disallow user-provided payer_signing_pubkey
When creating an InvoiceRequests, users may choose to either use a transient signing pubkey generated by LDK or provide a static one. Disallow the latter as it allows users to reuse the same pubkey, which results in poor sender privacy.
Configuration menu - View commit details
-
Copy full SHA for ad39980 - Browse repository at this point
Copy the full SHA ad39980View commit details -
Remove PayerSigningPubkeyStrategy
Now that InvoiceRequest::payer_signing_pubkey is always a derived pubkey, there is no longer a need for PayerSigningPubkeyStrategy.
Configuration menu - View commit details
-
Copy full SHA for cdc21f1 - Browse repository at this point
Copy the full SHA cdc21f1View commit details -
Remove NodeSigner::sign_bolt12_invoice_request
Now that invoice requests are signed using transient keys only, remove the corresponding signing method from NodeSigner since it is never used.
Configuration menu - View commit details
-
Copy full SHA for 4baba94 - Browse repository at this point
Copy the full SHA 4baba94View commit details