`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", <repositoryidentifier> ],
[ "t", <revisiontitle>]
],
"content": <uniqueidenticator>
}
```
### 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", <repositoryowner> ],
[ "b", <repositoryidentifier> ]
],
...
```
### 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", <repositoryowner> ],
[ "b", <repositoryidentifier> ],
[ "c", <title> ]
],
"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", <repositoryowner> ],
[ "b", <repositoryidentifier> ],
[ "m", <title> ]
],
"content": <uniqueindicator>
}
```
### 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.
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`.