{"id":"36596e53e7b59714fe0163b55f56b458520d9ac9eae84eb369ab399ed441d4cf","pubkey":"b22b06b051fd5232966a9344a634d956c3dc33a7f5ecdcad9ed11ddc4120a7f2","created_at":1776713251,"kind":30817,"tags":[["d","nostr-mail-settings"],["title","Nostr mail settings"],["k","30078"],["client","nostrhub.io"]],"content":"# Nostr Mail Settings\n\nThis document defines the protocol for storing and synchronizing user settings across devices in Nostr Mail using NIP-78 application-specific data.\n\n## Overview\n\nUser settings are stored as replaceable parameterized events (kind 30078). This enables seamless synchronization across multiple devices while maintaining privacy through encryption.\n\n## Event Kind\n\n### Kind 30078: Application-Specific Data\n\nSettings use NIP-78 replaceable parameterized events with the `d` tag for namespacing.\n\n## Public Settings\n\nPublic settings are stored unencrypted and can be read by anyone.\n\n```json\n{\n  \"kind\": 30078,\n  \"pubkey\": \"<user_pubkey>\",\n  \"tags\": [[\"d\", \"nostr-mail/settings\"]],\n  \"content\": \"{\\\"dm_copy\\\": true}\"\n}\n```\n\n### Fields\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `dm_copy` | boolean | Request bridges to send a DM copy of incoming emails |\n\n## Private Settings\n\nPrivate settings MUST be encrypted to self using NIP-44.\n\n```json\n{\n  \"kind\": 30078,\n  \"pubkey\": \"<user_pubkey>\",\n  \"tags\": [[\"d\", \"nostr-mail/settings/private\"]],\n  \"content\": \"<nip44_encrypted_json>\"\n}\n```\n\n### Decrypted Content\n\nAfter decryption, the content contains:\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `signature` | string | Email signature appended to outgoing emails |\n| `bridges` | string[] | List of preferred bridge domains |\n| `identities` | string[] | List of user-defined \"From\" identities in RFC 2822 format |\n\n### Identities\n\nIdentities are user-defined \"From\" addresses stored as RFC 5322 formatted strings. Each entry can be used directly in the `From:` header without any transformation.\n\n**Format examples:**\n- `\"Alice Real <npub1abc...@nostr.mail>\"` — name + address\n- `\"npub1abc...@bridge.com\"` — address only (no name)\n- `\"Pseudo <alice@example.com>\"` — custom name + legacy email\n\n**Behavior:**\n- If `identities` is empty or absent, clients SHOULD auto-generate available addresses from `npub@nostr` and configured bridges\n- The **first identity** (index 0) is the default \"From\" address\n\n### Example (Decrypted)\n\n```json\n{\n  \"signature\": \"Sent via Nostr Mail\",\n  \"bridges\": [\"nostr.mail\", \"bridge.example.com\"],\n  \"identities\": [\n    \"Alice Real <npub1abc...@nostr.mail>\",\n    \"<npub1abc...@bridge.com>\",\n    \"Pseudo <alice@example.com>\"\n  ]\n}\n```\n\n### Example (Encrypted Event)\n\n```json\n{\n  \"kind\": 30078,\n  \"tags\": [[\"d\", \"nostr-mail/settings/private\"]],\n  \"content\": \"<nip44_encrypted_blob>\"\n}\n```","sig":"55275e943fc19844d29d964e98b86c353e3d48428087a888e391b8c8e607dd85f418e98240b36fca56bb34dc68881d62f45370c3e7b1641b5d61503462af0b8a"}