diff options
Diffstat (limited to '17.md')
| -rw-r--r-- | 17.md | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -57,7 +57,7 @@ Kind `14`s MUST never be signed. If it is signed, the message might leak to rela | |||
| 57 | ["file-type", "<file-mime-type>"], | 57 | ["file-type", "<file-mime-type>"], |
| 58 | ["encryption-algorithm", "<encryption-algorithm>"], | 58 | ["encryption-algorithm", "<encryption-algorithm>"], |
| 59 | ["decryption-key", "<decryption-key>"], | 59 | ["decryption-key", "<decryption-key>"], |
| 60 | ["decryptiion-nonce", "<decryption-nonce>"], | 60 | ["decryption-nonce", "<decryption-nonce>"], |
| 61 | ["x", "<the SHA-256 hexencoded string of the file>"], | 61 | ["x", "<the SHA-256 hexencoded string of the file>"], |
| 62 | // rest of tags... | 62 | // rest of tags... |
| 63 | ], | 63 | ], |
| @@ -74,16 +74,16 @@ Kind 15 is used for sending encrypted file event messages: | |||
| 74 | - `content`: The URL of the file (`<file-url>`). | 74 | - `content`: The URL of the file (`<file-url>`). |
| 75 | - `x` containing the SHA-256 hexencoded string of the file. | 75 | - `x` containing the SHA-256 hexencoded string of the file. |
| 76 | - `size` (optional) size of file in bytes | 76 | - `size` (optional) size of file in bytes |
| 77 | - `dim` (optional) size of file in pixels in the form `<width>x<height>` | 77 | - `dim` (optional) size of the file in pixels in the form `<width>x<height>` |
| 78 | - `blurhash`(optional) the [blurhash](https://github.com/woltapp/blurhash) to show while the file is being loaded by the client | 78 | - `blurhash`(optional) the [blurhash](https://github.com/woltapp/blurhash) to show while the client is loading the file |
| 79 | - `thumb` (optional) url of thumbnail with same aspect ratio | 79 | - `thumb` (optional) URL of thumbnail with same aspect ratio (encrypted with the same key, nonce) |
| 80 | - `fallback` (optional) zero or more fallback file sources in case `url` fails | 80 | - `fallback` (optional) zero or more fallback file sources in case `url` fails |
| 81 | 81 | ||
| 82 | Just like kind 14, kind `15`s MUST never be signed. | 82 | Just like kind 14, kind `15`s MUST never be signed. |
| 83 | 83 | ||
| 84 | ## Chat Rooms | 84 | ## Chat Rooms |
| 85 | 85 | ||
| 86 | 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. | 86 | 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. |
| 87 | 87 | ||
| 88 | Clients SHOULD render messages of the same room in a continuous thread. | 88 | Clients SHOULD render messages of the same room in a continuous thread. |
| 89 | 89 | ||
| @@ -91,7 +91,7 @@ An optional `subject` tag defines the current name/topic of the conversation. An | |||
| 91 | 91 | ||
| 92 | ## Encrypting | 92 | ## Encrypting |
| 93 | 93 | ||
| 94 | 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. | 94 | 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. |
| 95 | 95 | ||
| 96 | ```jsonc | 96 | ```jsonc |
| 97 | { | 97 | { |
| @@ -173,7 +173,7 @@ The main limitation of this approach is having to send a separate encrypted even | |||
| 173 | 173 | ||
| 174 | 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. | 174 | 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. |
| 175 | 175 | ||
| 176 | 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. | 176 | 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. |
| 177 | 177 | ||
| 178 | ## Examples | 178 | ## Examples |
| 179 | 179 | ||