NIPs by PolleramaCommunity NIPs, surfaced by trustConnect
npub1scvyzz02aym...

Personal Letters

Published Oct 16, 2026
kind 8211 ยท Personal Letters

NIP: Personal Letters (Kind 8211)

Motivation

Existing encrypted messaging on Nostr (NIP-04, NIP-17) is designed for chat-style conversations: fast, ephemeral, back-and-forth. This NIP defines a different interaction pattern: crafted, visual, one-off letters with decorative presentation, closer to physical postcards than instant messages. A letter carries not just text but the sender's choice of stationery, frame, font, and hand-placed stickers, all encrypted so only the recipient sees the full composition.

Summary

Kind 8211 is a regular event for sending encrypted personal letters between Nostr users. The entire letter (text, visual presentation, stickers) is encrypted using NIP-44 and stored in the content field. Only the recipient p tag and an alt fallback are stored in cleartext.

Privacy Model

Unlike NIP-17/NIP-59, this scheme does not hide sender/recipient metadata or provide deniability. The event's pubkey identifies the sender and the cleartext p tag identifies the recipient. Timestamps are real. This is intentional: letters are a visible act of correspondence, analogous to a physical postcard where the addresses are on the outside but the content is private. The letter's entire visual presentation (stationery, stickers, text, font) is inside the NIP-44 encrypted payload and visible only to the sender and recipient.

Clients MAY wrap kind 8211 events in NIP-59 gift wraps for users who want metadata privacy, but this is not required by the protocol.

Event Structure

{
  "kind": 8211,
  "content": "<NIP-44 encrypted JSON>",
  "tags": [
    ["p", "<recipient-pubkey-hex>"],
    ["alt", "Personal letter"]
  ]
}

Tags

TagRequiredDescription
pYesRecipient pubkey (hex). NIP-44 encryption target.
altYesNIP-31 fallback: "Personal letter"

No other tags are used. All letter data is inside the encrypted content.

Encrypted Content

The content field is a NIP-44 encrypted JSON string. When decrypted with the counterparty's pubkey it yields:

{
  "body": "Dear friend,\n\nI wanted to write you...",
  "closing": "With love,",
  "signature": "Alice",
  "stickers": [
    {
      "url": "https://example.com/sticker.png",
      "shortcode": "heart_eyes",
      "x": 75,
      "y": 20,
      "rotation": 12,
      "scale": 1.5
    },
    {
      "url": "",
      "shortcode": "drawing",
      "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"42 58 120 95\"><path d=\"M50,60Q55.2,68.1,60,80L65,85\" fill=\"none\" stroke=\"#1a1a1a\" stroke-width=\"6\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>",
      "x": 30,
      "y": 65,
      "rotation": -5
    },
    {
      "url": "",
      "shortcode": "emoji",
      "emoji": "๐ŸŒธ",
      "x": 50,
      "y": 85,
      "rotation": 8
    }
  ],
  "stationery": {
    "color": "#C8E6C9",
    "fontFamily": "Caveat, cursive",
    "frame": "flowers",
    "frameTint": true,
    "event": { "kind": 3367, "id": "<hex>", "pubkey": "<hex>", "sig": "<hex>", "created_at": 1234567890, "content": "๐ŸŒฟ", "tags": [["c", "#C8E6C9"], ["c", "#A5D6A7"], ["c", "#81C784"], ["layout", "horizontal"]] }
  },
  "seal": {
    "color": "#9B1B30",
    "emblem": { "type": "icon", "value": "heart" }
  }
}

At least one of body (non-empty string) or stickers (non-empty array) MUST be present. A letter with neither is invalid and clients SHOULD discard it.

