From 8da7f7e4517e48cecf19edd59376f900c04f5bb6 Mon Sep 17 00:00:00 2001 From: KaffinPX <73744616+KaffinPX@users.noreply.github.com> Date: Wed, 21 Jun 2023 20:43:06 +0300 Subject: [PATCH] updated fostr NIP for next PR --- 96.md | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 96.md diff --git a/96.md b/96.md new file mode 100644 index 00000000..8ae1a2a8 --- /dev/null +++ b/96.md @@ -0,0 +1,115 @@ +NIP-96 +====== + +File distribution over Nostr +---------------------- + +`draft` `optional` `author: KaffinPX and Not Thomiz` + +This NIP defines a way to distribute files over nostr by using it as transport and organizer layer. We could implement it for solutions like Git but their scheme is not compatible with async networks like nostr because of their commit chain, if one commit is missing we cant build latest state of files. This NIP will consider every commitment as revision which will include latest state of files and won't keep state on nostr but just an unique indicator(an integrity proof) for file. + +## Definition of a File Distribution Event + +`kind: 96` uses the `b` tag to identify the base repository, MAY contain a `t` tag to be used as title or description of revision. + +By default its an event for committing a revision. The `content` of a file distribution event MUST contain an unique indicator as text for file(s) like an IPFS CID or Torrent so clients can get & verify actual files by it. + +```json +{ + "kind": 96, + "tags": [ + [ "b", ], + [ "t", ] + ], + "content": +} +``` + +### Interacting with Other Repositories + +A file distribution event MUST contain a `p` tag indicating public key if it's not interacting with an owned repository. + +```json +{ + "kind": 96, + "tags": [ + [ "p", ], + [ "b", ] + ], + ... +``` + +### Threads(Issues) + +A file distribution event MAY contain a `c` tag to indicating the event is specific to creating a thread. If present, the `c` tag SHALL define title of the thread. + +The `content` of it MUST contain a comment as text. + +```json +{ + "kind": 96, + "tags": [ + [ "p", ], + [ "b", ], + [ "c", ] + ], + "content": <comment> +} +``` + +### Merge Requests + +A file distribution event MAY contain a `m` tag indicating the event is specific to creating a merge request. If present, the `m` tag SHALL define the title of pull request. + +The `content` of it MUST contain an unique indicator as text for file(s) to be merged. + +```json +{ + "kind": 96, + "tags": [ + [ "p", <repository owner> ], + [ "b", <repository identifier> ], + [ "m", <title> ] + ], + "content": <unique indicator> +} +``` + +### Comments + +A file distribution event MAY contain an `e` tag indicating the event is specific to commenting on a thread/merge request. If present, the `e` tag MUST define an event id of thread. + +The `content` of it MUST contain a comment as text. + +```json +{ + "kind": 96, + "tags": [ + [ "p", <repository owner> ], + [ "b", <repository identifier> ], + [ "e", <event id> ] + ], + "content": <comment> +} +``` + +### Management + +A comment event may contain a `s` tag indicating the event is specific to changing state of a thread or merge request. If present, the `s` tag MUST be `OPEN` or `CLOSE`. + +Only considered valid if used by thread or merge request owner or by the repository owner. + +The `content` of it MUST contain a comment as text. + +```json +{ + "kind": 96, + "tags": [ + [ "p", <repository owner> ], + [ "b", <repository identifier> ], + [ "e", <event id> ], + [ "s", <state> ] + ], + "content": <comment> +} +``` \ No newline at end of file