clone

every nostr nip as a chapter of an illustrated, early-2000s printed game manual

main
nip.guide / site / nips / 18.html
18.html 19.9K
1<!DOCTYPE html>2<html lang="en">3<head>4<meta charset="utf-8">5<meta name="viewport" content="width=device-width, initial-scale=1">6<title>NIP-18 - Reposts — Nostr Instruction Manual</title>7<meta name="description" content="NIP-18: reposts. Kind 6 reposts a kind-1 note, kind 16 generic reposts any other kind, and q tags mark quote reposts. 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 18 - 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="18">18</div>48 <div class="titles">49 <div class="kicker">Nostr Implementation Possibility - Hex № 18</div>50 <h1>Reposts</h1>51 <p class="sub">A repost tells followers that another user's note is worth reading. This chapter defines kind 6, kind 16, and the q tag for quote reposts.</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 <strong>repost</strong> is a signal, not a copy. A client publishes a repost event to tell its followers: "read this note." It does not replace the original event or change who wrote it.</p>60 <p>NIP-18 defines three ways to repost. <strong>Kind 6</strong> reposts a <a href="01.html">kind-1</a> text note. <strong>Kind 16</strong>, the generic repost, reposts any other kind of event. A <strong>quote repost</strong> is not a new kind at all. It is a normal event that mentions another event inline, marked with a <code>q</code> tag.</p>61 <p>All three forms point back to the original event with an <code>e</code>, <code>a</code>, or <code>q</code> tag. A client that renders a repost should show the original author, the original content, and who reposted it.</p>6263 <div class="box hint">64 <span class="tag">Hint!</span>65 <p>Think of kind 6 as "retweet this note" and a quote repost as "retweet with comment." Kind 16 covers everything that is not a kind-1 note, such as a repost of a long-form article or a highlight.</p>66 </div>6768 <figure class="diagram">69 <div class="frame">70 <svg viewBox="0 0 560 190" role="img" aria-label="Author publishes a kind 1 note; a reposting user publishes a kind 6 event that points back to it with an e tag; followers receive the repost and can fetch the original">71 <rect class="d-actor" x="10" y="18" width="120" height="46" rx="8"/>72 <text class="d-actor-label" x="70" y="46" text-anchor="middle">Author</text>73 <rect class="d-actor" x="10" y="126" width="120" height="46" rx="8"/>74 <text class="d-actor-label" x="70" y="154" text-anchor="middle">Reposting user</text>75 <rect class="d-actor" x="225" y="72" width="120" height="46" rx="8"/>76 <text class="d-actor-label" x="285" y="100" text-anchor="middle">Relay</text>77 <rect class="d-actor" x="430" y="72" width="120" height="46" rx="8"/>78 <text class="d-actor-label" x="490" y="100" text-anchor="middle">Follower</text>79 <path class="d-msg d-flow" d="M132,50 C170,60 190,80 223,90"/>80 <text class="d-label" x="175" y="52" text-anchor="middle">kind 1</text>81 <path class="d-msg d-flow" d="M132,140 C170,130 190,110 223,100"/>82 <text class="d-label" x="175" y="150" text-anchor="middle">kind 6, e tag</text>83 <path class="d-msg blue d-flow" d="M347,95 L428,95"/>84 <circle r="4" fill="#f26a00">85 <animateMotion dur="2.4s" repeatCount="indefinite" path="M132,140 C170,130 190,110 223,100"/>86 </circle>87 <circle r="4" fill="#2e5f9e">88 <animateMotion dur="2.4s" begin="1.1s" repeatCount="indefinite" path="M347,95 L428,95"/>89 </circle>90 </svg>91 </div>92 <figcaption>Fig. 18-1 — <b>A repost points back.</b> The <code>e</code> tag in the kind-6 event carries the original note's ID and a relay URL so any follower can fetch it.</figcaption>93 </figure>9495 <h2 class="bar" id="spec"><span class="num">2</span> Kind 6 - Reposting a Note</h2>96 <p>Kind 6 reposts are reserved for <a href="01.html">kind-1</a> text notes only. Use kind 16 for every other kind. A kind-6 event follows these rules:</p>97 <div class="tscroll"><table class="ref">98 <caption>Kind 6 rules</caption>99 <tr><th>Field</th><th>Rule</th></tr>100 <tr><td class="btn">kind</td><td>6.</td></tr>101 <tr><td class="btn">content</td><td>The stringified JSON of the reposted kind-1 event. May be empty, but an empty <code>content</code> is not recommended.</td></tr>102 <tr><td class="btn">e tag</td><td>Required. <code>["e", &lt;id of the reposted note&gt;, &lt;relay URL&gt;]</code>. The relay URL is required, so any client can fetch the original.</td></tr>103 <tr><td class="btn">p tag</td><td>Recommended. <code>["p", &lt;pubkey of the reposted note's author&gt;]</code>.</td></tr>104 </table></div>105 <div class="box warn">106 <span class="tag">Warning!</span>107 <p>Reposts of events protected by <a href="70.html">NIP-70</a> should always have an empty <code>content</code>. Do not copy a protected event's JSON into a repost.</p>108 </div>109110 <h2 class="bar" id="quote"><span class="num">3</span> Quote Reposts</h2>111 <p>A quote repost is any event that mentions another event inline, using an <a href="21.html">NIP-21</a> entity such as <code>nevent</code>, <code>note</code>, or <code>naddr</code> inside its <code>content</code>. When a client builds this kind of event, it must add a matching <code>q</code> tag for every mention.</p>112 <p>The <code>q</code> tag keeps quote reposts out of reply threads. Without it, a thread-rendering client could mistake a quote for a reply. The <code>q</code> tag also lets a client count every quote of one event with a single filter.</p>113 <div class="crt">114 <div class="titlebar">Tag shape - q tag</div>115<pre>[<span class="k">"q"</span>, <span class="c">&lt;event id or event address&gt;</span>, <span class="c">&lt;relay URL&gt;</span>, <span class="c">&lt;pubkey, only if a regular event&gt;</span>]</pre>116 </div>117 <div class="tscroll"><table class="ref">118 <caption>q tag reference</caption>119 <tr><th>Position</th><th>Value</th></tr>120 <tr><td class="btn">0</td><td><code>"q"</code>, the tag name.</td></tr>121 <tr><td class="btn">1</td><td>The 32-byte hex event ID for a regular event, or the <code>kind:pubkey:d-tag</code> address for an addressable event.</td></tr>122 <tr><td class="btn">2</td><td>A relay URL where the quoted event can be found.</td></tr>123 <tr><td class="btn">3</td><td>The author's pubkey. Only present when position 1 is a regular event ID, not an address.</td></tr>124 </table></div>125 <div class="box hint">126 <span class="tag">Hint!</span>127 <p>A quote repost is not restricted to kind 1. Any event kind may quote another event this way, as long as it adds the <code>q</code> tag for the mention.</p>128 </div>129130 <h2 class="bar" id="generic"><span class="num">4</span> Kind 16 - Generic Reposts</h2>131 <p>Kind 6 only covers kind-1 notes. To repost any other kind of event, publish a <strong>kind 16</strong> generic repost instead.</p>132 <div class="tscroll"><table class="ref">133 <caption>Kind 16 rules</caption>134 <tr><th>Field</th><th>Rule</th></tr>135 <tr><td class="btn">kind</td><td>16.</td></tr>136 <tr><td class="btn">k tag</td><td>Recommended. <code>["k", &lt;stringified kind number of the reposted event&gt;]</code>.</td></tr>137 <tr><td class="btn">a tag</td><td>Recommended when the reposted event is replaceable. <code>["a", "&lt;kind&gt;:&lt;pubkey&gt;:&lt;d-tag&gt;"]</code>, the event coordinate. See <a href="01.html">NIP-01</a> for the coordinate format.</td></tr>138 <tr><td class="btn">content</td><td>Required to hold the full JSON string of the reposted event, but only when the <code>a</code> tag is absent.</td></tr>139 </table></div>140 <p>The <code>a</code> tag changes what the repost means. If a kind-16 repost of a replaceable event includes an <code>a</code> tag, it reposts the address in general, whatever version is current. If the <code>a</code> tag is absent, the repost points at one specific version. In that case <code>content</code> must carry the full JSON of that exact reposted event.</p>141142 <div class="box tech">143 <span class="tag">Tech Note</span>144 <p>The source spec does not say whether a kind-16 repost of a non-replaceable, regular event needs an <code>e</code> tag. Earlier drafts of this NIP used an <code>e</code> tag for all reposts; the current text only spells out <code>k</code> and <code>a</code> for kind 16. In practice, implementations still add an <code>e</code> tag pointing at the reposted event's ID for non-replaceable kinds, by analogy with kind 6.</p>145 </div>146147 <figure class="diagram">148 <div class="frame">149 <svg viewBox="0 0 560 150" role="img" aria-label="Decision diagram: choose kind 6 for a kind 1 note, kind 16 with a k tag for any other kind, and add an a tag when the reposted event is replaceable">150 <rect class="d-actor" x="10" y="52" width="130" height="46" rx="8"/>151 <text class="d-actor-label" x="75" y="80" text-anchor="middle">Event to repost</text>152 <rect class="d-actor" x="220" y="8" width="150" height="44" rx="8"/>153 <text class="d-actor-label" x="295" y="30" text-anchor="middle">kind 1?</text>154 <text class="d-note" x="295" y="46" text-anchor="middle">→ kind 6, e tag</text>155 <rect class="d-actor" x="220" y="98" width="150" height="44" rx="8"/>156 <text class="d-actor-label" x="295" y="120" text-anchor="middle">any other kind</text>157 <text class="d-note" x="295" y="136" text-anchor="middle">→ kind 16, k tag</text>158 <rect class="d-actor" x="420" y="98" width="130" height="44" rx="8"/>159 <text class="d-actor-label" x="485" y="120" text-anchor="middle">replaceable?</text>160 <text class="d-note" x="485" y="136" text-anchor="middle">→ add a tag</text>161 <path class="d-msg d-flow" d="M142,68 C170,55 190,40 218,30"/>162 <path class="d-msg d-flow" d="M142,80 C170,100 190,112 218,120"/>163 <path class="d-msg blue d-flow" d="M372,120 L418,120"/>164 </svg>165 </div>166 <figcaption>Fig. 18-2 — <b>Choosing the repost kind.</b> A kind-1 note uses kind 6. Everything else uses kind 16 with a <code>k</code> tag, plus an <code>a</code> tag for replaceable events.</figcaption>167 </figure>168169 <h2 class="bar" id="examples"><span class="num">5</span> Worked Examples</h2>170 <p>Example A: a plain kind-6 repost of a kind-1 note. Orange lines go to the relay.</p>171 <div class="crt">172 <div class="titlebar">Example A - kind 6 repost</div>173<pre><span class="c">-- original note, kind 1 --</span>174{175 <span class="k">"id"</span>: <span class="s">"b1a649ebe8…"</span>, <span class="k">"pubkey"</span>: <span class="s">"22a12a12…"</span>, <span class="k">"kind"</span>: 1,176 <span class="k">"content"</span>: <span class="s">"Running nostr."</span>, <span class="k">"tags"</span>: [], <span class="k">"created_at"</span>: 1749762600177}178179<span class="c">-- repost, kind 6 --</span>180<span class="send">→ ["EVENT", {181 "id": "9f2c11ab…", "pubkey": "44bb0e02…", "kind": 6, "created_at": 1749762700,182 "tags": [183 ["e", "b1a649ebe8…", "wss://relay.example.com"],184 ["p", "22a12a12…"]185 ],186 "content": "{\"id\":\"b1a649ebe8…\",\"pubkey\":\"22a12a12…\",\"kind\":1,\"content\":\"Running nostr.\",\"tags\":[],\"created_at\":1749762600,\"sig\":\"e8551d85…\"}",187 "sig": "77af1d22…"188 }]</span>189<span class="recv">← ["OK", "9f2c11ab…", true, ""]</span></pre>190 </div>191192 <p>Example B: a quote repost. The kind-1 note mentions another note inline and adds a matching <code>q</code> tag.</p>193 <div class="crt">194 <div class="titlebar">Example B - quote repost</div>195<pre><span class="send">→ ["EVENT", {196 "id": "d048ac21…", "pubkey": "44bb0e02…", "kind": 1, "created_at": 1749762800,197 "content": "This is worth reading: nostr:nevent1qqs…qpp0",198 "tags": [199 ["q", "b1a649ebe8…", "wss://relay.example.com", "22a12a12…"]200 ],201 "sig": "3fbb2c40…"202 }]</span>203<span class="recv">← ["OK", "d048ac21…", true, ""]</span></pre>204 </div>205206 <p>Example C: a kind-16 generic repost of a replaceable long-form article (<a href="23.html">NIP-23</a>, kind 30023). The <code>a</code> tag is present, so <code>content</code> stays empty.</p>207 <div class="crt">208 <div class="titlebar">Example C - kind 16 repost, replaceable event</div>209<pre><span class="send">→ ["EVENT", {210 "id": "c7e3a901…", "pubkey": "44bb0e02…", "kind": 16, "created_at": 1749762900,211 "tags": [212 ["k", "30023"],213 ["a", "30023:22a12a12…:my-article-slug"],214 ["p", "22a12a12…"]215 ],216 "content": "",217 "sig": "ab19fe02…"218 }]</span>219<span class="recv">← ["OK", "c7e3a901…", true, ""]</span></pre>220 </div>221222 <h2 class="bar" id="history"><span class="num">6</span> Version History</h2>223 <p>NIP-18 has been rewritten several times, including one removal and reinstatement. Notable changes, newest first:</p>224 <ul class="patchnotes">225 <li><span class="ver">2025</span><span class="when">2025-12-03</span>Updated NIP-18's section headings for clarity.</li>226 <li><span class="ver">2025</span><span class="when">2025-12-02</span>Improved the rules for kind-16 generic reposts of replaceable events: the <code>a</code> tag is now recommended, and <code>content</code> is required only when it is absent.</li>227 <li><span class="ver">2025</span><span class="when">2025-10-16</span>Normalized the <code>q</code> tag definition to match <a href="22.html">NIP-22</a>.</li>228 <li class="minor"><span class="ver">2025</span><span class="when">2025-08-04</span>Included the missing <code>k</code> tag guidance for generic reposts.</li>229 <li><span class="ver">2025</span><span class="when">2025-01-10</span>Specified that reposts of protected events must not stringify the original event into <code>content</code>.</li>230 <li class="minor"><span class="ver">2024</span><span class="when">2024-10-31</span>Added explicit support for quoting addressable events (address quotes).</li>231 <li><span class="ver">2024</span><span class="when">2024-10-02</span>Recommended the <code>k</code> tag for quote-repost-adjacent generic reposts and clarified quote-repost behavior.</li>232 <li><span class="ver">2024</span><span class="when">2024-02-22</span>Switched quote reposts from <code>e</code> tags to a dedicated <code>q</code> tag.</li>233 <li><span class="ver">2023</span><span class="when">2023-06-16</span>Reworded the NIP back to its original intent and added <code>kind 16</code> generic reposts.</li>234 <li class="minor"><span class="ver">2023</span><span class="when">2023-03-25 to 2023-03-29</span>Brought the NIP back after removal; added the optional <code>content</code> comment, then dropped the requirement to copy the full event.</li>235 <li><span class="ver">Origin</span><span class="when">2023-01-02</span>fiatjaf published NIP-18: Reposts (#140). Briefly removed on 2023-01-16 as "not really a standard," then reinstated.</li>236 </ul>237238 <div class="credits">239 <h3 class="cardhead">Original Proposal - Credits</h3>240 <table>241 <tr><td>Author</td><td>fiatjaf</td></tr>242 <tr><td>First commit</td><td>2023-01-02 — “NIP18: Reposts (<a href="https://github.com/nostr-protocol/nips/pull/140">#140</a>)”</td></tr>243 <tr><td>Status</td><td>draft - optional</td></tr>244 <tr><td>Source</td><td><a href="https://github.com/nostr-protocol/nips/blob/master/18.md">18.md on GitHub</a> - <a href="https://github.com/nostr-protocol/nips/commits/master/18.md">full change history</a></td></tr>245 </table>246 </div>247248 <h2 class="bar"><span class="num">7</span> See Also</h2>249 <ul>250 <li><a href="01.html">NIP-01</a> — defines the kind-1 text note, event coordinates, and the base <code>e</code>/<code>p</code> tags this chapter builds on.</li>251 <li><a href="10.html">NIP-10</a> — reply threading with <code>e</code> tags; reposts use the <code>q</code> tag precisely so they are not mistaken for replies.</li>252 <li><a href="21.html">NIP-21</a> — the <code>nostr:</code> URI scheme and <code>nevent</code>/<code>note</code>/<code>naddr</code> entities used inline in quote reposts.</li>253 <li><a href="27.html">NIP-27</a> — general text note references and mentions, the broader mechanism that quote reposts are one case of.</li>254 <li><a href="70.html">NIP-70</a> — protected events; their reposts must keep <code>content</code> empty.</li>255 <li><a href="22.html">NIP-22</a> — comments; its tag conventions were used to normalize the <code>q</code> tag definition here.</li>256 <li><a href="23.html">NIP-23</a> — long-form content, a common target of kind-16 generic reposts.</li>257 </ul>258 </div>259260 <aside>261 <div class="cartridge">262 <div class="inner">263 <h3 class="cardhead">Spec Card</h3>264 <div class="lights"><span class="led on"></span><span class="led on"></span><span class="led warn"></span></div>265 <dl>266 <dt>Status</dt><dd><span class="chip draft">draft</span></dd>267 <dt>Defines</dt><dd>kind 6 - kind 16 - e/p/k/a/q tags</dd>268 <dt>Kind(s)</dt><dd>6 (repost), 16 (generic repost)</dd>269 <dt>Requires</dt><dd><a href="01.html">NIP-01</a> - event, kind-1 note, tags</dd>270 <dt>Related</dt><dd><a href="21.html">NIP-21</a> - <a href="70.html">NIP-70</a> - <a href="22.html">NIP-22</a></dd>271 <dt>Transport</dt><dd>WebSocket - JSON events</dd>272 <dt>First commit</dt><dd>2023-01-02</dd>273 <dt>Last updated</dt><dd>2025-12-03</dd>274 </dl>275 </div>276 </div>277 </aside>278 </main>279280 <nav class="navbtns">281 <a href="17.html">◀ NIP-17: Private Direct Messages</a>282 <a href="19.html">NIP-19: bech32-encoded entities ▶</a>283 </nav>284285 <footer class="pagefoot">286 <a href="../index.html">Nostr Protocol Manual</a>287 <span class="pageno">NIP 18 / F4</span>288 </footer>289</div>290291<script src="../assets/webmcp.js" defer></script>292</body>293</html>