12<html lang="en">3<head>4<meta charset="utf-8">5<meta name="viewport" content="width=device-width, initial-scale=1">6<title>NIP-36 - Sensitive Content / Content Warning — Nostr Instruction Manual</title>7<meta name="description" content="NIP-36: the content-warning tag. Mark sensitive events so clients hide the content until the reader approves. Complete manual page.">8<link rel="preload" href="../assets/fonts/michroma-400-latin.woff2" as="font" type="font/woff2" crossorigin>9<link rel="preload" href="../assets/fonts/exo2-var-latin.woff2" as="font" type="font/woff2" crossorigin>10<link rel="preload" href="../assets/fonts/sairacondensed-600-latin.woff2" as="font" type="font/woff2" crossorigin>11<link rel="preload" href="../assets/fonts/sairacondensed-700-latin.woff2" as="font" type="font/woff2" crossorigin>12<link rel="preload" href="../assets/fonts/sairacondensed-500-latin.woff2" as="font" type="font/woff2" crossorigin>13<link rel="preload" href="../assets/fonts/sharetechmono-400-latin.woff2" as="font" type="font/woff2" crossorigin>14<link rel="preload" href="../assets/fonts/exo2-400i-latin.woff2" as="font" type="font/woff2" crossorigin>15<link rel="icon" href="../assets/favicon.svg" type="image/svg+xml">16<link rel="stylesheet" href="../assets/manual.css">17</head>18<body>1920<svg width="0" height="0" style="position:absolute">21 <defs>22 <marker id="arr" markerWidth="9" markerHeight="9" refX="7" refY="4.5" orient="auto">23 <path d="M1,1 L8,4.5 L1,8 Z" fill="#f26a00"/>24 </marker>25 <marker id="arrb" markerWidth="9" markerHeight="9" refX="7" refY="4.5" orient="auto">26 <path d="M1,1 L8,4.5 L1,8 Z" fill="#2e5f9e"/>27 </marker>28 </defs>29</svg>3031<div class="page">32 <span class="staple s1"></span><span class="staple s2"></span>3334 <header class="band">35 <a class="logo" href="../index.html">NOSTR<b>▸</b>PROTOCOL MANUAL</a>36 <span class="booklet-note">Chapter 36 - Moderation</span>37 </header>38 <nav class="tabs">39 <a href="../index.html">Contents</a>40 <a href="#overview" class="on">Overview</a>41 <a href="#spec">Spec</a>42 <a href="#examples">Examples</a>43 <a href="#history">History</a>44 </nav>4546 <div class="chapter">47 <div class="nipno" data-n="36">36</div>48 <div class="titles">49 <div class="kicker">Nostr Implementation Possibility - Hex № 36</div>50 <h1>Sensitive Content / Content Warning</h1>51 <p class="sub">One tag that tells clients: hide this content behind a warning until the reader chooses to see it.</p>52 </div>53 </div>5455 <main class="spread">56 <div class="main">5758 <h2 class="bar" id="overview"><span class="num">1</span> Overview</h2>59 <p>Some events carry content that not every reader wants to see at once. Nudity, violence, spoilers, or graphic news are common cases. This NIP gives authors a standard way to flag such an event.</p>60 <p>The author adds one tag to the event: <code>content-warning</code>. The tag says that the content needs approval by the reader before a client shows it. A client can hide the content until the user acts on it. The tag works on any event kind.</p>61 <p>The flag comes from the author, not from a relay or a moderator. It is a courtesy signal, not access control. The content itself stays in plain view inside the event.</p>6263 <div class="box hint">64 <span class="tag">Hint!</span>65 <p>A content warning helps your own reach. Readers who dislike surprises can still follow you. Their clients blur the sensitive posts and show everything else as normal.</p>66 </div>6768 <figure class="diagram">69 <div class="frame">70 <svg viewBox="0 0 560 150" role="img" aria-label="An event with a content-warning tag arrives at the client, the client hides the content, the user approves, the client shows the content">71 <rect class="d-actor" x="10" y="50" width="110" height="50" rx="8"/>72 <text class="d-actor-label" x="65" y="72" text-anchor="middle">Event</text>73 <text class="d-note" x="65" y="89" text-anchor="middle">content-warning</text>74 <rect class="d-actor" x="180" y="50" width="110" height="50" rx="8"/>75 <text class="d-actor-label" x="235" y="72" text-anchor="middle">Client</text>76 <text class="d-note" x="235" y="89" text-anchor="middle">hides content</text>77 <rect class="d-actor" x="350" y="50" width="90" height="50" rx="8"/>78 <text class="d-actor-label" x="395" y="72" text-anchor="middle">Reader</text>79 <text class="d-note" x="395" y="89" text-anchor="middle">taps "Show"</text>80 <rect class="d-actor" x="480" y="50" width="70" height="50" rx="8"/>81 <text class="d-actor-label" x="515" y="72" text-anchor="middle">Shown</text>82 <text class="d-note" x="515" y="89" text-anchor="middle">full view</text>83 <path class="d-msg d-flow" d="M122,75 L177,75"/>84 <path class="d-msg d-flow" d="M292,75 L347,75"/>85 <path class="d-msg blue d-flow" d="M442,75 L477,75"/>86 <circle r="4" fill="#f26a00">87 <animateMotion dur="2.6s" repeatCount="indefinite" path="M122,75 L177,75"/>88 </circle>89 </svg>90 </div>91 <figcaption>Fig. 36-1 — <b>The reveal flow.</b> The client hides flagged content until the reader approves it.</figcaption>92 </figure>9394 <h2 class="bar" id="spec"><span class="num">2</span> The content-warning Tag</h2>95 <p>The tag name is <code>content-warning</code>. The tag takes one optional value: a human-readable reason for the warning. This NIP defines no fixed reason vocabulary.</p>9697 <div class="crt">98 <div class="titlebar">Tag format - content-warning</div>99<pre>[<span class="s">"content-warning"</span>, <span class="c"><optional reason></span>]</pre>100 </div>101102 <div class="tscroll"><table class="ref">103 <caption>Tag reference</caption>104 <tr><th>Position</th><th>Value</th><th>Rule</th></tr>105 <tr><td class="btn">content-warning</td><td>tag name</td><td>Marks the event as sensitive. The reader must approve the content before a client shows it.</td></tr>106 <tr><td class="btn">reason</td><td>string</td><td>Optional. A free-text reason, for example <code>nudity</code> or <code>graphic violence</code>. Clients can show it on the warning screen.</td></tr>107 </table></div>108109 <div class="box tech">110 <span class="tag">Tech Note</span>111 <p><code>content-warning</code> is not a single-letter tag, so relays do not index it under <a href="01.html">NIP-01</a> rules. You cannot filter on it with a <code>#content-warning</code> key. For queryable warnings, use the <a href="32.html">NIP-32</a> labels in §3 and filter on <code>#l</code> or <code>#L</code>.</p>112 </div>113114 <h2 class="bar" id="labels"><span class="num">3</span> Labels with NIP-32</h2>115 <p>The <code>l</code> and <code>L</code> tags defined in <a href="32.html">NIP-32</a> may also be used on the same event. Use them with the <code>content-warning</code> namespace or with another namespace. Labels add two things that the bare tag lacks:</p>116 <ul>117 <li><strong>Qualification.</strong> A label states a precise category from a named vocabulary, for example <code>NS-nud</code> from the <code>social.nos.ontology</code> namespace.</li>118 <li><strong>Querying.</strong> <code>l</code> and <code>L</code> are single-letter tags. Relays index them, so clients can filter with <code>#l</code> and <code>#L</code>.</li>119 </ul>120 <div class="crt">121 <div class="titlebar">Label tags on a flagged event</div>122<pre>[<span class="s">"L"</span>, <span class="s">"content-warning"</span>] <span class="c">namespace declaration</span>123[<span class="s">"l"</span>, <span class="c"><reason></span>, <span class="s">"content-warning"</span>] <span class="c">label in that namespace</span>124[<span class="s">"L"</span>, <span class="s">"social.nos.ontology"</span>] <span class="c">another vocabulary</span>125[<span class="s">"l"</span>, <span class="s">"NS-nud"</span>, <span class="s">"social.nos.ontology"</span>]</pre>126 </div>127 <p>Labels do not replace the <code>content-warning</code> tag. Keep the tag on the event so simple clients still hide the content.</p>128129 <h2 class="bar" id="examples"><span class="num">4</span> Worked Example</h2>130 <p>The event below is a kind-1 text note with a hashtag. The author flags it as sensitive, gives a reason, and adds <a href="32.html">NIP-32</a> labels in two namespaces.</p>131 <div class="crt">132 <div class="titlebar">Flagged kind-1 note</div>133<pre>{134 <span class="k">"id"</span>: <span class="c"><event-id></span>,135 <span class="k">"pubkey"</span>: <span class="c"><pub-key></span>,136 <span class="k">"created_at"</span>: <span class="s">1000000000</span>,137 <span class="k">"kind"</span>: <span class="s">1</span>,138 <span class="k">"tags"</span>: [139 [<span class="s">"t"</span>, <span class="s">"hastag"</span>],140 [<span class="s">"L"</span>, <span class="s">"content-warning"</span>],141 [<span class="s">"l"</span>, <span class="s">"reason"</span>, <span class="s">"content-warning"</span>],142 [<span class="s">"L"</span>, <span class="s">"social.nos.ontology"</span>],143 [<span class="s">"l"</span>, <span class="s">"NS-nud"</span>, <span class="s">"social.nos.ontology"</span>],144 [<span class="s">"content-warning"</span>, <span class="c"><optional reason></span>]145 ],146 <span class="k">"content"</span>: <span class="s">"sensitive content with #hastag\n"</span>147}</pre>148 </div>149 <p>The session below shows the tag in use. The client publishes a flagged note. A reader's client receives it and hides the content behind the reason text.</p>150 <div class="crt">151 <div class="titlebar">Session transcript - wss://relay.example.com</div>152<pre><span class="c">-- author publishes a flagged note --</span>153<span class="send">→ ["EVENT", {"id":"7f3a21cd90…","pubkey":"a49cc31b…","created_at":1700000000,154 "kind":1,"tags":[["content-warning","nudity"],155 ["L","content-warning"],["l","nudity","content-warning"]],156 "content":"beach photo dump","sig":"9c14ffa2…"}]</span>157<span class="recv">← ["OK", "7f3a21cd90…", true, ""]</span>158159<span class="c">-- a reader's client can query by indexed label --</span>160<span class="send">→ ["REQ", "cw", {"kinds":[1], "#L":["content-warning"]}]</span>161<span class="recv">← ["EVENT", "cw", {"id":"7f3a21cd90…", …}]</span>162<span class="recv">← ["EOSE", "cw"]</span>163<span class="c">-- the client renders: [ Sensitive content: nudity — Show anyway? ] --</span></pre>164 </div>165166 <div class="box tech">167 <span class="tag">Tech Note</span>168 <p>The source example places the literal placeholder <code>"reason"</code> as the <code>l</code> label value in the <code>content-warning</code> namespace. It also omits the <code>sig</code> field that <a href="01.html">NIP-01</a> requires. Treat both as documentation shorthand, not as a valid event.</p>169 </div>170171 <h2 class="bar" id="history"><span class="num">5</span> Version History</h2>172 <p>NIP-36 is a short and stable spec. Notable changes, newest first:</p>173 <ul class="patchnotes">174 <li class="minor"><span class="ver">2023</span><span class="when">2023-11</span>Reformatted the JSON example and removed the author list, as in all NIPs.</li>175 <li><span class="ver">2023</span><span class="when">2023-06</span>Jonathan Staab added the <a href="32.html">NIP-32</a> label option: <code>l</code> and <code>L</code> tags qualify the warning and make it queryable.</li>176 <li><span class="ver">Origin</span><span class="when">2022-12</span>Fernando López Guevara proposed the <code>content-warning</code> tag in PR #82.</li>177 </ul>178179 <div class="credits">180 <h3 class="cardhead">Original Proposal - Credits</h3>181 <table>182 <tr><td>Author</td><td>Fernando López Guevara</td></tr>183 <tr><td>First commit</td><td>2022-12-01 — “NIP-36 - sensitive content / content-warning” - <a href="https://github.com/nostr-protocol/nips/pull/82">PR #82</a></td></tr>184 <tr><td>Status</td><td><span class="chip draft">draft</span> <span class="chip">optional</span></td></tr>185 <tr><td>Source</td><td><a href="https://github.com/nostr-protocol/nips/blob/master/36.md">36.md on GitHub</a> - <a href="https://github.com/nostr-protocol/nips/commits/master/36.md">full change history</a></td></tr>186 </table>187 </div>188189 <h2 class="bar"><span class="num">6</span> See Also</h2>190 <ul>191 <li><a href="01.html">NIP-01</a> — the event and tag model this NIP builds on; single-letter tag indexing.</li>192 <li><a href="32.html">NIP-32</a> — the <code>l</code> and <code>L</code> labeling system used to qualify and query warnings.</li>193 <li><a href="56.html">NIP-56</a> — reporting: how <em>other</em> users flag content, instead of the author.</li>194 </ul>195 </div>196197 <aside>198 <div class="cartridge">199 <div class="inner">200 <h3 class="cardhead">Spec Card</h3>201 <div class="lights"><span class="led on"></span><span class="led on"></span><span class="led on"></span></div>202 <dl>203 <dt>Status</dt><dd><span class="chip draft">draft</span><span class="chip">optional</span></dd>204 <dt>Defines</dt><dd><code>content-warning</code> tag with optional reason</dd>205 <dt>Kind(s)</dt><dd>none — the tag works on any kind</dd>206 <dt>Requires</dt><dd><a href="01.html">NIP-01</a> - optionally <a href="32.html">NIP-32</a></dd>207 <dt>First commit</dt><dd>2022-12-01</dd>208 <dt>Last updated</dt><dd>2023-11-18</dd>209 </dl>210 </div>211 </div>212 </aside>213 </main>214215 <nav class="navbtns">216 <a href="35.html">◀ NIP-35: Torrents</a>217 <a href="37.html">NIP-37: Draft Wraps ▶</a>218 </nav>219220 <footer class="pagefoot">221 <a href="../index.html">Nostr Protocol Manual</a>222 <span class="pageno">NIP 36 / F4</span>223 </footer>224</div>225226<script src="../assets/webmcp.js" defer></script>227</body>228</html>