nip-17: support seen events.

This commit is contained in:
Kay 2025-02-07 21:36:55 +00:00
parent 63d1e89f53
commit f45d82acbe

28
17.md
View File

@ -84,7 +84,7 @@ Clients CAN offer disappearing messages by setting an `expiration` tag in the gi
## Publishing ## Publishing
Kind `10050` indicates the user's preferred relays to receive DMs. The event MUST include a list of `relay` tags with relay URIs. Kind `10050` indicates the user's preferred relays to receive DMs based on [NIP-51](51.md). The event MUST include a list of `relay` tags with relay URIs.
```jsonc ```jsonc
{ {
@ -100,6 +100,32 @@ Kind `10050` indicates the user's preferred relays to receive DMs. The event MUS
Clients SHOULD publish kind `14` events to the `10050`-listed relays. If that is not found that indicates the user is not ready to receive messages under this NIP and clients shouldn't try. Clients SHOULD publish kind `14` events to the `10050`-listed relays. If that is not found that indicates the user is not ready to receive messages under this NIP and clients shouldn't try.
## Seen status
A client MAY publish a kind `30010` which means saw messages with a `"d"` tag set to receivers pubkey.
The `.content` field is a base64 encoded string of a bloom filter containing message ids (gift wrapped) saw by receiver.
The sender pubkey's client MAY query that specific event to check which messaged in this chat is seen by receiver to enhance user experience.
Example event:
```json
{
"kind": 30010,
"created_at": 1738964056,
"tags": [
[
"d",
"bd4ae3e67e29964d494172261dc45395c89f6bd2e774642e366127171dfb81f5"
]
],
"content": "AAAAAAAACJEAAAAAAAAAAQAAAAAAAAiRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
}
```
A client MAY encrypt the `.content` based on [NIP-44](44.md) for more privacy.
## Relays ## Relays
It's advisable that relays do not serve `kind:1059` to clients other than the ones tagged in them. It's advisable that relays do not serve `kind:1059` to clients other than the ones tagged in them.