STORY
Better Way to Handle Linking a Nostr Key
AUTHOR
Joined 2022.06.04
DATE
VOTES
sats
COMMENTS

Better Way to Handle Linking a Nostr Key

The Problem:
There are 2 meanings for "Connect your nostr account"

1st- Just tell us that this public key belongs to you, and prove that by signing some message with it.

2nd- Choose a method and a key that you want to use to handle your nostr operations on this device.

The difference here is that the first type is more of a read-only value, but it can't be used for anything.

The reason for that is because: The user could very likely be using the website from a device different than the one that he linked this key from.

The 2nd option is the use-only option.

We are asking the user to choose the way that he wants to be using to post his comments ON THIS DEVICE.

We are storing this info locally, and we are not sending it to the server.

Now this 2 methods are currently working fine, but...personally, I think we can do a little better.

The main thing I don't like about this is that the user has to link the same wallet in 2 different places.

In the place where he wants to use it (the comments widget currently), and his profile.

But I think that it makes more sense if he were to only need to connect it in the place where he wants to use it, and then it automatically gets linked to his profile.

(Or maybe he ticks a checkbox saying something like: "Show this public key on my profile", cause there might be some users who wants to comment anonymously)

So the flow will be like this:

  1. User wants to do something nostr-related.

  2. He clicks on "Connect a nostr key" button.

  3. He chooses a method (wallet, generated keys, nostr-connect,...etc)

  4. He optionally checks a checkbox saying he wants to associate this key to his profile

  5. This connection preference gets stored locally (because it can only be USED on this device)

  6. The connection pubkey gets sent to the server to be linked to the user profile

When the user navigates to his profile:

  • He will see all the pubkeys that he is using on different devices

  • He can unlink a pubkey from his profile nostr settings page

  • He can link a new pubkey to his profile directly, but it will be a READ only key.

What do you think about this approach??

I'd say it's already greatly similar to our current flow.

The main change is the auto linking of key to profile when it's being connected for use.

Let me know if you have any different ideas/suggestions/opinions.