]> git.bitcoin.ninja Git - rust-lightning/commit
Verify blinded keysend payment secrets
authorValentine Wallace <vwallace@protonmail.com>
Tue, 22 Oct 2024 20:51:51 +0000 (16:51 -0400)
committerValentine Wallace <vwallace@protonmail.com>
Fri, 8 Nov 2024 22:08:27 +0000 (17:08 -0500)
commit9cc6969314c92e2b05028d573dc821a96a52d0da
tree3ed1e9b4ad2ab706e762bcc902b655aff0c3f529
parent34c2f258067d50eba13e2a4c55cba10a2989716f
Verify blinded keysend payment secrets

If we're receiving a keysend to a blinded path, then we created the payment
secret within. Using our inbound_payment_key, we can decrypt the payment secret
bytes to get the payment's min_cltv_expiry_delta and min amount, to verify the
payment is valid. However, if we're receiving an MPP keysend *not* to a blinded
path, then we did not create the payment secret and shouldn't verify it since
it's only used to correlate MPP parts.

Therefore, store whether the payment secret is recipient-generated in our pending
inbound payment data so we know whether to verify it or not.
lightning/src/ln/blinded_payment_tests.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/onion_payment.rs