Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create NIP for mail events #84

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions N.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
NIP-N
======

Mail messages
------------

`draft` `optional` `author:arejula27`

This NIP defines new event kinds for encrypted messages. It work in the same way as NIP-04,but the structure
of the content is different. For mail app we `MUST`use the kind `N`


**`content`** MUST be equal to the base64-encoded, aes-256-cbc encrypted string of anything a user wants to write, encrypted using a shared cipher
generated by combining the recipient's public-key with the sender's private-key; this appended by the base64-encoded initialization vector as if it
was a querystring parameter named "iv". The format is the following: `"content": "<encrypted_text>?iv=<initialization_vector>"`. The encripted text
has the following format: `{subject:<subject>, content:<content>}`

**`tags`** MUST contain an entry identifying the receiver of the message (such that relays may naturally forward this event to them), in the form `["p", "<pubkey, as a hex string>"]`.

**`tags`** MAY contain a entry indetifying the prevoious mail which is repliying in the form `["e", "<event_id>"]`.


A mail can be replied by other mail which MUST have a tag

## Intereact with the mails
As we cant modify the events make by other people we `MAY` intereact with kind `N+1`.
**`content`** `MAY` be encoded as kind `N`messages, but in this case is optional. The content must be all the interactions we must have encoded as Json:
- Read(bool): if the mail has been open or not, false by default.
- Labels(string[]): if the mail has some labels (spam, university, job,etc..). By default it is empty.
**`tags`** `MUST` contain a entry indetifying the mail which is interacting `["e", "<event_id>"]`.