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-87 - Cashu and Fedimint Discoverability — Nostr Instruction Manual</title>7<meta name="description" content="NIP-87: discover ecash mints on Nostr. Cashu and Fedimint announcements (kinds 38172, 38173) and user recommendations (kind 38000). 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 87 - Payments</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="87">87</div>48 <div class="titles">49 <div class="kicker">Nostr Implementation Possibility - Hex № 87</div>50 <h1>Cashu and Fedimint Discoverability</h1>51 <p class="sub">Ecash mints announce themselves on Nostr, users recommend the mints they trust, and wallets find both.</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>An <strong>ecash mint</strong> is a server that issues bearer tokens backed by bitcoin. Two mint families matter here. A <strong>Cashu</strong> mint is a single server that users reach over HTTPS. A <strong>Fedimint</strong> federation is a group of servers that users join with an invite code. Before a wallet can hold ecash, it must pick a mint. Picking a mint is a trust decision.</p>60 <p>This NIP turns that decision into Nostr events. It defines three kinds. A mint operator publishes <code>kind:38172</code> (Cashu) or <code>kind:38173</code> (Fedimint) to announce the mint and its capabilities. A user publishes <code>kind:38000</code> to recommend a mint. Another user queries those recommendations, filters them by their follow list, and connects to a mint their friends trust.</p>61 <p>The design mirrors <a href="89.html">NIP-89</a>, which does the same for application handlers. Nostr's open, queryable event graph is the discovery index. No app store, no registry, no central list of mints.</p>6263 <div class="box hint">64 <span class="tag">Hint!</span>65 <p>All three kinds sit in the 30000–39999 range. They are addressable events under <a href="01.html">NIP-01</a>: a relay keeps only the latest event per <code>pubkey</code> + <code>kind</code> + <code>d</code>-tag triple. A user can edit a recommendation, and a mint can update its announcement, without creating duplicates.</p>66 </div>6768 <h2 class="bar" id="spec"><span class="num">2</span> Parties and Flow</h2>69 <p>Three actors take part in the workflow:</p>70 <ul>71 <li><strong>Mint operator</strong> — announces the mint and its capabilities. Publishes <code>kind:38173</code> or <code>kind:38172</code> with connection details.</li>72 <li><strong>User A</strong> — recommends an ecash mint. Publishes <code>kind:38000</code>.</li>73 <li><strong>User B</strong> — seeks a recommendation. Queries for <code>kind:38000</code>, then, based on the results, queries for <code>kind:38173</code>/<code>kind:38172</code>.</li>74 </ul>7576 <figure class="diagram">77 <div class="frame">78 <svg viewBox="0 0 560 220" role="img" aria-label="Mint operator and User A publish announcement and recommendation events to a relay; User B queries the relay and then connects to the mint">79 <rect class="d-actor" x="10" y="20" width="120" height="46" rx="8"/>80 <text class="d-actor-label" x="70" y="40" text-anchor="middle">Mint</text>81 <text class="d-note" x="70" y="56" text-anchor="middle">operator</text>82 <rect class="d-actor" x="10" y="150" width="120" height="46" rx="8"/>83 <text class="d-actor-label" x="70" y="170" text-anchor="middle">User A</text>84 <text class="d-note" x="70" y="186" text-anchor="middle">recommender</text>85 <rect class="d-actor" x="225" y="85" width="110" height="50" rx="8"/>86 <text class="d-actor-label" x="280" y="114" text-anchor="middle">Relay</text>87 <rect class="d-actor" x="430" y="85" width="120" height="50" rx="8"/>88 <text class="d-actor-label" x="490" y="106" text-anchor="middle">User B</text>89 <text class="d-note" x="490" y="122" text-anchor="middle">seeker</text>90 <path class="d-msg d-flow" d="M132,50 C175,60 185,82 223,94"/>91 <path class="d-msg d-flow" d="M132,166 C175,156 185,134 223,122"/>92 <path class="d-msg blue d-flow" d="M337,110 C370,110 395,110 428,110"/>93 <path class="d-msg" d="M478,138 C400,200 200,190 92,196 C60,196 48,182 48,168"/>94 <text class="d-label" x="152" y="60" text-anchor="middle">38172/38173</text>95 <text class="d-label" x="152" y="150" text-anchor="middle">38000</text>96 <text class="d-label" x="382" y="102" text-anchor="middle">REQ results</text>97 <text class="d-note" x="300" y="205" text-anchor="middle">connect: mint URL or invite code</text>98 <circle r="4" fill="#f26a00">99 <animateMotion dur="2.6s" repeatCount="indefinite" path="M132,50 C175,60 185,82 223,94"/>100 </circle>101 <circle r="4" fill="#2e5f9e">102 <animateMotion dur="2.6s" begin="1.3s" repeatCount="indefinite" path="M337,110 C370,110 395,110 428,110"/>103 </circle>104 </svg>105 </div>106 <figcaption>Fig. 87-1 — <b>Discovery flow.</b> The mint and User A publish. User B queries the relay, then connects to the mint directly.</figcaption>107 </figure>108109 <div class="tscroll"><table class="ref">110 <caption>Kinds defined by this NIP</caption>111 <tr><th>Kind</th><th>Publisher</th><th>Meaning</th></tr>112 <tr><td class="btn">38000</td><td>a user</td><td>Recommendation of an ecash mint, with an optional review in <code>content</code>.</td></tr>113 <tr><td class="btn">38172</td><td>Cashu mint</td><td>Announcement: mint URL, supported nuts, network.</td></tr>114 <tr><td class="btn">38173</td><td>Fedimint</td><td>Announcement: invite codes, supported modules, network.</td></tr>115 </table></div>116117 <h2 class="bar" id="recommendation"><span class="num">3</span> The Recommendation Event</h2>118 <p>A user recommends a mint with a <code>kind:38000</code> event. It is a parameterized-replaceable event: the user can edit the recommendation without creating a new event.</p>119120 <div class="crt">121 <div class="titlebar">Wire format - kind 38000 recommendation</div>122<pre>{123 <span class="k">"kind"</span>: 38000,124 <span class="k">"pubkey"</span>: <span class="c"><recommender-user-pubkey></span>,125 <span class="k">"tags"</span>: [126 [<span class="s">"k"</span>, <span class="s">"38173"</span>],127 [<span class="s">"d"</span>, <span class="c"><d-identifier></span>],128 [<span class="s">"u"</span>, <span class="c"><recommended-fedimint-invite-code></span>],129 [<span class="s">"a"</span>, <span class="s">"38173:fedimint-pubkey:<d-identifier>"</span>, <span class="s">"wss://relay1"</span>]130 ],131 <span class="k">"content"</span>: <span class="s">"I trust this mint with my life"</span>132}</pre>133 </div>134135 <div class="tscroll"><table class="ref">136 <caption>Tags on kind 38000</caption>137 <tr><th>Tag</th><th>Rule</th></tr>138 <tr><td class="btn">d</td><td>The identifier of the <code>kind:38173</code>/<code>kind:38172</code> event this event recommends. If no announcement event exists, compute the <code>d</code> value from the mint's pubkey or id anyway.</td></tr>139 <tr><td class="btn">k</td><td>The kind number of the recommended announcement: <code>38173</code> for Fedimints, <code>38172</code> for Cashu mints.</td></tr>140 <tr><td class="btn">u</td><td>Optional. A recommended way to connect to the mint: its URL or invite code. Multiple <code>u</code> tags may appear on one event.</td></tr>141 <tr><td class="btn">a</td><td>Points to the mint's <code>kind:38173</code>/<code>kind:38172</code> event. First value is the event address, second value is a relay hint. This disambiguates duplicate events that claim to be the same mint.</td></tr>142 </table></div>143144 <p>The <code>content</code> holds an optional review in free text.</p>145146 <h2 class="bar" id="announcements"><span class="num">4</span> Mint Announcements</h2>147 <h3>Cashu mints — kind 38172</h3>148 <p>A Cashu mint should publish a <code>kind:38172</code> event. It announces the mint's capabilities and how to connect. The rules:</p>149 <ul>150 <li>The <code>u</code> tag should be the URL of the Cashu mint.</li>151 <li>The event should list the <strong>nuts</strong> (Cashu protocol features) the mint supports.</li>152 <li>The <code>d</code> tag should be the mint's pubkey, as returned by the mint's <code>/v1/info</code> endpoint. Users can then query by pubkey and find the announcement.</li>153 <li>An <code>n</code> tag should state the network: <code>mainnet</code>, <code>testnet</code>, <code>signet</code>, or <code>regtest</code>.</li>154 </ul>155156 <div class="crt">157 <div class="titlebar">Wire format - kind 38172 Cashu announcement</div>158<pre>{159 <span class="k">"kind"</span>: 38172,160 <span class="k">"pubkey"</span>: <span class="c"><application-pubkey></span>,161 <span class="k">"content"</span>: <span class="c"><optional-kind:0-style-metadata></span>,162 <span class="k">"tags"</span>: [163 [<span class="s">"d"</span>, <span class="c"><cashu mint pubkey></span>],164 [<span class="s">"u"</span>, <span class="s">"https://cashu.example.com"</span>],165 [<span class="s">"nuts"</span>, <span class="s">"1,2,3,4,5,6,7"</span>],166 [<span class="s">"n"</span>, <span class="s">"mainnet"</span>]167 ]168}</pre>169 </div>170171 <h3>Fedimints — kind 38173</h3>172 <p>A Fedimint should publish a <code>kind:38173</code> event. The rules:</p>173 <ul>174 <li>List every known Fedimint invite code, one per <code>u</code> tag.</li>175 <li>List the modules the federation supports in a <code>modules</code> tag, for example <code>lightning,wallet,mint</code>.</li>176 <li>The <code>d</code> tag should be the federation id. Users can then query by federation id and find the announcement.</li>177 <li>An <code>n</code> tag should state the network: <code>mainnet</code>, <code>testnet</code>, <code>signet</code>, or <code>regtest</code>.</li>178 </ul>179180 <div class="crt">181 <div class="titlebar">Wire format - kind 38173 Fedimint announcement</div>182<pre>{183 <span class="k">"kind"</span>: 38173,184 <span class="k">"pubkey"</span>: <span class="c"><application-pubkey></span>,185 <span class="k">"content"</span>: <span class="c"><optional-kind:0-style-metadata></span>,186 <span class="k">"tags"</span>: [187 [<span class="s">"d"</span>, <span class="c"><federation-id></span>],188 [<span class="s">"u"</span>, <span class="s">"fed11abc.."</span>],189 [<span class="s">"u"</span>, <span class="s">"fed11xyz.."</span>],190 [<span class="s">"modules"</span>, <span class="s">"lightning,wallet,mint"</span>],191 [<span class="s">"n"</span>, <span class="s">"signet"</span>]192 ]193}</pre>194 </div>195196 <p>In both kinds, <code>content</code> is an optional stringified JSON object in the style of the <a href="01.html">NIP-01</a> kind-0 metadata. Use it when the pubkey that signs the announcement is not a normal user. If <code>content</code> is empty, clients should display the mint from the pubkey's own <code>kind:0</code> event: name, picture, web, LUD16, and so on.</p>197198 <figure class="diagram">199 <div class="frame">200 <svg viewBox="0 0 560 200" role="img" aria-label="A kind 38000 recommendation points at a kind 38172 announcement through its d, k, and a tags, and at the mint itself through the u tag">201 <rect class="d-actor" x="10" y="40" width="170" height="120" rx="8"/>202 <text class="d-actor-label" x="95" y="64" text-anchor="middle">kind 38000</text>203 <text class="d-note" x="30" y="88">d = mint id</text>204 <text class="d-note" x="30" y="106">k = 38172</text>205 <text class="d-note" x="30" y="124">a = 38172:pk:id</text>206 <text class="d-note" x="30" y="142">u = mint URL</text>207 <rect class="d-actor" x="330" y="25" width="170" height="80" rx="8"/>208 <text class="d-actor-label" x="415" y="49" text-anchor="middle">kind 38172</text>209 <text class="d-note" x="350" y="70">d = mint pubkey</text>210 <text class="d-note" x="350" y="88">nuts - n - u</text>211 <rect class="d-actor" x="330" y="135" width="170" height="46" rx="8"/>212 <text class="d-actor-label" x="415" y="163" text-anchor="middle">Mint server</text>213 <path class="d-msg d-flow" d="M182,90 C240,80 270,70 327,62"/>214 <path class="d-msg blue d-flow" d="M182,140 C240,148 270,152 327,158"/>215 <text class="d-label" x="255" y="60" text-anchor="middle">d / k / a</text>216 <text class="d-label" x="255" y="170" text-anchor="middle">u</text>217 </svg>218 </div>219 <figcaption>Fig. 87-2 — <b>Tag linkage.</b> A recommendation addresses the announcement event with <code>d</code>, <code>k</code>, and <code>a</code>, and the mint itself with <code>u</code>.</figcaption>220 </figure>221222 <h2 class="bar" id="examples"><span class="num">5</span> Worked Example</h2>223 <h3>User A recommends some mints</h3>224 <p>User A uses a Cashu mint and a Fedimint. Their client publishes one recommendation that covers both, as in the source spec:</p>225 <div class="crt">226 <div class="titlebar">kind 38000 - recommendation from User A</div>227<pre>{228 <span class="k">"kind"</span>: 38000,229 <span class="k">"tags"</span>: [230 [<span class="s">"u"</span>, <span class="s">"fed11abc.."</span>, <span class="s">"fedimint"</span>],231 [<span class="s">"u"</span>, <span class="s">"https://cashu.example.com"</span>, <span class="s">"cashu"</span>],232 [<span class="s">"a"</span>, <span class="s">"38173:fedimint-pubkey:<d-identifier>"</span>, <span class="s">"wss://relay1"</span>, <span class="s">"fedimint"</span>],233 [<span class="s">"a"</span>, <span class="s">"38172:cashu-mint-pubkey:<d-identifier>"</span>, <span class="s">"wss://relay2"</span>, <span class="s">"cashu"</span>]234 ],235 <span class="c">...</span>236}</pre>237 </div>238239 <div class="box tech">240 <span class="tag">Tech Note</span>241 <p>This example comes straight from the source spec, and it does not match the spec's own tag rules. It adds a third element (<code>"fedimint"</code> / <code>"cashu"</code>) to the <code>u</code> and <code>a</code> tags that the spec text never defines, it drops the required <code>d</code> tag that makes the event addressable, and it omits the <code>k</code> tag that the query below filters on. Treat the tag table in §3 as normative.</p>242 </div>243244 <h3>User B finds a mint</h3>245 <p>User B wants an ecash wallet and needs a mint. Their wallet client queries for <code>kind:38000</code> recommendations, scoped to people User B follows:</p>246 <div class="crt">247 <div class="titlebar">Session transcript - wss://relay.example.com</div>248<pre><span class="c">-- query recommendations from the user's social graph --</span>249<span class="send">→ ["REQ", "mints", {"kinds":[38000], "authors":[<user>, <users-contact-list>],250 "#k":["38173"]}]</span>251<span class="recv">← ["EVENT", "mints", {"kind":38000, "pubkey":"<user A>", "tags":[["k","38173"],252 ["d","<federation-id>"], …], "content":"I trust this mint with my life", …}]</span>253<span class="recv">← ["EOSE", "mints"]</span>254255<span class="c">-- fetch the announcement the recommendation points at --</span>256<span class="send">→ ["REQ", "ann", {"kinds":[38173], "authors":["<fedimint-pubkey>"],257 "#d":["<federation-id>"]}]</span>258<span class="recv">← ["EVENT", "ann", {"kind":38173, "tags":[["d","<federation-id>"],259 ["u","fed11abc.."], ["modules","lightning,wallet,mint"], ["n","mainnet"]], …}]</span>260<span class="recv">← ["EOSE", "ann"]</span>261<span class="c">-- User B joins the federation with invite code fed11abc.. --</span></pre>262 </div>263 <p>User B follows User A, sees the <code>kind:38000</code> event, and connects to the corresponding mint.</p>264265 <h3>Alternative query, bypassing kind 38000</h3>266 <p>A client may skip recommendations and query announcements directly:</p>267 <div class="crt">268 <div class="titlebar">Direct announcement query</div>269<pre><span class="send">→ ["REQ", "direct", {"kinds":[38173], "authors":[<span class="c">...</span>]}]</span></pre>270 </div>271 <div class="box warn">272 <span class="tag">Warning!</span>273 <p>Anyone can publish an announcement event. A client that queries <code>kind:38173</code>/<code>kind:38172</code> directly should apply spam-prevention mechanisms, or query high-quality restricted relays. Otherwise it may direct users to malicious mints.</p>274 </div>275 <div class="box tech">276 <span class="tag">Tech Note</span>277 <p>Both <code>REQ</code> examples in the source spec wrap the filter in an extra JSON array: <code>["REQ", <id>, [{…}]]</code>. That is invalid <a href="01.html">NIP-01</a> syntax; filters follow the subscription id directly. The transcripts above use the correct form.</p>278 </div>279280 <h2 class="bar" id="history"><span class="num">6</span> Version History</h2>281 <p>NIP-87 is young and has a short history. Notable changes, newest first:</p>282 <ul class="patchnotes">283 <li><span class="ver">2026</span><span class="when">2026-06</span>Renamed to "Cashu and Fedimint Discoverability" in fiatjaf's repo-wide title cleanup.</li>284 <li class="minor"><span class="ver">2025</span><span class="when">2025-08</span>Typo fixes.</li>285 <li><span class="ver">Origin</span><span class="when">2025-07</span>benthecarman published the NIP as "Ecash Mint Discoverability" (PR #1110).</li>286 </ul>287288 <div class="credits">289 <h3 class="cardhead">Original Proposal - Credits</h3>290 <table>291 <tr><td>Author</td><td>benthecarman</td></tr>292 <tr><td>First commit</td><td>2025-07-16 — “NIP-87: Ecash Mint Discoverability” (<a href="https://github.com/nostr-protocol/nips/pull/1110">PR #1110</a>)</td></tr>293 <tr><td>Status</td><td><span class="chip draft">draft</span> <span class="chip optional">optional</span></td></tr>294 <tr><td>Source</td><td><a href="https://github.com/nostr-protocol/nips/blob/master/87.md">87.md on GitHub</a> - <a href="https://github.com/nostr-protocol/nips/commits/master/87.md">full change history</a></td></tr>295 </table>296 </div>297298 <h2 class="bar"><span class="num">7</span> See Also</h2>299 <ul>300 <li><a href="01.html">NIP-01</a> — addressable events, the <code>d</code> tag, kind-0 metadata, and <code>REQ</code> filters used here.</li>301 <li><a href="89.html">NIP-89</a> — recommended application handlers; the discovery pattern this NIP mirrors.</li>302 <li><a href="60.html">NIP-60</a> — Cashu wallets on Nostr; where the discovered mint gets used.</li>303 <li><a href="61.html">NIP-61</a> — nutzaps; P2PK Cashu payments between Nostr users.</li>304 </ul>305 </div>306307 <aside>308 <div class="cartridge">309 <div class="inner">310 <h3 class="cardhead">Spec Card</h3>311 <div class="lights"><span class="led on"></span><span class="led warn"></span><span class="led warn"></span></div>312 <dl>313 <dt>Status</dt><dd><span class="chip draft">draft</span><span class="chip optional">optional</span></dd>314 <dt>Defines</dt><dd>kinds 38000, 38172, 38173 - k/u/n/nuts/modules tags</dd>315 <dt>Kinds</dt><dd>38000 - 38172 - 38173 (addressable)</dd>316 <dt>Requires</dt><dd><a href="01.html">NIP-01</a></dd>317 <dt>Transport</dt><dd>relays for discovery - HTTPS / invite codes to reach the mint</dd>318 <dt>First commit</dt><dd>2025-07-16</dd>319 <dt>Last updated</dt><dd>2026-06-02</dd>320 </dl>321 </div>322 </div>323 </aside>324 </main>325326 <nav class="navbtns">327 <a href="86.html">◀ NIP-86: Relay Management API</a>328 <a href="88.html">NIP-88: Polls ▶</a>329 </nav>330331 <footer class="pagefoot">332 <a href="../index.html">Nostr Protocol Manual</a>333 <span class="pageno">NIP 87 / F4</span>334 </footer>335</div>336337<script src="../assets/webmcp.js" defer></script>338</body>339</html>