NIPs by PolleramaCommunity NIPs, surfaced by trustConnect
npub1kg4sdvz3l4f...

Nostr mail large MIME support

Published Mar 17, 2026

Nostr Mail large MIME support

Overview

This specification defines how to handle large emails (MIME > 65KB) by storing encrypted MIME messages on Blossom servers. Small emails remain stored inline in the kind 1301 event content.

Motivation

NIP-44 encryption has a hard limit of 65535 bytes for plaintext messages.

Traditional emails can easily exceed this limit. This spec provides a hybrid approach:

  • Small emails (< 60KB): MIME stored inline in kind 1301 content field
  • Large emails (≥ 60KB): MIME encrypted with AES-GCM and stored on Blossom, kind 1301 contains reference + decryption key

This allows Nostr Mail to support emails of any size.

Event Kind 1301: Email

Inline MIME (small emails < 65KB)

{
  "kind": 1301,
  "pubkey": "<sender_npub>",
  "tags": [
    ["p", "<recipient_npub>"],
    ["subject", "Hello"],
    ["from", "[email protected]"],
    ["to", "[email protected]"],
    ["date", "1735401600"]
  ],
  "content": "From: [email protected]\nTo: [email protected]\nSubject: Hello\nDate: Sat, 28 Dec 2024 12:00:00 +0000\n\nHey Bob!"
}

Blossom MIME (large emails ≥ 65KB)

{
  "kind": 1301,
  "pubkey": "<sender_npub>",
  "tags": [
    ["p", "<recipient_npub>"],
    ["encryption-algorithm", "aes-gcm"],
    ["decryption-key", "<base64_key>"],
    ["decryption-nonce", "<base64_nonce>"],
    ["x", "<sha256_hash>"],
    ["subject", "Hello"],
    ["from", "[email protected]"],
    ["to", "[email protected]"],
    ["date", "1735401600"]
  ],
  "content": ""
}

Tags

TagRequiredDescription
pYesRecipient pubkey (or bridge pubkey)
encryption-algorithmConditionalEncryption algorithm aes-gcm (only for Blossom MIME)
decryption-keyConditionalThe decryption key (only for Blossom MIME)
decryption-nonceConditionalThe decryption nonce (only for Blossom MIME)
xConditionalSHA-256 hex of encrypted MIME (only for Blossom MIME)
subjectNoEmail subject
fromNoFrom address
toNoTo address
dateNoEmail timestamp (Unix epoch)

Detection

Clients detect the storage mode:

ConditionModeAction
content non-emptyInline MIMEParse content directly
content empty, x tag existsBlossom MIMEDownload from Blossom, then decrypt

Encryption Scheme

Inline MIME (small emails)

MIME is stored in plaintext in the content field.

Blossom MIME (large emails)

The MIME content is encrypted using AES-GCM.

RFC 2822 MIME message
    ↓
Generate random 256-bit key and 96-bit nonce
    ↓
AES-GCM Encrypt (key, nonce, mime_bytes)
    ↓
Encrypted MIME blob
    ↓
Upload to recipient Blossom servers
    ↓
Create kind 1301 with x tag + decryption key + nonce