upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--87.md142
-rw-r--r--README.md9
2 files changed, 148 insertions, 3 deletions
diff --git a/87.md b/87.md
new file mode 100644
index 0000000..c6701d5
--- /dev/null
+++ b/87.md
@@ -0,0 +1,142 @@
1NIP-87
2======
3
4Ecash Mint Discoverability
5--------------------------------
6
7`draft` `optional`
8
9This NIP describes `kind:38173`, `kind:38172` and `kind:38000`: a way to discover ecash mints, their capabilities, and people who recommend them.
10
11## Rationale
12
13Nostr's discoverability and transparent event interaction is one of its most interesting/novel mechanics.
14This NIP provides a simple way for users to discover ecash mints recommended by other users and to interact with them.
15
16### Parties involved
17
18There are three actors to this workflow:
19
20* An ecash mint operator, announces their mint and its capabilities.
21 * Publishes `kind:38173` or `kind:38172`, detailing how to connect to it and its capabilities.
22* user A, who recommends an ecash mint
23 * Publishes `kind:38000`
24* user B, who seeks a recommendation for an ecash mint
25 * Queries for `kind:38000` and, based on results, queries for `kind:38173`/`kind:38172`
26
27## Events
28
29### Recommendation event
30```json
31{
32 "kind": 38000,
33 "pubkey": <recommender-user-pubkey>,
34 "tags": [
35 ["k", "38173"],
36 ["d", "<d-identifier>"],
37 ["u", <recommended-fedimint-invite-code>],
38 ["a", "38173:fedimint-pubkey:<d-identifier>", "wss://relay1"]
39 ],
40 "content": "I trust this mint with my life"
41}
42```
43
44The recommendation event is a parameterized-replacable event so that a user can change edit their recommendation without creating a new event.
45
46The `d` tag in `kind:38000` is the `kind:38173`/`kind:38172` event identifier this event is recommending, if no event exists, the `d` tag can still be calculated from the mint's pubkey/id.
47The `k` tag is the kind number that corresponds to the event kind that the user is recommending, in this case `kind:38173` for fedimints and `kind:38172` for cashu mints.
48
49Optional `u` tags can be added to give a recommend way to connect to the mint.
50The value of the tag is the URL or invite code of the ecash mint.
51Multiple `u` tags can appear on the same `kind:38000`.
52
53`a` tags are used to point to the `kind:38173`/`kind:38172` event of the ecash mint.
54The first value of the tag is the `kind:38173`/`kind:38172` event identifier, the second value of the tag is a relay hint.
55This is used to correctly point to the mint's `kind:38173`/`kind:38172` event in case there are duplicates claiming to be the same mint.
56
57The content can be used to give a review.
58
59## Ecash Mint Information
60
61Cashu mints SHOULD publish `kind:38172` events to announce their capabilities and how to connect to them.
62
63For cashu mints, the `u` tag SHOULD be the URL to the cashu mint and it should list the nuts that the cashu mint supports.
64
65The `d` tag SHOULD be the mint's pubkey (found when querying `/v1/info`), this way users can query by pubkey and find the mint announcement.
66
67An `n` tag SHOULD be added to signify the network the cashu mint is on (either `mainnet`, `testnet`, `signet`, or `regtest`)
68
69```json
70{
71 "kind": 38172,
72 "pubkey": "<application-pubkey>",
73 "content": "<optional-kind:0-style-metadata>",
74 "tags": [
75 ["d", <cashu mint pubkey>],
76 ["u", "https://cashu.example.com"],
77 ["nuts", "1,2,3,4,5,6,7"],
78 ["n", "mainnet"]
79 ]
80}
81```
82
83Fedimints SHOULD publish `kind:38173` events to announce their capabilities and how to connect to them.
84
85For fedimints, it should list all known fedimint invite codes in `u` tags and it should list the modules it supports.
86
87The `d` tag SHOULD be the federation id, this way users can query by federation id and find the fedimint announcement.
88
89An `n` tag SHOULD be added to signify the network the fedimint is on (either `mainnet`, `testnet`, `signet`, or `regtest`)
90
91```json
92{
93 "kind": 38173,
94 "pubkey": "<application-pubkey>",
95 "content": "<optional-kind:0-style-metadata>",
96 "tags": [
97 ["d", <federation-id>],
98 ["u", "fed11abc.."],
99 ["u", "fed11xyz.."],
100 ["modules", "lightning,wallet,mint"],
101 ["n", "signet"]
102 ]
103}
104```
105
106* `content` is an optional `metadata`-like stringified JSON object, as described in NIP-01. This content is useful when the pubkey creating the `kind:38173` is not a normal user. If `content` is empty, the `kind:0` of the pubkey should be used to display mint information (e.g. name, picture, web, LUD16, etc.)
107
108## Example
109
110### User A recommends some mints
111User A might be a user of a cashu mint. Using a client, user A publishes an event recommending the cashu mint they use.
112
113```json
114{
115 "kind": 38000,
116 "tags": [
117 ["u", "fed11abc..", "fedimint"],
118 ["u", "https://cashu.example.com", "cashu"],
119 ["a", "38173:fedimint-pubkey:<d-identifier>", "wss://relay1", "fedimint"],
120 ["a", "38172:cashu-mint-pubkey:<d-identifier>", "wss://relay2", "cashu"]
121 ],
122 ...
123}
124```
125
126### User B finds a mint
127User B wants to use an ecash wallet, they need to find a mint.
128
129User B's wallet client queries for `kind:38000` events, looking for recommendations for ecash mints.
130
131```json
132["REQ", <id>, [{ "kinds": [38000], "authors": [<user>, <users-contact-list>], "#k": ["38173"] }]]
133```
134
135User B, who follows User A, sees that `kind:38000` event and tries to connect to the corresponding mints.
136
137### Alternative query bypassing `kind:38000`
138Alternatively, users might choose to query directly for `kind:38173` for an event kind. Clients SHOULD be careful doing this and use spam-prevention mechanisms or querying high-quality restricted relays to avoid directing users to malicious handlers.
139
140```json
141["REQ", <id>, [{ "kinds": [38173], "authors": [...] }]]
142```
diff --git a/README.md b/README.md
index 397eceb..ff7e9bb 100644
--- a/README.md
+++ b/README.md
@@ -93,6 +93,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
93- [NIP-7D: Threads](7D.md) 93- [NIP-7D: Threads](7D.md)
94- [NIP-84: Highlights](84.md) 94- [NIP-84: Highlights](84.md)
95- [NIP-86: Relay Management API](86.md) 95- [NIP-86: Relay Management API](86.md)
96- [NIP-87: Ecash Mint Discoverability](87.md)
96- [NIP-88: Polls](88.md) 97- [NIP-88: Polls](88.md)
97- [NIP-89: Recommended Application Handlers](89.md) 98- [NIP-89: Recommended Application Handlers](89.md)
98- [NIP-90: Data Vending Machines](90.md) 99- [NIP-90: Data Vending Machines](90.md)
@@ -107,7 +108,6 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
107- [NIP-C7: Chats](C7.md) 108- [NIP-C7: Chats](C7.md)
108 109
109## Event Kinds 110## Event Kinds
110
111| kind | description | NIP | 111| kind | description | NIP |
112| ------------- | ------------------------------- | -------------------------------------- | 112| ------------- | ------------------------------- | -------------------------------------- |
113| `0` | User Metadata | [01](01.md) | 113| `0` | User Metadata | [01](01.md) |
@@ -200,6 +200,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
200| `10166` | Relay Monitor Announcement | [66](66.md) | 200| `10166` | Relay Monitor Announcement | [66](66.md) |
201| `13194` | Wallet Info | [47](47.md) | 201| `13194` | Wallet Info | [47](47.md) |
202| `17375` | Cashu Wallet Event | [60](60.md) | 202| `17375` | Cashu Wallet Event | [60](60.md) |
203| `17375` | Ecash Mint Recommendation | [87](87.md) |
203| `21000` | Lightning Pub RPC | [Lightning.Pub][lnpub] | 204| `21000` | Lightning Pub RPC | [Lightning.Pub][lnpub] |
204| `22242` | Client Authentication | [42](42.md) | 205| `22242` | Client Authentication | [42](42.md) |
205| `23194` | Wallet Request | [47](47.md) | 206| `23194` | Wallet Request | [47](47.md) |
@@ -247,9 +248,11 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
247| `31924` | Calendar | [52](52.md) | 248| `31924` | Calendar | [52](52.md) |
248| `31925` | Calendar Event RSVP | [52](52.md) | 249| `31925` | Calendar Event RSVP | [52](52.md) |
249| `31989` | Handler recommendation | [89](89.md) | 250| `31989` | Handler recommendation | [89](89.md) |
250| `31990` | Handler information | [89](89.md) | | 251| `31990` | Handler information | [89](89.md) |
251| `32267` | Software Application | | | 252| `32267` | Software Application | |
252| `34550` | Community Definition | [72](72.md) | 253| `34550` | Community Definition | [72](72.md) |
254| `38172` | Cashu Mint Announcement | [87](87.md) |
255| `38173` | Fedimint Announcement | [87](87.md) |
253| `38383` | Peer-to-peer Order events | [69](69.md) | 256| `38383` | Peer-to-peer Order events | [69](69.md) |
254| `39000-9` | Group metadata events | [29](29.md) | 257| `39000-9` | Group metadata events | [29](29.md) |
255| `39089` | Starter packs | [51](51.md) | 258| `39089` | Starter packs | [51](51.md) |