A Notifications & DM features for Bolt.Fun using Nostr
DMs
WHEN a logged in user visits a user profile
THAT already has a primary nostr key
HE CAN send a nostr DM messages to him
It could be a small button at the right bottom of the page that when clicked, it'll open a small messaging window (Similar to Intercom)
This component can be as simple or as complicated as we want it to be.
The first basic version could be just a chat window that contains a list of messages and a message input.
Because this system is built on Nostr, there are a few limitations to keep in mind:
1- Messages are encrypted
Nostr DMs are encrypted using a specific key created from the user's private key.
This means that to decrypt these messages, you need to have access to your primary nostr key.
In other words:
You can only view your DMs or send DMs when you are on the device that is connected to your primary nostr key (through Alby for example).
So what will happen on other devices??
We can just show the messages but with encrypted content.
And maybe a prompt saying something like: "To view these messages, view this from a device connected to your primary key"
2- Can't have a read/unread state
We can't mark messages as read/unread or new, because they are just stored on Nostr without any place storing whether the user saw them yet or not.
So the user will have to manually check his different DMs list.
Which brings us to the next point:
How can a user know that someone how he hasn't talked to before sent him a DM???
Should we have a component that displays a list of people who sent you a DM sorted by latest message date??
Notifications
Under the hood, notifications will function very similarly to DMs.
But instead of being 2-ways messaging, they will act as a receive only channel with the BOLT.FUN nostr account.
They of course suffer from the same limitation above, meaning that:
-
only seeing notifications content from device connected to his nostr key
-
can't mark notifications as read/unread
One thing worth noting:
The user is able to view his DMs/Notifications from any other nostr client where he imported his same primary key.