upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/94.md
diff options
context:
space:
mode:
authorfrbittencourt <fbittencourt@neadvance.com>2023-03-09 14:01:19 +0000
committerfiatjaf_ <fiatjaf@gmail.com>2023-04-20 08:06:14 -0300
commita090de2b90f9fd83e49fa39ff4c7ef52750e904b (patch)
treee3e12df4cc03eedde6506cdb9471d150ec7c4ce0 /94.md
parentbb4a805f11e0c9438d0ee513f2071602e5403382 (diff)
create draft NIP 94 and 95
Diffstat (limited to '94.md')
-rw-r--r--94.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/94.md b/94.md
new file mode 100644
index 0000000..06b03c8
--- /dev/null
+++ b/94.md
@@ -0,0 +1,43 @@
1NIP-94 - File Header
2======
3`draft` `optional` `author:frbitten`
4
5The purpose of this NIP is to allow an organization and classification of shared files. So that relays can filter and organize in any way that is of interest.
6Also the goal is to create a base on the protocol for this bountsr "Filesharing App" (https://bountsr.org/p2p-filesharing/) to be implemented.
7
8Nostr event
9------------------
10This NIP specifies the use of the `30063` event type (parameterized replaceable event), having in `content` a description of the file content, and a list of tags described below:
11* `d` containing the name of the shared file to allow it to be overwritten in the future.
12* `url` the url to download the file
13* `type` a string indicating the data type of the file. The MIME types format must be used (https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types)
14* `decrypt` (optional) If the file is encrypted, you must indicate in the first value the algorithm used to encrypt the file and in the second value the information (the key) that allow the decryption of the file
15
16```json
17{
18 "id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data>,
19 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
20 "created_at": <unix timestamp in seconds>,
21 "kind": 30063,
22 "tags": [
23 ["d", <string with name of file>],
24 ["url",<string with URL of file>],
25 ["decrypt",<algorithm>,<key>],
26 ["p", <32-bytes hex of a pubkey>, <recommended relay URL>],
27 ],
28 "content": "A beautiful picture of a wild toucan",
29 "sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field>
30}
31
32Client Behavior
33---------------
34The client can use this event as they see fit. Either showing events in the same feed as kind 1 events or creating a specific feed for file listings
35It allows the app to create image galleries (memes, animations) that can be reused countless times in different notes. As it exists in whatsapp, telegram, etc. Exemple: <https://ibb.co/Fnj5TMg>
36To do this, just select the image from the gallery (events NIP-94) and include the URL of the selected image
37
38Suggested Use Cases
39-------------------
40* A relay for indexing shared files. For example to promote torrents
41* A Pinterest-like relay and app where people can share their portfolio and inspire others.
42* A simple way to distribute configurations and software updates.
43* Specialized relays can provide collections of emojis, memes and animated gifs to be used in notes.