-
Notifications
You must be signed in to change notification settings - Fork 364
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
Stateless BOLT 12 message verification #1989
Stateless BOLT 12 message verification #1989
Commits on Apr 18, 2023
-
Common offers test_utils module
Move utility functions used across all offers modules into a common module. Avoids duplicating larger utilities such as payment_path across more than one module.
Configuration menu - View commit details
-
Copy full SHA for ce7a02d - Browse repository at this point
Copy the full SHA ce7a02dView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd426a0 - Browse repository at this point
Copy the full SHA fd426a0View commit details -
Add another ExpandedKey derivation for Offers
To support transient signing pubkeys and payer ids for Offers, add another key derivation to ExpandedKey. Also useful for constructing metadata for stateless message authentication.
Configuration menu - View commit details
-
Copy full SHA for 336fc02 - Browse repository at this point
Copy the full SHA 336fc02View commit details
Commits on Apr 20, 2023
-
Offer metadata and signing pubkey derivation
Add support for deriving a transient signing pubkey for each Offer from an ExpandedKey and a nonce. This facilitates recipient privacy by not tying any Offer to any other nor to the recipient's node id. Additionally, support stateless Offer verification by setting its metadata using an HMAC over the nonce and the remaining TLV records, which will be later verified when receiving an InvoiceRequest.
Configuration menu - View commit details
-
Copy full SHA for 1cad430 - Browse repository at this point
Copy the full SHA 1cad430View commit details -
Add an iterator that yields TlvRecords over a range of a TlvStream. Useful for verifying that, e.g., an InvoiceRequest was sent in response to an Offer constructed by the intended recipient.
Configuration menu - View commit details
-
Copy full SHA for b2e87ff - Browse repository at this point
Copy the full SHA b2e87ffView commit details -
Stateless verification of InvoiceRequest
Verify that an InvoiceRequest was produced from an Offer constructed by the recipient using the Offer metadata reflected in the InvoiceRequest. The Offer metadata consists of a 128-bit encrypted nonce and possibly a 256-bit HMAC over the nonce and Offer TLV records (excluding the signing pubkey) using an ExpandedKey. Thus, the HMAC can be reproduced from the offer bytes using the nonce and the original ExpandedKey, and then checked against the metadata. If metadata does not contain an HMAC, then the reproduced HMAC was used to form the signing keys, and thus can be checked against the signing pubkey.
Configuration menu - View commit details
-
Copy full SHA for dd2ccd2 - Browse repository at this point
Copy the full SHA dd2ccd2View commit details -
Refactor InvoiceRequestContents fields into a sub-struct
InvoiceRequestBuilder has a field containing InvoiceRequestContents. When deriving the payer_id from the remaining fields, a struct is needed without payer_id as it not optional. Refactor InvoiceRequestContents to have an inner struct without the payer_id such that InvoiceRequestBuilder can use it instead.
Configuration menu - View commit details
-
Copy full SHA for e15044b - Browse repository at this point
Copy the full SHA e15044bView commit details -
InvoiceRequest metadata and payer id derivation
Add support for deriving a transient payer id for each InvoiceRequest from an ExpandedKey and a nonce. This facilitates payer privacy by not tying any InvoiceRequest to any other nor to the payer's node id. Additionally, support stateless Invoice verification by setting payer metadata using an HMAC over the nonce and the remaining TLV records, which will be later verified when receiving an Invoice response.
Configuration menu - View commit details
-
Copy full SHA for 3880e69 - Browse repository at this point
Copy the full SHA 3880e69View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9bd43e0 - Browse repository at this point
Copy the full SHA 9bd43e0View commit details -
Stateless verification of Invoice for Offer
Verify that an Invoice was produced from an InvoiceRequest constructed by the payer using the payer metadata reflected in the Invoice. The payer metadata consists of a 128-bit encrypted nonce and possibly a 256-bit HMAC over the nonce and InvoiceRequest TLV records (excluding the payer id) using an ExpandedKey. Thus, the HMAC can be reproduced from the invoice request bytes using the nonce and the original ExpandedKey, and then checked against the metadata. If metadata does not contain an HMAC, then the reproduced HMAC was used to form the signing keys, and thus can be checked against the payer id.
Configuration menu - View commit details
-
Copy full SHA for 022eadc - Browse repository at this point
Copy the full SHA 022eadcView commit details -
Refund metadata and payer id derivation
Add support for deriving a transient payer id for each Refund from an ExpandedKey and a nonce. This facilitates payer privacy by not tying any Refund to any other nor to the payer's node id. Additionally, support stateless Invoice verification by setting payer metadata using an HMAC over the nonce and the remaining TLV records, which will be later verified when receiving an Invoice response.
Configuration menu - View commit details
-
Copy full SHA for 1a7540f - Browse repository at this point
Copy the full SHA 1a7540fView commit details -
Stateless verification of Invoice for Refund
Stateless verification of Invoice for Offer Verify that an Invoice was produced from a Refund constructed by the payer using the payer metadata reflected in the Invoice. The payer metadata consists of a 128-bit encrypted nonce and possibly a 256-bit HMAC over the nonce and Refund TLV records (excluding the payer id) using an ExpandedKey. Thus, the HMAC can be reproduced from the refund bytes using the nonce and the original ExpandedKey, and then checked against the metadata. If metadata does not contain an HMAC, then the reproduced HMAC was used to form the signing keys, and thus can be checked against the payer id.
Configuration menu - View commit details
-
Copy full SHA for 2298af4 - Browse repository at this point
Copy the full SHA 2298af4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 259aa9a - Browse repository at this point
Copy the full SHA 259aa9aView commit details -
Extract keys from Offer::metadata to sign Invoice
For offers where the signing pubkey is derived, the keys need to be extracted from the Offer::metadata in order to sign an invoice. Parameterize InvoiceBuilder such that a build_and_sign method is available for this situation.
Configuration menu - View commit details
-
Copy full SHA for e1a6bc3 - Browse repository at this point
Copy the full SHA e1a6bc3View commit details -
Configuration menu - View commit details
-
Copy full SHA for c8a847a - Browse repository at this point
Copy the full SHA c8a847aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8afe694 - Browse repository at this point
Copy the full SHA 8afe694View commit details