damus-io / damus

iOS nostr client
GNU General Public License v3.0
1.99k stars 287 forks source link

Detect Single Use LN Invoice in Bitcoin Lightning Tips Field + Warn User [UI/UX][Feature Request][Enhancement] #477

Open alltheseas opened 1 year ago

alltheseas commented 1 year ago

User Story

As a Damus engineer who is providing many new nostr users their first nostr experience, I want to help newbies by detecting if users are entering single use lightning invoices in their Bitcoin Lightning Tips profile field AND warn them if yes AND suggest they use a Lightning Address (for instance, examplelightningaddress@walletofsatoshi.com, or LNURL), so that their LN capabilities are not affected.

Acceptance Criteria

  1. Detect if user is inputting a temporary / single use lightning invoice in their Bitcoin Lightning Tips profile field,
  2. Warn user that "You are entering a single use invoice. Use a lightning address, or LNURL instead. You can easily get one by utilizing Wallet of Satoshi app https://www.walletofsatoshi.com/, or LNURL.com.
  3. Delete single use LN invoice

User Experience image https://damus.io/note1e7qmthwmx24krnhxas6xxaldjc6wvmzhrca439hx5tjftw984r0q958zv6

Kortik7 commented 1 year ago

what about allowing AMP invoices instead of single use lightning invoices?

https://docs.lightning.engineering/lightning-network-tools/lnd/amp

no need to rely on a 3rd party custodial wallets by allowing amp invoices instead of lud-06 lightning addresses.

https://thebitcoinmanual.com/articles/atomic-multi-path-payments/

What are the benefits of AMP? There are multiple benefits of Atomic Multi-Path Payments of the lightning network. Some of these are:

It enhances privacy as more significant payments look like the smaller ones, and in the background, only the sender & receiver knows how they are sending/receiving the payment through AMP. This also allows you to use the existing lightning wallets without making any significant changes to them. If any of the small payment routes fail, the whole payment fails, and this is how the atomicity comes in to prevent scenarios like partial payments. It reduces the chances of failed payments and improves the user experience of Lightning. It allows for larger transactions to be conducted on Lightning and takes even more strain on the base layer, driving down the cost of block space in theory. It improves the ability for routing nodes to earn income as they are routing more payments to clip fees on It improves the decentralisation of the lightning network as smaller channels now have a better chance of routing payments and providing valuable connections between wallets. AMPs also enhance the user experience as it allows you to send most of your money in your wallet to the other receivers. While in the absence of AMP, the user will always have a capped base limit on how much they can send despite having more money in the wallet, which can be a wired experience for the user. Consider having 100 satoshis in the account, but you can only send 20 satoshis because the payment channels don’t support 100 satoshis!

alltheseas commented 1 year ago

what about allowing AMP invoices instead of single use lightning invoices?

Is a AMP invoice compatible with the most popular LN wallets?

Kortik7 commented 1 year ago

what about allowing AMP invoices instead of single use lightning invoices?

Is a AMP invoice compatible with the most popular LN wallets?

Amp invoices supported since LND version v0.13.0, yes most popular LN wallets support amp invoices like Zeus

https://youtu.be/PNSPXRflCSc

https://lightning.engineering/posts/2021-06-17-lnd-v0.13/

https://bitcoin.stackexchange.com/questions/89475/what-are-atomic-multi-path-payments-amps-and-why-how-is-it-being-implemented-i/89476#89476

https://github.com/lightning/bolts/pull/658

https://github.com/lightningnetwork/lnd/blob/master/docs/release-notes/release-notes-0.14.0.md#re-usable-static-amp-invoices

alltheseas commented 1 year ago

what about allowing AMP invoices instead of single use lightning invoices?

Is a AMP invoice compatible with the most popular LN wallets?

Amp invoices supported since LND version v0.13.0, yes most popular LN wallets support amp invoices like Zeus

https://youtu.be/PNSPXRflCSc

https://lightning.engineering/posts/2021-06-17-lnd-v0.13/

https://bitcoin.stackexchange.com/questions/89475/what-are-atomic-multi-path-payments-amps-and-why-how-is-it-being-implemented-i/89476#89476

lightning/bolts#658

https://github.com/lightningnetwork/lnd/blob/master/docs/release-notes/release-notes-0.14.0.md#re-usable-static-amp-invoices

Ok, thanks for sharing the AMP detailed resources. I'll add a new ticket specific to AMP support and tag for your review.

alltheseas commented 1 year ago

https://github.com/damus-io/damus/issues/542 @Kortik7

alltheseas commented 1 year ago

@scoder1747 working on this https://github.com/damus-io/damus/pull/752