NIP-17: "seen" event#1994
Conversation
|
Good. Can we cover other chat specific statuses in the same way? One more people accepted this, we can close the older PR. Keeping PRs clean. |
|
I think this will create an issue. If some bad actors decide to attack another client by sending a |
|
What do you mean by "check"? If you have the messages in memory already that should be trivial, no? Otherwise you can ignore that, or only check the last ones. |
Ah okay, I understand it now, I'm a bit is overthinking. |
|
Would this work with huge chats? Consider this case: I have a huge chat with my friend in Also, Is this one works on groups? |
The process is simpler than you think. → Open Coop No query is needed. |
|
|
|
How about this: "Received" eventA public (not giftwrapped) event of kind {
"id": "<usual hash>",
"pubkey": "<pubkey>",
"created_at": "<now>",
"kind": 10017,
"tags": [],
"content": ""
} |
|
Tracking individual event ids gets really hairy, speaking from experience. Timestamp-based tracking is better, and should only lie if relay selections aren't implemented properly. I'm not sure Vitor's ultra-simple thing is sufficient, depending on use case, since as @kehiy said we might want stuff like "typing...". |
|
There are 3 things here:
"Typing" eventA public (not giftwrapped) event of kind 10018 may be used to indicate when the user is typing into a chatroom. {
"id": "<usual hash>",
"pubkey": "<pubkey>",
"created_at": "<now>",
"kind": 10018,
"tags": [
["room", "100:10:AAAkAQANcYQFCQoB:hZkZYqqdxcE="]
["expiration", "now + 15"]
],
"content": ""
}Where room is Bloom filter of the IDs of the last messages of the room as defined on: https://github.com/nostr-protocol/nips/pull/1497/files Clients should download kind 10018 and check if the ID of the 3 most recent kind 14 messages are inside the filter. |
|
Bloom filters could be ok for sharing data with others, but would result in really annoying non-dismissable notifications 1% of the time for users. I think the best approach for that is going to be timestamps checked against when an event was first seen by the client (rather than its created at). |
humm.. can you explain more? Why are they non-dismissable? They don't even p-tag receivers. I am not sure where these notifications are coming from. You would only track 10017 and 10018 for users in in the room. |
|
Sorry, I was getting the bloom filters false positive/negative mixed up. If you're keeping a bloom filter with event ids, you'll sometimes get false positives, resulting in missed notifications. Also, the bloom filter will grow forever, so there needs to be some timestamp-based rule for removing events from the filter. |
|
For the typing event, we can just store 3 or so of the last IDs. There is no need to store long term. For the Mark as seen for yourself event, we could just store the latest ID per chatroom (group of p tags) |
|
I think you're all crazy, bloom filters are obviously an overkill for this. Why would you want to check if a message from 6 months ago was read? You only care about like the last 5 messages. |
|
Just the timestamps will suffice definitely, but this proposal's ability to include some ids (again, not all ids, that would be crazy, please read my proposal) is a small enhancement over that to account for messages that are late to arrive, messages that get lost, multiple messages that have the same timestamp etc. |
I'm just saying I tried this, and it was still crazy. If you're including recent ids, you need to set the timestamp to the time the event before the last id you include was created. I can't remember what the exact problem was, but there was some other syncing gotcha. Timestamps based on when an event was seen (for the user) and when an event was created (for their counterparty) are an order of magnitude simpler. |
The bloom filters are public so that you don't need to encrypt/decrypt to every recipient (HUGE data consumption). They are also very small since it is. only the last 3 Ids or so. The filter just obfuscates the IDs for a public event. |
|
Keep in mind that even though you are transferring 30016 inside GiftWraps, the wraps/seals are not replaceable, which means that if the client doesn't add a reasonable expiration in the wrap event, in the long run we will have more giftwraps with old seen events than anything else. |
I see. That means I didn't read the other proposal then.
Good point. Maybe giftwraps were really a bad idea, they are very hostile to things like relay disk and memory, spam protection etc. We should come up with a different protocol. |
They are not designed for mundane things like "Mark as Seen". They are designed for a metadata-leak-free privacy. We don't need to apply that crazy level of privacy for most things on Nostr. |
|
A small idea: make the |
A simpler alternative to #1761.
Here's an image with the diff for your delight: