diff options
Diffstat (limited to '94.md')
| -rw-r--r-- | 94.md | 16 |
1 files changed, 7 insertions, 9 deletions
| @@ -4,9 +4,9 @@ NIP-94 | |||
| 4 | File Metadata | 4 | File Metadata |
| 5 | ------------- | 5 | ------------- |
| 6 | 6 | ||
| 7 | `draft` `optional` `author:frbitten` `author:kieran` `author:lovvtide` `author:fiatjaf` `author:staab` | 7 | `draft` `optional` |
| 8 | 8 | ||
| 9 | The 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. | 9 | The 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 | 10 | ||
| 11 | ## Event format | 11 | ## Event format |
| 12 | 12 | ||
| @@ -14,8 +14,8 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr | |||
| 14 | 14 | ||
| 15 | * `url` the url to download the file | 15 | * `url` the url to download the file |
| 16 | * `m` a string indicating the data type of the file. The [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) format must be used, and they should be lowercase. | 16 | * `m` a string indicating the data type of the file. The [MIME types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types) format must be used, and they should be lowercase. |
| 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. | 17 | * `x` containing the SHA-256 hexencoded string of the file. |
| 18 | * `ox` containing the SHA-256 hexencoded string of the original file, before any transformations done by the upload server | ||
| 19 | * `size` (optional) size of file in bytes | 19 | * `size` (optional) size of file in bytes |
| 20 | * `dim` (optional) size of file in pixels in the form `<width>x<height>` | 20 | * `dim` (optional) size of file in pixels in the form `<width>x<height>` |
| 21 | * `magnet` (optional) URI to magnet file | 21 | * `magnet` (optional) URI to magnet file |
| @@ -25,18 +25,16 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr | |||
| 25 | * `image` (optional) url of preview image with same dimensions | 25 | * `image` (optional) url of preview image with same dimensions |
| 26 | * `summary` (optional) text excerpt | 26 | * `summary` (optional) text excerpt |
| 27 | * `alt` (optional) description for accessibility | 27 | * `alt` (optional) description for accessibility |
| 28 | * `fallback` (optional) zero or more fallback file sources in case `url` fails | ||
| 28 | 29 | ||
| 29 | ```json | 30 | ```json |
| 30 | { | 31 | { |
| 31 | "id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data>, | ||
| 32 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, | ||
| 33 | "created_at": <unix timestamp in seconds>, | ||
| 34 | "kind": 1063, | 32 | "kind": 1063, |
| 35 | "tags": [ | 33 | "tags": [ |
| 36 | ["url",<string with URI of file>], | 34 | ["url",<string with URI of file>], |
| 37 | ["aes-256-gcm",<key>, <iv>], | ||
| 38 | ["m", <MIME type>], | 35 | ["m", <MIME type>], |
| 39 | ["x",<Hash SHA-256>], | 36 | ["x",<Hash SHA-256>], |
| 37 | ["ox",<Hash SHA-256>], | ||
| 40 | ["size", <size of file in bytes>], | 38 | ["size", <size of file in bytes>], |
| 41 | ["dim", <size of file in pixels>], | 39 | ["dim", <size of file in pixels>], |
| 42 | ["magnet",<magnet URI> ], | 40 | ["magnet",<magnet URI> ], |
| @@ -47,8 +45,8 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr | |||
| 47 | ["summary", <excerpt>], | 45 | ["summary", <excerpt>], |
| 48 | ["alt", <description>] | 46 | ["alt", <description>] |
| 49 | ], | 47 | ], |
| 50 | "content": <caption>, | 48 | "content": "<caption>", |
| 51 | "sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field> | 49 | ... |
| 52 | } | 50 | } |
| 53 | ``` | 51 | ``` |
| 54 | 52 | ||