damus-io / damus

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

Auto generate LN wallet for users onboarding to Damus #1623

Open alltheseas opened 11 months ago

alltheseas commented 11 months ago

user story

As a new user onboarding to Damus that does not have a LN wallet, I would like an easy way to create a wallet from Damus app, so that I can receive my first sats, and zap other nostriches.

acceptance criteria

  1. During onboarding user has an option to create a LN wallet: user is prompted to create new LN wallet Y/N
  2. Ideally:Damus updates profile with newly created LN address
  3. User is notified of successful LN wallet creation
  4. User is notified of their new LN address
  5. User can receive sats
  6. User can send sats
  7. Ideally 5 and 6 happen without needing to leave the app (e.g. see "one tap zap" experience)

Related https://github.com/damus-io/damus/issues/627

alltheseas commented 10 months ago

@bumi @kiwiidb when can we discuss Alby x Damus partnership on this 🙏

cc @jb55 @danieldaquino

alltheseas commented 9 months ago

Interesting cashu development

https://damus.io/note1gvpk4z9lwc90d26c9e5urg3j4e45t8tgujmdljaympwd9qecx29sx5mc0f

Highly experimental Lightning address that will lead to loss of funds:

@cashu.me
alltheseas commented 6 months ago

Making note of Npub.cash to be evaluated

alltheseas commented 2 months ago

Ticket can be split to 1) receive, and 2) send portions

alltheseas commented 2 months ago

@pablof7z nuts/e-cash wallet generated via nostr keypair

https://damus.io/nevent1qqsqpzvlvmfyq9y8dp36x2xvgmad5486c4ct4ecdkmdxgtr9dxl5r2qppamhxue69uhkummnw3ezumt0d5q35amnwvaz7tmjv4kxz7fwdehhxarjwpkx2cnn9e3k7mgprdmhxue69uhkx6rjd9ehgurfd3kzumn0wd68yvfwvdhk6qgcwaehxw309akxjemgw3hxjmn8wfjkccte9e3k7mg3dt7wm

jb55 commented 2 months ago

Is receiving IOUs from random mints really a good idea though? How do you know if any of these tokens are legit? They could be completely lying and unredeemable.

alltheseas commented 2 months ago

How do you know if any of these tokens are legit

Can there be an auto-redeem setting each time your acquire $1 / 2100 sats? Designwise this can be listed as an IOU / promise (what do you think @robagreda ?).

From there gather feedback which mint rugged, and which delivered, and share to some public reputation mechanism.

alltheseas commented 2 months ago

On specifying trusted mints

What I'd like see if where the recipient can be provide a list of mints that they trust, while payments from any other mint are swapped upon receipt to either lightning or one of the approved mints. And only then the zap is acknowledged.

https://damus.io/nevent1qqs0swpuqae5dnnnls9mtt839jg8udm50zpc6rfjfwe22g7vpkj775spz4mhxue69uhhyetvv9ujumt0wd68ytnsw43qz9rhwden5te0wfjkccte9ejxzmt4wvhxjmcpzemhxue69uhhyetvv9ujumn0wd68ytnzv9hxgqgswaehxw309ahx7um5wgh8w6twv5ek5kve

pablof7z commented 2 months ago

to be clear: the spec calls for recipients to explicitly say from which mints they want to receive ecash -- in fact clients can query specifically for nut zaps that belong to that mint, along with the dleq proofs that are embedded in the tokens

jb55 commented 2 months ago

what spec is this?

rolznz commented 1 month ago

NWC mints could fit this usecase:

https://nwc-mint.fly.dev/

It's native lightning, not e-cash, and powered by NWC.

The mint can generate a wallet from a single api call, and returns an isolated NWC wallet with a lightning address. The lightning address is included in the NWC URL (&lud16 param) so should be able to instantly onboard new users programmatically without switching to a brand new protocol, which works for both custodial and self-custodial wallets. They can instantly both zap (via NWC pay_invoice) and receive (by their generated lightning address).

We just need to spin up a few more mints. I'd love feedback on this idea. CC @jb55

jb55 commented 1 month ago

On Mon, Jul 29, 2024 at 11:58:26PM GMT, Roland wrote:

NWC mints could fit this usecase:

https://nwc-mint.fly.dev/

It's native lightning, not e-cash, and powered by NWC.

The mint can generate a wallet from a single api call, and returns an isolated NWC wallet with a lightning address. The lightning address is included in the NWC URL (&lud16 param) so should be able to instantly onboard new users programmatically without switching to a brand new protocol.

We just need to spin up a few more mints. I'd love feedback on this idea. CC @jb55

this seems ideal tbh

alltheseas commented 1 month ago

The mint can generate a wallet from a single api call, and returns an isolated NWC wallet with a lightning address

Whose mint @rolznz ?

callebtc commented 1 month ago

We just need to spin up a few more mints.

Why do you even call this "mint"? Iiuc, this is just an ordinary custodial wallet account that uses NWC instead of the other APIs we've had for years, such as LNbits or LNDHub. Calling this "mint" but it's "not ecash" (obviously not, it's just an account system) sounds weird to me.

jb55 commented 1 month ago

We just need to spin up a few more mints.

Why do you even call this "mint"? Iiuc, this is just an ordinary custodial wallet account that uses NWC instead of the other APIs we've had for years, such as LNbits or LNDHub. Calling this "mint" but it's "not ecash" (obviously not, it's just an account system) sounds weird to me.

had the same thought 🤔

rolznz commented 1 month ago

Why do you even call this "mint"? Iiuc, this is just an ordinary custodial wallet account that uses NWC instead of the other APIs we've had for years, such as LNbits or LNDHub. Calling this "mint" but it's "not ecash" (obviously not, it's just an account system) sounds weird to me.

Yes, you're completely right. I will think of a new name and update the repository.

The main inspiration was a list of instances run by many node runners, like on https://bitcoinmints.com/ and it would be cool to have these "NWC custodial instances" as another type that people could choose to use. Do you have any thoughts or objections about this?

I think the main innovation here is that there is a single spec (NWC) that works well with many types of custodial and self-custodial wallets (including ones without a public IP), simplifying the implementation in Damus, and giving users flexibility in choosing a wallet.

Whose mint @rolznz ?

I run this instance, but it would be up to Damus to find some trusted instance runners to provide for users. I think the important thing is that there should be multiple instances - not relying on one custodian. Ideally users understand that they are using a custodial wallet, and once they learn more or accumulate funds they can be guided towards running their own node.

jb55 commented 1 month ago

I think these have traditionally been called hubs. sounds like this is just an alby lndhub variant with zaps?

rolznz commented 1 month ago

I think these have traditionally been called hubs. sounds like this is just an alby lndhub variant with zaps?

Yeah, Alby Hub is the first NWC wallet service which supports subaccounts and is open source, which makes it a good base to provide liquidity for thousands of new Damus users in a more decentralized way than a classic custodial service, since the risk can be spread across many instances.

How would you guys see this in the onboarding UX?

1.During onboarding user has an option to create a LN wallet: user is prompted to create new LN wallet Y/N

First an instance must be chosen for the user out of ideally multiple instances of these subaccount services. A list of these instances could be on Nostr similar to NIP-87, filtered by upvotes from a trusted Damus profile for example - that way Damus still has control over recommending instances, but the instance list can also be used by other nostr apps.

Once an instance is chosen, it would be a simple API call to it which would retrieve the NWC connection string + lightning address, which can be assigned to the user's profile and they are ready to go.