damus-io / damus

iOS nostr client
GNU General Public License v3.0
1.96k stars 289 forks source link

Recognize cashu redeem code #1788

Open alltheseas opened 7 months ago

alltheseas commented 7 months ago

what happens Very long cashu gibberish string is displayed

what could happen Damus recognizes cashu redeem string, shows -the amount -a "redeem" button, -copy string button

suggested initial approach

1) Cashu: prefixed link are detected 2) an invoice-like "redeem" button appears instead of gibberish characters 3) if tap on redeem, cashu: opens default cashu wallet 4) there is a copy string button adjacent to redeem 5) list amount (sats)

https://damus.io/note17ek90arl9y6vmut6t48d7kfgp9rfdx0c0x9wflyq6v4shvg46ddsh0gud2

image

KKA11010 commented 7 months ago

Also a "open in wallet" button. It provides the best possible UX.

Mobile cashu wallets support deep links "cashu:token" or cashu://token"

They claim the token and lets you spend it again without melting to your LN wallet.

alltheseas commented 7 months ago

Also a "open in wallet" button. It provides the best possible UX.

Mobile cashu wallets support deep links "cashu:token" or cashu://token"

They claim the token and lets you spend it again without melting to your LN wallet.

If there were a redeem button, is there any other place it would take you other than a wallet with the cashu: prefix?

KKA11010 commented 7 months ago

Also a "open in wallet" button. It provides the best possible UX.

Mobile cashu wallets support deep links "cashu:token" or cashu://token"

They claim the token and lets you spend it again without melting to your LN wallet.

If there were a redeem button, is there any other place it would take you other than a wallet with the cashu: prefix?

Not sure if other apps support the cashu: prefix. (Apps have to specify the prefix they support f.e lightning: for LN wallets) Currently it is a native Ecash wallet thing.

KKA11010 commented 7 months ago

Some thoughts on how the user can interact with an inline Ecash

  1. Redeem via Lightning within the Nostr client.
  2. Redeem into Ecash wallet (best UX imo and most private).
  3. Display QR to redeem by scanning with an Ecash wallet
  4. Copy the string into clipboard
alltheseas commented 7 months ago

https://damus.io/note1aqy9x9fcnqrvfxpndlhd2msmkcp5e34jsmrt3wu3yk3p4zq6mkcszl87q8

alltheseas commented 7 months ago

I think decrypt with nsec key and copy to cashu wallet. @dr. calle 👁️⚡👁️ posted NUT-11 https://github.com/cashubtc/nuts/blob/main/11.md which makes most sense for Nostr usage.

https://github.com/cashubtc/nuts/blob/main/11.md

alltheseas commented 7 months ago

Redeem directly flow and video walk through

https://damus.io/note1pu2z35csmyjg8fq9uuxdjumuh8ufeusrz0psgyxf0a074kpcyf7skty8x2

https://video.nostr.build/bad2b8a13ff2cf976f4af699b669355bf462ad1c04755be0bf3cf9798a1adc4a.mp4

alltheseas commented 7 months ago

@KKA11010 in the cashu link is there a source/server/mint name that can be displayed? Is it desirable to display this?

KKA11010 commented 7 months ago

@KKA11010 in the cashu link is there a source/server/mint name that can be displayed? Is it desirable to display this?

Yes the mint URL is encoded in the token. The wallet shows it once you redeem it. I would say no need to display it in Nostr clients.

alltheseas commented 7 months ago

@ericholguin 👀 👀