Compare commits

...

3 Commits

Author SHA1 Message Date
pablof7z
92c2176c17 a bit more explicit 2025-03-21 12:58:47 +00:00
pablof7z
4eb4b13927 adds that clients shouldnt publish contradictory handlers 2025-03-21 12:55:42 +00:00
Vitor Pamplona
0619f370bc NIP-17 Typos and grammar improvements (#1840) 2025-03-13 10:23:35 -03:00
2 changed files with 20 additions and 7 deletions

14
17.md
View File

@@ -57,7 +57,7 @@ Kind `14`s MUST never be signed. If it is signed, the message might leak to rela
["file-type", "<file-mime-type>"],
["encryption-algorithm", "<encryption-algorithm>"],
["decryption-key", "<decryption-key>"],
["decryptiion-nonce", "<decryption-nonce>"],
["decryption-nonce", "<decryption-nonce>"],
["x", "<the SHA-256 hexencoded string of the file>"],
// rest of tags...
],
@@ -74,16 +74,16 @@ Kind 15 is used for sending encrypted file event messages:
- `content`: The URL of the file (`<file-url>`).
- `x` containing the SHA-256 hexencoded string of the file.
- `size` (optional) size of file in bytes
- `dim` (optional) size of file in pixels in the form `<width>x<height>`
- `blurhash`(optional) the [blurhash](https://github.com/woltapp/blurhash) to show while the file is being loaded by the client
- `thumb` (optional) url of thumbnail with same aspect ratio
- `dim` (optional) size of the file in pixels in the form `<width>x<height>`
- `blurhash`(optional) the [blurhash](https://github.com/woltapp/blurhash) to show while the client is loading the file
- `thumb` (optional) URL of thumbnail with same aspect ratio (encrypted with the same key, nonce)
- `fallback` (optional) zero or more fallback file sources in case `url` fails
Just like kind 14, kind `15`s MUST never be signed.
## Chat Rooms
The set of `pubkey` + `p` tags defines a chat room. If a new `p` tag is added or a current one is removed, a new room is created with clean message history.
The set of `pubkey` + `p` tags defines a chat room. If a new `p` tag is added or a current one is removed, a new room is created with a clean message history.
Clients SHOULD render messages of the same room in a continuous thread.
@@ -91,7 +91,7 @@ An optional `subject` tag defines the current name/topic of the conversation. An
## Encrypting
Following [NIP-59](59.md), the **unsigned** `kind:14` & `kind:15` chat message must be sealed (`kind:13`) and then gift-wrapped (`kind:1059`) to each receiver and the sender individually.
Following [NIP-59](59.md), the **unsigned** `kind:14` & `kind:15` chat messages must be sealed (`kind:13`) and then gift-wrapped (`kind:1059`) to each receiver and the sender individually.
```jsonc
{
@@ -173,7 +173,7 @@ The main limitation of this approach is having to send a separate encrypted even
Clients implementing this NIP should by default only connect to the set of relays found in their `kind:10050` list. From that they should be able to load all messages both sent and received as well as get new live updates, making it for a very simple and lightweight implementation that should be fast.
When sending a message to anyone, clients must then connect to the relays in the receiver's `kind:10050` and send the events there, but can disconnect right after unless more messages are expected to be sent (e.g. the chat tab is still selected). Clients should also send a copy of their outgoing messages to their own `kind:10050` relay set.
When sending a message to anyone, clients must then connect to the relays in the receiver's `kind:10050` and send the events there but can disconnect right after unless more messages are expected to be sent (e.g. the chat tab is still selected). Clients should also send a copy of their outgoing messages to their own `kind:10050` relay set.
## Examples

13
89.md
View File

@@ -74,6 +74,19 @@ Using a `k` tag(s) (instead of having the kind of the `d` tag) provides:
Multiple tags might be registered by the app, following NIP-19 nomenclature as the second value of the array.
No contradictory hints can appear. Apps should not publish handlers with the same `platform:type` duple.
For example: an event with:
```jsonc
["web", "https://.../path1/<bech32>", "nevent"],
["web", "https://.../path2/<bech32>", "nevent"],
```
where the `web` + `nevent` duple is duplicated with contradictory values is invalid and clients SHOULD ignore it.
Applications that have different URLs should use different `kind:31990` to announce the different URLs that should be used per kind.
A tag without a second value in the array SHOULD be considered a generic handler for any NIP-19 entity that is not handled by a different tag.
# Client tag