Skip to content
Open
Show file tree
Hide file tree
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
28 changes: 28 additions & 0 deletions M4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
NIP-M4
======

Email
-----

`draft` `optional`

Email over Nostr: a standard [RFC 2822](https://www.rfc-editor.org/rfc/rfc2822) MIME message carried in the `content` of a `kind:322` event, using Nostr as transport instead of SMTP. A Nostr user's address is `<npub>@nostr`.

## Delivery

- **Private (default):** build the `kind:322` as an unsigned rumor and [NIP-59](59.md) gift-wrap it to each recipient and to self, published to the recipient's [NIP-17](17.md) `kind:10050` DM relays. The rumor MAY be signed to prove authorship to third parties.
- **Public:** publish a signed `kind:322` directly to [NIP-65](65.md) relays. BCC recipients are notified privately with a gift-wrapped copy carrying a `["public-ref", "<event-id>", "<relay-url>"]` tag pointing to the public event.

```json
{
"kind": 322,
"content": "From: npub1alice...@nostr\r\nTo: npub1bob...@nostr\r\nSubject: Hi\r\n\r\nHey Bob"
}
```

## Bridges (legacy email)

A bridge relays to and from legacy SMTP email and is discovered via [NIP-05](05.md) at `_smtp@<domain>`.

- **Outbound (Nostr → SMTP):** gift-wrap the `kind:322` to the bridge's pubkey with `mail-from` and `rcpt-to` tags (multiple `rcpt-to` tags for several recipients). The bridge delivers via SMTP.
- **Inbound (SMTP → Nostr):** the bridge builds the `kind:322` rumor on the sender's behalf and gift-wraps it to the recipient, setting `mail-from` to the legacy sender address so the recipient can tell it apart from a direct Nostr email.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ NIPs listed here are not a protocol checklist. Nothing forces any software to im
- [NIP-CC: Geocaching](CC.md)
- ~~[NIP-EE: E2EE Messaging using MLS Protocol](EE.md) --- **unrecommended**: superseded by the [Marmot Protocol](https://github.com/marmot-protocol/marmot)~~
- [NIP-F4: Podcasts](F4.md)
- [NIP-M4: Email](M4.md)

## Event Kinds

Expand Down Expand Up @@ -155,6 +156,7 @@ This table is not exhaustive. For a machine-readable registry of all known event
| `62` | Request to Vanish | [62](62.md) |
| `64` | Chess (PGN) | [64](64.md) |
| `78` | Application-specific Data | [78](78.md) |
| `322` | Email | [M4](M4.md) |
| `443` | KeyPackage | [Marmot](marmot) |
| `444` | Welcome Message | [Marmot](marmot) |
| `445` | Group Event | [Marmot](marmot) |
Expand Down