NIP-FSF: Free Speech Flags
kind 32239
draft optional
Kind 32239 — Free Speech Flag
An addressable event that encodes a "Free Speech Flag" — a visual flag whose vertical stripes are determined by the RGB values of a byte sequence.
Event Structure
{
"kind": 32239,
"content": "<human-readable title or description>",
"tags": [
["d", "<unique identifier, e.g. nanoid or hash>"],
["title", "<flag title>"],
["data", "<hex-encoded byte sequence>"],
["encoding", "text" | "hex"],
["source", "<original text if encoding=text, else same as data>"],
["blossom", "<blossom URL of SVG file (optional)>"],
["alt", "Free Speech Flag: <title>"]
]
}Field Descriptions
| Tag | Required | Description |
|---|---|---|
d | yes | Unique identifier for this flag (nanoid or SHA-256 of data) |
title | yes | Human-readable name for the flag |
data | yes | Lowercase hex-encoded byte sequence that defines the flag's colors |
encoding | yes | "text" if source was UTF-8 text, "hex" if entered as raw hex |
source | no | Original text input (only when encoding=text). Omitted if sensitive. |
blossom | no | URL to Blossom-hosted SVG of the rendered flag |
alt | yes | NIP-31 human-readable alternative (required for all custom kinds) |
Flag Rendering Algorithm
- Decode
datatag value as hex bytes. - Group bytes in chunks of 3. Each chunk → one vertical stripe with
rgb(b[0], b[1], b[2]). - If
bytes.length % 3 !== 0, the remaining 1 or 2 bytes are shown as a hex string (e.g.+C0or+B2 C2) in the bottom-right corner of the last stripe, in white or black text depending on contrast. - All stripes have equal width. The flag aspect ratio is 8:5 (standard flag ratio).
Example
Encoding 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0 (the HD DVD processing key):
- 5 full stripes (15 bytes → 5 × RGB)
- Remaining byte:
C0 - Bottom-right shows
+C0
Querying
// All flags
nostr.query([{ kinds: [32239], limit: 50 }])
// Flags by a specific author
nostr.query([{ kinds: [32239], authors: [pubkey], limit: 50 }])Deletion
Authors may delete their flag by publishing a NIP-09 deletion event (kind 5) referencing the flag's event ID or the a tag coordinate (32239:<pubkey>:<d-tag>).
Notes on Ephemeral Publishing
Clients may publish flags using ephemeral (one-time) keypairs. Each new flag can use a fresh keypair for privacy. The keypair should be stored locally so the author can later delete or edit the flag.