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-14 - Subject Tag in Text Events — Nostr Instruction Manual</title>7<meta name="description" content="NIP-14: an optional subject tag for kind:1 text notes. Lets clients list threads by topic, like an email subject line, instead of by first words.">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 14 - Social</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="14">14</div>48 <div class="titles">49 <div class="kicker">Nostr Implementation Possibility - Hex № 14</div>50 <h1>Subject Tag in Text Events</h1>51 <p class="sub">One optional tag that gives a kind:1 note a short subject line, so clients can list threads by topic instead of by first words.</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>A <a href="01.html">NIP-01</a> kind:1 text note has no title field. The <code>content</code> field holds free text only. To show a list of notes, a client must invent a label for each one.</p>60 <p>Without a title, a client usually falls back on the first few words of <code>content</code>. This is an ad hoc label. It often cuts a sentence in half and does not describe the topic.</p>61 <p>This NIP defines one optional tag, <code>subject</code>, for kind:1 events. A client sets it to a short line of text. A list view can show this line instead of guessing from <code>content</code>. This works the way an email client lists incoming mail by subject line, not by the first words of the message body.</p>62 <p>The <code>subject</code> tag was first implemented as a trial in the <strong>more-speech</strong> client.</p>6364 <h2 class="bar" id="spec"><span class="num">2</span> The Subject Tag</h2>65 <p>A <code>subject</code> tag is a normal <a href="01.html">NIP-01</a> tag: an array of strings. The first element is the tag name, <code>subject</code>. The second element is the subject text.</p>66 <div class="crt">67 <div class="titlebar">Tag format</div>68<pre>[<span class="s">"subject"</span>, <span class="c"><string></span>]</pre>69 </div>7071 <div class="tscroll"><table class="ref">72 <caption>Tag reference</caption>73 <tr><th>Tag</th><th>Applies to</th><th>Rule</th></tr>74 <tr><td class="btn">subject</td><td>kind:1 text note</td><td>Optional. Value is a short string that names the topic of the note.</td></tr>75 </table></div>7677 <p>Three rules govern its use:</p>78 <ul>79 <li>The tag is optional. A client adds it only when the note starts a topic worth naming.</li>80 <li>When a client replies to a note that has a <code>subject</code> tag, the replying client SHOULD copy that tag into the reply. This keeps every note in a thread under the same subject.</li>81 <li>A replying client MAY change the copied subject to mark it as a reply, for example by adding the prefix <code>Re:</code>.</li>82 </ul>83 <p>A subject SHOULD be shorter than 80 characters. A client MAY trim a longer subject before it displays the value in a list.</p>8485 <div class="box hint">86 <span class="tag">Hint!</span>87 <p>This tag only labels a note in a list. It does not change threading. Reply structure still comes from the <code>e</code> and <code>p</code> tags defined in <a href="10.html">NIP-10</a>.</p>88 </div>8990 <div class="box tech">91 <span class="tag">Tech Note</span>92 <p>The source spec writes its one example as <code>["subject": <string>]</code>, with a colon between the elements. A tag is a JSON array, not an object, so elements must be separated by a comma: <code>["subject", "<string>"]</code>. This page uses the comma form throughout, matching the tag array format defined in <a href="01.html">NIP-01</a>.</p>93 </div>9495 <h2 class="bar" id="examples"><span class="num">3</span> Worked Example</h2>96 <p>Client A starts a thread with a subject. Client B replies, copies the subject, and adds a <code>Re:</code> prefix.</p>97 <div class="crt">98 <div class="titlebar">Worked example - two kind:1 events</div>99<pre><span class="c">-- Client A opens a thread --</span>100{101 <span class="k">"id"</span>: <span class="s">"a1c4e0…"</span>,102 <span class="k">"pubkey"</span>: <span class="s">"22a12a12…"</span>,103 <span class="k">"created_at"</span>: 1749762600,104 <span class="k">"kind"</span>: 1,105 <span class="k">"tags"</span>: [106 [<span class="s">"subject"</span>, <span class="s">"Relay uptime this week"</span>]107 ],108 <span class="k">"content"</span>: <span class="s">"My relay had two short outages, both under a minute."</span>,109 <span class="k">"sig"</span>: <span class="s">"e8551d85…"</span>110}111112<span class="c">-- Client B replies, keeps the subject, adds "Re:" --</span>113{114 <span class="k">"id"</span>: <span class="s">"9f2c11ab…"</span>,115 <span class="k">"pubkey"</span>: <span class="s">"f7234bd4…"</span>,116 <span class="k">"created_at"</span>: 1749763100,117 <span class="k">"kind"</span>: 1,118 <span class="k">"tags"</span>: [119 [<span class="s">"e"</span>, <span class="s">"a1c4e0…"</span>, <span class="s">"wss://relay.example.com"</span>, <span class="s">"root"</span>],120 [<span class="s">"p"</span>, <span class="s">"22a12a12…"</span>],121 [<span class="s">"subject"</span>, <span class="s">"Re: Relay uptime this week"</span>]122 ],123 <span class="k">"content"</span>: <span class="s">"Same here. Worth checking your host's network logs."</span>,124 <span class="k">"sig"</span>: <span class="s">"d2b649ff…"</span>125}</pre>126 </div>127 <p>A thread-list view can now show "Relay uptime this week" for both notes, instead of trimming each <code>content</code> string to a guessed label.</p>128129 <h2 class="bar" id="history"><span class="num">4</span> Version History</h2>130 <p>NIP-14 has changed little since it was published. Notable changes, newest first:</p>131 <ul class="patchnotes">132 <li class="minor"><span class="ver">2023</span><span class="when">2023-11-18</span>Reformatted the tag example as a fenced JSON code block and tightened whitespace. No rule changed.</li>133 <li class="minor"><span class="ver">2023</span><span class="when">2023-11-15</span>Removed the inline <code>author:</code> byline that this NIP shared with every other NIP file.</li>134 <li class="minor"><span class="ver">2023</span><span class="when">2023-07-12</span>Trimmed the trailing period from the title to match the format used by other NIP pages.</li>135 <li><span class="ver">Origin</span><span class="when">2022-05-24</span>Robert C. Martin (unclebobmartin) published NIP-14, renamed from a standalone proposal note. The tag was already running as a trial in the more-speech client.</li>136 </ul>137138 <div class="credits">139 <h3 class="cardhead">Original Proposal - Credits</h3>140 <table>141 <tr><td>Author</td><td>Robert C. Martin (unclebobmartin)</td></tr>142 <tr><td>First commit</td><td>2022-05-24 — “Nip-14 for subject tag”</td></tr>143 <tr><td>Status</td><td>draft - optional</td></tr>144 <tr><td>Source</td><td><a href="https://github.com/nostr-protocol/nips/blob/master/14.md">14.md on GitHub</a> - <a href="https://github.com/nostr-protocol/nips/commits/master/14.md">full change history</a></td></tr>145 </table>146 </div>147148 <h2 class="bar"><span class="num">5</span> See Also</h2>149 <ul>150 <li><a href="01.html">NIP-01</a> — defines the event object and the tag array format this tag follows.</li>151 <li><a href="10.html">NIP-10</a> — defines kind:1 text notes and the <code>e</code>/<code>p</code> reply tags a subject line labels.</li>152 <li><a href="17.html">NIP-17</a> — reuses the same <code>subject</code> tag name for the topic of a private direct-message conversation, a different kind with a related meaning.</li>153 </ul>154 </div>155156 <aside>157 <div class="cartridge">158 <div class="inner">159 <h3 class="cardhead">Spec Card</h3>160 <div class="lights"><span class="led on"></span><span class="led on"></span><span class="led on"></span></div>161 <dl>162 <dt>Status</dt><dd><span class="chip draft">draft</span><span class="chip optional">optional</span></dd>163 <dt>Defines</dt><dd><code>subject</code> tag</dd>164 <dt>Applies to</dt><dd>kind 1 (text note)</dd>165 <dt>Requires</dt><dd><a href="01.html">NIP-01</a> event and tag format</dd>166 <dt>Pairs with</dt><dd><a href="10.html">NIP-10</a> reply threading</dd>167 <dt>Transport</dt><dd>none — a tag value only, no new messages</dd>168 <dt>First commit</dt><dd>2022-05-24</dd>169 <dt>Last updated</dt><dd>2023-11-18</dd>170 </dl>171 </div>172 </div>173 </aside>174 </main>175176 <nav class="navbtns">177 <a href="13.html">◀ NIP-13: Proof of Work</a>178 <a href="15.html">NIP-15: Nostr Marketplace ▶</a>179 </nav>180181 <footer class="pagefoot">182 <a href="../index.html">Nostr Protocol Manual</a>183 <span class="pageno">NIP 14 / F4</span>184 </footer>185</div>186187<script src="../assets/webmcp.js" defer></script>188</body>189</html>