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:
authorJon Staab <jstaab@protonmail.com>2023-05-12 05:10:45 -0700
committerGitHub <noreply@github.com>2023-05-12 05:10:45 -0700
commite5302f84c74cf42d878a3ed18257a16bc0d3b748 (patch)
treeb1a3ad9c0317bf7c38f34c500559b66ff7c0a22d /94.md
parent1c728516dfdc7508ce27eda222bde78466e3457d (diff)
parent4208652dc7a39c63c39559b13c656ec30400fcba (diff)
Merge branch 'master' into patch-1
Diffstat (limited to '94.md')
-rw-r--r--94.md51
1 files changed, 51 insertions, 0 deletions
diff --git a/94.md b/94.md
new file mode 100644
index 0000000..24dd346
--- /dev/null
+++ b/94.md
@@ -0,0 +1,51 @@
1NIP-94
2======
3
4File Metadata
5-------------
6
7`draft` `optional` `author:frbitten` `author:kieran` `author:lovvtide` `author:fiatjaf` `author:staab`
8
9The 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. With that, multiple types of filesharing clients can be created. NIP-94 support is not expected to be implemented by "social" clients that deal with kind:1 notes or by longform clients that deal with kind:30023 articles.
10
11## Event format
12
13This NIP specifies the use of the `1063` event type, having in `content` a description of the file content, and a list of tags described below:
14
15* `url` the url to download the file
16* `m` 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)
17* `"aes-256-gcm"` (optional) key and nonce for AES-GCM encryption with tagSize always 128bits
18* `x` containing the SHA-256 hexencoded string of the file.
19* `size` (optional) size of file in bytes
20* `dim` (optional) size of file in pixels in the form `<width>x<height>`
21* `magnet` (optional) URI to magnet file
22* `i` (optional) torrent infohash
23* `blurhash`(optional) the [blurhash](https://github.com/woltapp/blurhash) to show while the file is being loaded by the client
24
25```json
26{
27 "id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data>,
28 "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
29 "created_at": <unix timestamp in seconds>,
30 "kind": 1063,
31 "tags": [
32 ["url",<string with URI of file>],
33 ["aes-256-gcm",<key>, <iv>],
34 ["m", <MIME type>],
35 ["x",<Hash SHA-256>],
36 ["size", <size of file in bytes>],
37 ["dim", <size of file in pixels>],
38 ["magnet",<magnet URI> ],
39 ["i",<torrent infohash>],
40 ["blurhash", <value>]
41 ],
42 "content": <description>,
43 "sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field>
44}
45```
46
47## Suggested use cases
48
49* A relay for indexing shared files. For example, to promote torrents.
50* A pinterest-like client where people can share their portfolio and inspire others.
51* A simple way to distribute configurations and software updates.