author: akumaigorodski discussion: https://t.me/lnurl/709
New aes field on successAction
This defines a new successAction type for payRequest: aes. Besides the tag field it requires description, ciphertext and iv.
The encryption key is the payment preimage for the invoice specified in the pr field, so it’s safe to include data in the ciphertext that the user will only be able to see if they complete the payment.
See example below:
description. It could be, for example, a pin code to be provided elsewhere, or just a secret word or phrase the user can then use to perform something in the world with.
LNURL-pay flow change
An aessuccessAction should be displayed and stored like the message (LUD-09) type, but with the message corresponding to the plaintext after being decrypted with the payment preimage.
Implementation details
Used encryption type is 256-bit AES inAES/CBC/PKCS5Padding mode.
An encryption example in Scala: