From deb9a6357b6f327d298e9fe300146c7d9bc894a8 Mon Sep 17 00:00:00 2001 From: water <130329555+water783@users.noreply.github.com> Date: Sat, 12 Oct 2024 11:44:35 +0800 Subject: [PATCH] add file message kind --- 17.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/17.md b/17.md index 4b96bce..806cc8c 100644 --- a/17.md +++ b/17.md @@ -35,6 +35,35 @@ Tags that mention, quote and assemble threading structures MUST follow [NIP-10]( Kind `14`s MUST never be signed. If it is signed, the message might leak to relays and become **fully public**. +## File Message Kind + +```jsonc +{ + "id": "", + "pubkey": "", + "created_at": "", + "kind": 15, + "tags": [ + ["p", "", ""], + ["p", "", ""], + ["e", "", "", "reply"], // if this is a reply + ["subject", ""], + ["file-type", ""], + ["encryption-algorithm", ""], + ["decryption-key", ""] + // rest of tags... + ], + "content": "" +} +``` + +Kind 15 is used for sending encrypted file event messages: + +- `file-type`: Specifies the MIME type of the attached file (e.g., `image/jpeg`, `audio/mpeg`, etc.). +- `encryption-algorithm`: Indicates the encryption algorithm used for encrypting the file. Supported algorithms may include `aes-gcm`, `chacha20-poly1305`,`aes-cbc` etc. +- `decryption-key`: The decryption key that will be used by the recipient to decrypt the file. +- `content`: Contains either the URL of the file (``) or the encrypted data in base64 format (``). + ## 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.