near / near-wallet

Web wallet for NEAR Protocol which stores keys in browser's localStorage
https://wallet.near.org
MIT License
213 stars 174 forks source link

Linkdrop flow during Login #611

Open ilblackdragon opened 4 years ago

ilblackdragon commented 4 years ago

Currently Linkdrop would be used for creating accounts. At the same time, the app needs to know if user needs new account before creating linkdrop. But without targeting user to Wallet first, there is no way to identify this.

kcole16 commented 4 years ago

We might be able to make some changes to the linkdrop contract to make this easier.

If we make balances reusable, allows Flux to send most users to wallet with a key e.g.

  1. Flux sends me a key and I never use it (or already have an account, thus Wallet doesn't use it)
  2. They send someone else a key without adding additional funds to the Linkdrop contract

This doesn't prevent spam/sybil attacks, but will at least cut a step out of the flow.

The alternative is pretty ugly:

And this is also in no way sybil resistant

cc @vgrichina

vgrichina commented 4 years ago

Agree that contract shouldn't be using up tokens that aren't claimed.

As for Sybil resistance – I think we have such options in short term:

kcole16 commented 4 years ago

I’m not sure Sybil resistance on our side helps the app that much, as they’ll have already given the user a funded Linkdrop key

vgrichina commented 4 years ago

I’m not sure Sybil resistance on our side helps the app that much, as they’ll have already given the user a funded Linkdrop key

@kcole16 it's not like conditions for claiming Linkdrop are set in stone. We can require another signature by our backend if necessary.