STORY
Refactoring bolt.fun nostr-powered commenting feature - Part 3
AUTHOR
Joined 2022.06.04
DATE
VOTES
sats
COMMENTS

Refactoring bolt.fun nostr-powered commenting feature - Part 3

The final part needed for our first version of the commenting feature is of course the comments themselves.

Now the comments will be Nostr objects that are:
- Kind 1
- The content will contain the comment's body
- It will reference the Root Event Id
- It can be a reply to another comment

How will these events be signed before publishing them??

- The user has a nostr extension?

✅ -> We will try to sign the event using his nostr extension
❌ -> We will send the event to our API to be signed there using our generated keys

So basically, for a user to be able to comment on a post, he either needs to:

- Be logged in

- Have a nostr extension

After publishing the comment to Nostr, we will also send the comment to our API to store it there as a backup.

In case the relays decide to delete all the comments for whatever reason.

If we get our own relay in the future, we may be able to skip this step hopefully.

Edge Case challenge:

How should we tackle the case where a user wants to post a comment from his mobile, but on his desktop, he is using a nostr extension??

In other words, if we were to use a bolt.fun generated key for this user on mobile, then these comments will appear as is they are from a different profile than the one he is using usually.

We can probably ask the user to give us his nostr private key if he wants to be able to post comments from his mobile, but I think this is a bad idea...

(For various security & trust reasons)

One half-solution that occurred to me is:

We store the comment that the user wants to publish from his mobile in our DB.

When he opens the website from his desktop browser, we can ask him to sign all the pending comments that needs signing with his nostr prvKey.

This will handle the trust & security issues, but the obvious problem is that there will be a delay between when he wrote the comment, and when he actually publishes it.

So I don't know...

Any ideas or suggestions here are very appreciated.

I guess that's everything for now regarding our plans & vision for the core version.

As you saw, no fancy features yet, but still, there are several challenges that we see, & maybe other challenges that we can't see yet.

But we are very excited anyways!

Until next time,

have a nice day 👋

Prev Part. Defining the How (1)