Skip to content

Add support for payment comments when sending sats to LightningAddress@npub.cash #33

@ThomasFarstrike

Description

@ThomasFarstrike

When sending sats to a LightningAddress@npub.cash, the webserver's reply JSON doesn't contain "commentAllowed" so the sender is unable to add a comment to the payment.

The LNURL-pay specification, used by the Lightning Address specification, allows for these comments.

Other Lightning Address providers, such as GetAbly.com, Coinos.io or LNBits, do support these comments.

Our product, the Lighting Piggy, displays these comments to the users along with the amount of sats, so it would be great if npub.cash would also support this, to provide more info to the user.

Details

A lightning addresses such as npub1wg4j2adhl5mmyglvlegmzpqlzx6sl4jpelh8l8xp99wc5kas2rpq5qgaxf@npub.cash result in the wallet fetching the URL https://npub.cash/.well-known/lnurlp/npub1wg4j2adhl5mmyglvlegmzpqlzx6sl4jpelh8l8xp99wc5kas2rpq5qgaxf

This URL returns a JSON like this:

{"callback":"https://npub.cash/.well-known/lnurlp/npub1wg4j2adhl5mmyglvlegmzpqlzx6sl4jpelh8l8xp99wc5kas2rpq5qgaxf","maxSendable":100000000,"minSendable":1000,"metadata":"[[\"text/plain\",\"A cashu lightning address... Neat!\"]]","tag":"payRequest","allowsNostr":true,"nostrPubkey":"8576fd19bfe693cba6f0aee33b8427334306846ec61b65e2d617209e1c021046"}

...which indeed doesn't have the "commentAllowed":512 (or some other max comment length than 512 bytes).

Comparing to another implementation like GetAlby.com:

https://getalby.com/.well-known/lnurlp/tfar

returns:

{"status":"OK","tag":"payRequest","commentAllowed":255,"callback":"https://getalby.com/lnurlp/tfar/callback","metadata":"[[\"text/identifier\",\"tfar@getalby.com\"],[\"text/plain\",\"Sats for tfar\"]]","minSendable":1000,"maxSendable":50000000,"payerData":{"name":{"mandatory":false},"email":{"mandatory":false},"pubkey":{"mandatory":false}},"nostrPubkey":"79f00d3f5a19ec806189fcab03c1be4ff81d18ee4f653c88fac41fe03570f432","allowsNostr":true}

...which has "commentAllowed":255 set.

Solution

It would be great if the "commentAllowed" field could be added to the JSON that the server replies, so that the user's wallet will allow a comment to be set.

This comment should then be used as the "payment description" of the BOLT11 invoice when it is generated before it's sent to the payer.

Thank you for looking into this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions