]> git.bitcoin.ninja Git - rust-lightning/commit
Pass Nonce directly to InvoiceRequestBuilder
authorJeffrey Czyz <jkczyz@gmail.com>
Fri, 12 Jul 2024 16:14:18 +0000 (11:14 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Mon, 22 Jul 2024 16:34:04 +0000 (11:34 -0500)
commitfd596c31b504adfddf8478ef59451a62a3d2c597
treeeb1cecc62c5c95f79491e3b9474ed6b776edf8b0
parentbdf333045cf43f0e46ddf5e7db8c415c7684cc4f
Pass Nonce directly to InvoiceRequestBuilder

When using InvoiceRequestBuilder::deriving_payer_id, the nonce generated
needs to be the same one included in any reply path. This is because the
nonce is used along with the invoice request TLVs to derive a payer id.
While this data is also included in the payer_metadata, including it in
the blinded path would allow reducing the amount of data needed there to
just enough to provide entropy (i.e., 16 bytes). This is more important
for Refund because it can be transmitted via a QR code. But using the
same payer_metadata structure for both InvoiceRequest and Refund would
be beneficial to avoid more code.
lightning/src/ln/channelmanager.rs
lightning/src/offers/invoice_request.rs
lightning/src/offers/offer.rs