From 022daabd60272bbf99facb34eadcd76a95d64d40 Mon Sep 17 00:00:00 2001 From: water <130329555+water783@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:08:14 +0800 Subject: [PATCH] Add optional fields & clarify that kind 15 should be sealed and then gift-wrapped --- 17.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/17.md b/17.md index 33f9e19..bf7d91f 100644 --- a/17.md +++ b/17.md @@ -52,6 +52,7 @@ Kind `14`s MUST never be signed. If it is signed, the message might leak to rela ["encryption-algorithm", ""], ["decryption-key", ""], ["decryptiion-nonce", ""], + ["x", ""], // rest of tags... ], "content": "" @@ -65,6 +66,14 @@ Kind 15 is used for sending encrypted file event messages: - `decryption-key`: The decryption key that will be used by the recipient to decrypt the file. - `decryption-nonce`: The decryption nonce that will be used by the recipient to decrypt the file. - `content`: The URL of the file (``). +- `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 `x` +- `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 +- `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 @@ -76,7 +85,7 @@ An optional `subject` tag defines the current name/topic of the conversation. An ## Encrypting -Following [NIP-59](59.md), the **unsigned** `kind:14` 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 message must be sealed (`kind:13`) and then gift-wrapped (`kind:1059`) to each receiver and the sender individually. ```js {