FieldRequiredDescription
bodyYesMain letter text. Always present; may be an empty string "" for sticker-only letters. Clients SHOULD limit to 220 characters. May contain newlines.
closingNoClosing phrase (e.g. "With love,", "Warmly,")
signatureNoSender's chosen display name or signature
stickersConditionalArray of stickers placed on the letter card. Required if body is empty.
stationeryNoVisual stationery. See Stationery Object below.
sealNoWax seal on the envelope. See Seal Object below.

Sticker Object

Each sticker in the stickers array has the following fields:

FieldRequiredDescription
urlYesImage URL of the sticker. Empty string "" for drawn and native emoji stickers.
shortcodeYesNIP-30 shortcode name (without colons), "drawing" for hand-drawn SVG stickers, or "emoji" for native emoji stickers.
xYesHorizontal position as percentage (0-100) from the left edge
yYesVertical position as percentage (0-100) from the top edge
rotationYesRotation in degrees (-180 to 180)
scaleNoScale multiplier (default 1). Range 0.5-4.
svgNoRaw SVG markup string for hand-drawn stickers. When present, clients render this inline instead of loading url.
emojiNoA single Unicode emoji sequence for native emoji stickers. When present, clients render it as text instead of loading url.

Stickers come in three forms:

Custom emoji stickers are sourced from NIP-30 custom emoji packs. The sender's kind 10030 emoji list references kind 30030 emoji packs; emojis from both inline tags and referenced packs are available. They have a url pointing to an image and a shortcode identifying the emoji.

Drawn stickers are freehand SVG drawings created by the sender. They have shortcode: "drawing", url: "", and an svg field containing a self-contained SVG element string (with xmlns, viewBox, and <path> elements). The SVG is tightly cropped to the drawing's bounding box. Clients SHOULD render the SVG inline at the sticker's position and size. Points in the SVG paths are simplified with Ramer-Douglas-Peucker to keep the markup compact. Clients SHOULD sanitize SVG markup before rendering to prevent script injection from malformed payloads.

Native emoji stickers are regular Unicode emoji (including ZWJ sequences, skin tones and keycaps). They have shortcode: "emoji", url: "", and an emoji field. Clients SHOULD render the emoji as text sized to fill the sticker box, and SHOULD strip any non-emoji characters before rendering. Clients that don't support this form will see an empty url and skip the sticker.

Clients SHOULD render all forms absolutely positioned on top of the letter card at the specified coordinates, with the given rotation and scale applied. Because stickers are inside the encrypted content, they are only visible to the sender and recipient.

Note: Custom emoji sticker URLs reference external images with no content hash. The image at a URL could change after the letter is sent. NIP-30 emoji tags do not currently carry integrity metadata, so hash verification is not practical without fetching and hashing at compose time. Drawn stickers do not have this issue since the SVG data is self-contained.

Stationery Object

The stationery field carries user-chosen presentation options and an optional source event. When the source event is present, clients SHOULD read rendering attributes (palette colors, text color, background image, etc.) from the event's tags rather than expecting them as flat fields.

FieldRequiredDescription
colorYesBackground color (hex). Always present.
emojiNoEmoji character for backsplash or emblem display.
emojiModeNo"tile" (faint repeating pattern) or "emblem" (single large centered glyph). Default: "tile".
fontFamilyNoCSS font-family string (e.g. "Caveat, cursive"). Applied to all letter text.
frameNoFrame style ID. See Frame Styles below.
frameTintNoWhen true, color-shift the frame emojis to match the stationery palette.
eventNoSource Nostr event (kind 36767 theme or kind 3367 color moment). See Source Event below.
Source Event

When present, event is a complete signed Nostr event JSON object. Clients read rendering attributes directly from its tags:

  • Kind 3367 (Color Moment): c tags contain hex palette colors, optional layout tag, optional emoji in the content field. The stationery's emoji field takes precedence; the event content is used as a fallback only when emoji is not set on the stationery object.
  • Kind 36767 (Theme Definition): c tags with markers (background, text, primary), optional bg tag (background image URL and mode), title tag.

Presets (built-in stationery) have no source event, only color and optionally emoji.

