upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Fernandez <pfer@me.com>2023-07-18 22:53:30 +0200
committerGitHub <noreply@github.com>2023-07-18 22:53:30 +0200
commit00f9f5b049cd0a1cbba65166fb1fd5280ef448c1 (patch)
tree379276757ab82a7b0d8de672f58f1c569767129b
parentafcbef2bb0ad854adfc8dac8d04ba16fe8107115 (diff)
parent8efa0e76b471593396690941f234c570830449e4 (diff)
Merge pull request #662 from erskingardner/new-event-for-classifieds
-rw-r--r--99.md83
-rw-r--r--README.md4
2 files changed, 87 insertions, 0 deletions
diff --git a/99.md b/99.md
new file mode 100644
index 0000000..274e5af
--- /dev/null
+++ b/99.md
@@ -0,0 +1,83 @@
1# NIP-99
2
3## Classified Listings
4
5`draft` `optional` `author:erskingardner`
6
7This NIP defines `kind:30402`: a parameterized replaceable event to describe classified listings that list any arbitrary product, service, or other thing for sale or offer and includes enough structured metadata to make them useful.
8
9The category of classifieds includes a very broad range of physical goods, services, work opportunities, rentals, free giveaways, personals, etc. and is distinct from the more strictly structured marketplaces defined in [NIP-15](https://github.com/nostr-protocol/nips/blob/master/15.md) that often sell many units of specific products through very specific channels.
10
11The structure of these events is very similar to [NIP-23](https://github.com/nostr-protocol/nips/blob/master/23.md) long-form content events.
12
13### Draft / Inactive Listings
14
15`kind:30403` has the same structure as `kind:30402` and is used to save draft or inactive classified listings.
16
17### Content
18
19The `.content` field should be a description of what is being offered and by whom. These events should be a string in Markdown syntax.
20
21### Author
22
23The `.pubkey` field of these events are treated as the party creating the listing.
24
25### Metadata
26
27- For "tags"/"hashtags" (i.e. categories or keywords of relevance for the listing) the `"t"` event tag should be used, as per [NIP-12](https://github.com/nostr-protocol/nips/blob/master/12.md).
28- For images, whether included in the markdown content or not, clients SHOULD use `image` tags as described in [NIP-58](https://github.com/nostr-protocol/nips/blob/master/58.md). This allows clients to display images in carousel format more easily.
29
30The following tags, used for structured metadata, are standardized and SHOULD be included. Other tags may be added as necessary.
31
32- `"title"`, a title for the listing
33- `"summary"`, for short tagline or summary for the listing
34- `"published_at"`, for the timestamp (in unix seconds – converted to string) of the first time the listing was published.
35- `"location"`, for the location.
36- `"price"`, for the price of the thing being listed. This is an array in the format `[ "price", "<number>", "<currency>", "<frequency>" ]`.
37 - `"price"` is the name of the tag
38 - `"<number>"` is the amount in numeric format (but included in the tag as a string)
39 - `"<currency>"` is the currency unit in 3-character ISO 4217 format or ISO 4217-like currency code (e.g. `"btc"`, `"eth"`).
40 - `"<frequency>"` is optional and can be used to describe recurring payments. SHOULD be in noun format (hour, day, week, month, year, etc.)
41
42#### `price` examples
43
44- $50 one-time payment `["price", "50", "USD"]`
45- €15 per month `["price", "15", "EUR", "month"]`
46- £50,000 per year `["price", "50000", "GBP", "year"]`
47
48Other standard tags that might be useful.
49
50- `"g"`, a geohash for more precise location
51
52## Example Event
53
54```json
55{
56 "kind": 30402,
57 "created_at": 1675642635,
58 // Markdown content
59 "content": "Lorem [ipsum][nostr:nevent1qqst8cujky046negxgwwm5ynqwn53t8aqjr6afd8g59nfqwxpdhylpcpzamhxue69uhhyetvv9ujuetcv9khqmr99e3k7mg8arnc9] dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nRead more at nostr:naddr1qqzkjurnw4ksz9thwden5te0wfjkccte9ehx7um5wghx7un8qgs2d90kkcq3nk2jry62dyf50k0h36rhpdtd594my40w9pkal876jxgrqsqqqa28pccpzu.",
60 "tags": [
61 ["d", "lorem-ipsum"],
62 ["title", "Lorem Ipsum"],
63 ["published_at", "1296962229"],
64 ["t", "electronics"],
65 ["image", "https://url.to.img", "256x256"],
66 ["summary", "More lorem ipsum that is a little more than the title"],
67 ["location", "NYC"],
68 ["price", "100", "USD"],
69 [
70 "e",
71 "b3e392b11f5d4f28321cedd09303a748acfd0487aea5a7450b3481c60b6e4f87",
72 "wss://relay.example.com"
73 ],
74 [
75 "a",
76 "30023:a695f6b60119d9521934a691347d9f78e8770b56da16bb255ee286ddf9fda919:ipsum",
77 "wss://relay.nostr.org"
78 ]
79 ],
80 "pubkey": "...",
81 "id": "..."
82}
83```
diff --git a/README.md b/README.md
index 6da74cd..9ffff27 100644
--- a/README.md
+++ b/README.md
@@ -67,6 +67,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
67- [NIP-89: Recommended Application Handlers](89.md) 67- [NIP-89: Recommended Application Handlers](89.md)
68- [NIP-94: File Metadata](94.md) 68- [NIP-94: File Metadata](94.md)
69- [NIP-98: HTTP Auth](98.md) 69- [NIP-98: HTTP Auth](98.md)
70- [NIP-99: Classified Listings](99.md)
70 71
71## Event Kinds 72## Event Kinds
72 73
@@ -111,6 +112,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
111| `30023` | Long-form Content | [23](23.md) | 112| `30023` | Long-form Content | [23](23.md) |
112| `30078` | Application-specific Data | [78](78.md) | 113| `30078` | Application-specific Data | [78](78.md) |
113| `30311` | Live Event | [53](53.md) | 114| `30311` | Live Event | [53](53.md) |
115| `30402` | Classified Listing | [99](99.md) |
114| `31989` | Handler recommendation | [89](89.md) | 116| `31989` | Handler recommendation | [89](89.md) |
115| `31990` | Handler information | [89](89.md) | 117| `31990` | Handler information | [89](89.md) |
116 118
@@ -177,9 +179,11 @@ When experimenting with kinds, keep in mind the classification introduced by [NI
177| `expiration` | unix timestamp (string) | -- | [40](40.md) | 179| `expiration` | unix timestamp (string) | -- | [40](40.md) |
178| `image` | image URL | dimensions in pixels | [23](23.md), [58](58.md) | 180| `image` | image URL | dimensions in pixels | [23](23.md), [58](58.md) |
179| `lnurl` | `bech32` encoded `lnurl` | -- | [57](57.md) | 181| `lnurl` | `bech32` encoded `lnurl` | -- | [57](57.md) |
182| `location` | location string | -- | [99](99.md) |
180| `name` | badge name | -- | [58](58.md) | 183| `name` | badge name | -- | [58](58.md) |
181| `nonce` | random | -- | [13](13.md) | 184| `nonce` | random | -- | [13](13.md) |
182| `preimage` | hash of `bolt11` invoice | -- | [57](57.md) | 185| `preimage` | hash of `bolt11` invoice | -- | [57](57.md) |
186| `price` | price | currency, frequency | [99](99.md) |
183| `published_at` | unix timestamp (string) | -- | [23](23.md) | 187| `published_at` | unix timestamp (string) | -- | [23](23.md) |
184| `relay` | relay url | -- | [42](42.md) | 188| `relay` | relay url | -- | [42](42.md) |
185| `relays` | relay list | -- | [57](57.md) | 189| `relays` | relay list | -- | [57](57.md) |