Frame Styles

The frame field is a string ID selecting a decorative emoji border around the letter card. Clients MAY support any set of frame IDs; see Appendix A for suggested defaults. If a client encounters an unrecognized frame ID, it SHOULD fall back to "none".

When frameTint is true, clients SHOULD darken the frame background from the stationery's dominant color and shift the emoji hues to match the palette. The tint color is derived from: the primary color from a theme event's c tags if present, the first palette color from a color moment event's c tags if present, or the background color otherwise. When frameTint is absent or false, the frame's default background and natural emoji colors SHOULD be used.

Font

The fontFamily field is a CSS font-family string. Clients SHOULD apply it to all letter text. If the font is unavailable, clients SHOULD fall back to their default font.

Seal Object

The seal field describes the wax seal pressed onto the envelope. Clients SHOULD show it on the closed letter (e.g. on the envelope in an inbox list) so the recipient sees it before opening.

FieldRequiredDescription
colorYesWax color (#RRGGBB hex).
emblemYesObject with type and value, the design pressed into the wax.

Emblem types:

typevalue
iconA built-in stamp ID: leaf, heart, star, moon, flower, crown, sun, treasures, espy, ditto, surveil, nostrdamus.
emojiA single Unicode emoji sequence. Clients SHOULD strip non-emoji characters and SHOULD render it tinted to the wax color so it reads as an impression.
initials1โ€“3 characters, rendered as a monogram. Clients SHOULD truncate longer values.

The last five stamps are earned in the reference client by having published with another Nostr app: treasures (kinds 37516, 7516, 7517), espy (3367), ditto (themes: 36767, 16767), surveil (37381), nostrdamus (2256). Unlocking is a sender-side choice only; recipients SHOULD render any known stamp without checking it.

Clients SHOULD discard a seal with an invalid color, an unknown emblem type, an unknown icon ID, or an empty value. When seal is absent or invalid, clients SHOULD show their default seal (the reference implementation uses { "color": "#438060", "emblem": { "type": "icon", "value": "leaf" } }).

Card Dimensions

Clients SHOULD render letters as physical postcards with a fixed 5:4 landscape aspect ratio. The card is a self-contained visual object, not a reflowing text document. It scales like a physical object: all internal sizing SHOULD use proportional units so the card renders uniformly at any display size.

PropertyValueNotes
Aspect ratio5:4Landscape orientation, like a postcard
Body max chars220Clients SHOULD enforce this limit

Stickers are positioned as percentage coordinates relative to the card bounds. The closing and signature sit at the bottom-right. Clients SHOULD preserve this spatial layout rather than reflowing content into a different shape. See Appendix B for reference sizing values.

Text Color Rendering

Clients SHOULD derive letter body text color from the stationery:

  • Theme (event kind 36767): use the text color from the event's c tags directly.
  • Color moment (event kind 3367): average WCAG 2.1 relative luminance across the palette colors from the event's c tags. If avg > 0.5, use dark text; else use light text.
  • Preset or no event: WCAG luminance of color. If > 0.5, use dark text; else use light text.

Ruled lines on the letter SHOULD use the same light/dark logic at reduced opacity.

Client Behavior

Sending

  1. Build the stationery object from the user's selection. For color moments (kind 3367), include the source event and set color from its first c tag. For themes (kind 36767), include the source event and set color from the c tag with marker background.
  2. Merge the user's font and frame choices into the stationery.
  3. Compose the encrypted content object: body (always present, may be empty string), plus optional closing, signature, stickers, stationery, seal.
  4. Encrypt the JSON with NIP-44 using the recipient's pubkey.
  5. Publish kind 8211 with p and alt tags.
  6. Publish to the sender's NIP-65 write relays and the recipient's NIP-65 read relays (outbox model), so the letter arrives even when the two share no relay. If the recipient has no kind 10002 list, clients SHOULD fall back to a set of well-known default relays.

Receiving

  1. Query { kinds: [8211], "#p": ["<my-pubkey>"] } on the user's NIP-65 read relays for inbox.
  2. Query { kinds: [8211], authors: ["<my-pubkey>"] } for sent.
  3. Decrypt content with NIP-44 using the counterparty's pubkey.
  4. Extract body, closing, signature, and stickers for letter text rendering.
  5. If stationery is present, render the background using its attributes. Apply fontFamily if provided.
  6. Apply frame and frameTint from the stationery if present.
  7. Show the seal on the closed envelope, falling back to the default seal if absent or invalid.
  8. If stickers array is present, render each sticker absolutely positioned on top of the letter card at the specified (x, y) percentage coordinates with the given rotation and scale. For custom emoji stickers, load the image from url. For drawn stickers (where svg is present), render the SVG markup inline. For native emoji stickers (where emoji is present), render the emoji as text.

Synced Preferences (client-specific)

The reference client stores each user's letter defaults (font, stationery, frame, closing, signature, default seal) as a NIP-78 app data event so they follow the user across devices. This is not part of the letter protocol and other clients need not read it.

{
  "kind": 30078,
  "content": "<NIP-44 encrypted JSON, encrypted to the author's own pubkey>",
  "tags": [["d", "lief/letter-prefs"]]
}

The decrypted JSON is an object with optional keys font, stationery, frame, frameTint, closing, signature, friendsOnlyInbox, friendsOnlySearch and seal (a Seal Object). Clients keep a local copy and use whichever is newer, comparing the event's created_at with the time of the last local edit.


Appendix A: Suggested Frame Catalog

The following frame IDs are suggested defaults. Clients MAY support additional frames or a subset of these.

Frame IDEmojisDefault Background
noneNo frame (plain)--
flowers๐ŸŒธ๐ŸŒบ๐ŸŒผ๐ŸŒท๐ŸŒป๐ŸŒน#3a7a3a
autumn๐Ÿ‚๐Ÿ๐Ÿƒ๐ŸŒพ๐Ÿ„๐ŸŒฐ#8b5e3c
ocean๐Ÿš๐ŸŒŠ๐Ÿ ๐Ÿ™๐Ÿฆ€๐Ÿฌ#1a5276
celestial๐Ÿช๐ŸŒ™โญ๐ŸŒ•โ˜„๏ธ๐Ÿ”ญ#1a1a3e
heartsโค๏ธ๐Ÿ’•๐Ÿ’—๐Ÿ’–๐Ÿ’๐Ÿ’˜#8b2252
garden๐Ÿฆ‹๐Ÿ๐ŸŒฟ๐ŸŒฑ๐Ÿž๐Ÿ€#2d5a27
winterโ„๏ธโ›„๐ŸŒจ๏ธ๐Ÿ”๏ธ๐ŸŽฟ๐Ÿงฃ#4a6d8c
fruit๐ŸŠ๐Ÿ‹๐Ÿ“๐Ÿ‘๐Ÿ’๐Ÿซ#6b4226
sparkleโœจ๐Ÿ’Ž๐Ÿ”ฎ๐Ÿชฉโšก๐ŸŒˆ#4a2d6b

Appendix B: Reference Implementation Sizing

The following values are used by the reference web implementation (CSS container query units). Native clients SHOULD achieve equivalent proportions using platform-appropriate units.

PropertyReference ValueNotes
Body font size~4.8cqwContainer query width units; yields ~25 characters per line
Line height~8.4cqwProduces ruled-notebook-style line spacing
Padding~5cqwAll sides

The intent is that the card reads like a small physical postcard (~5" x 4") with handwritten text. Font size and line height should scale proportionally with card width so the layout is consistent across display sizes. When frameTint is true, the reference implementation uses a CSS mix-blend-mode: color overlay to shift frame emoji hues to the stationery palette.