reformat a bunch of json things and small nitpicks.

This commit is contained in:
fiatjaf 2023-11-18 09:13:12 -03:00
parent b0df71824f
commit 5dcfe85306
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1
21 changed files with 385 additions and 365 deletions

16
11.md
View File

@ -68,7 +68,6 @@ are rejected or fail immediately.
```json
{
...
"limitation": {
"max_message_length": 16384,
"max_subscriptions": 20,
@ -82,7 +81,8 @@ are rejected or fail immediately.
"payment_required": true,
"created_at_lower_limit": 31536000,
"created_at_upper_limit": 3
}
},
...
}
```
@ -181,8 +181,8 @@ flexibility is up to the client software.
```json
{
"relay_countries": [ "CA", "US" ],
...
"relay_countries": [ "CA", "US" ]
}
```
@ -203,10 +203,10 @@ To support this goal, relays MAY specify some of the following values.
```json
{
...
"language_tags": ["en", "en-419"],
"tags": ["sfw-only", "bitcoin-only", "anime"],
"posting_policy": "https://example.com/posting-policy.html"
"posting_policy": "https://example.com/posting-policy.html",
...
}
```
@ -239,13 +239,13 @@ Relays that require payments may want to expose their fee schedules.
```json
{
...
"payments_url": "https://my-relay/payments",
"fees": {
"admission": [{ "amount": 1000000, "unit": "msats" }],
"subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }],
"publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }],
}
},
...
}
```
@ -255,8 +255,8 @@ A URL pointing to an image to be used as an icon for the relay. Recommended to b
```json
{
...
"icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg",
...
}
```

6
13.md
View File

@ -35,11 +35,7 @@ Example mined note
"created_at": 1651794653,
"kind": 1,
"tags": [
[
"nonce",
"776797",
"21"
]
["nonce", "776797", "21"]
],
"content": "It's just me mining my own business",
"sig": "284622fc0a3f4f1303455d5175f7ba962a3300d136085b9566801bc2e0699de0c7e31e44c81fb40ad9049173742e904713c3594a1da0fc5d2382a25c11aba977"

4
14.md
View File

@ -9,7 +9,9 @@ Subject tag in Text events
This NIP defines the use of the "subject" tag in text (kind: 1) events.
(implemented in more-speech)
`["subject": <string>]`
```json
["subject": <string>]
```
Browsers often display threaded lists of messages. The contents of the subject tag can be used in such lists, instead of the more ad hoc approach of using the first few words of the message. This is very similar to the way email browsers display lists of incoming emails by subject rather than by contents.

121
15.md
View File

@ -1,14 +1,14 @@
NIP-15
======
Nostr Marketplace (for resilient marketplaces)
-----------------------------------
Nostr Marketplace
-----------------
`draft` `optional`
> Based on https://github.com/lnbits/Diagon-Alley
Based on https://github.com/lnbits/Diagon-Alley.
> Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeian Market](https://github.com/PlebeianTech/plebeian-market)
Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeian Market](https://github.com/PlebeianTech/plebeian-market).
## Terms
@ -43,19 +43,20 @@ A merchant can publish these events:
### Event `30017`: Create or update a stall.
**Event Content**:
**Event Content**
```json
{
"id": <String, UUID generated by the merchant. Sequential IDs (`0`, `1`, `2`...) are discouraged>,
"name": <String, stall name>,
"description": <String (optional), stall description>,
"currency": <String, currency used>,
"id": <string, id generated by the merchant. Sequential IDs (`0`, `1`, `2`...) are discouraged>,
"name": <string, stall name>,
"description": <string (optional), stall description>,
"currency": <string, currency used>,
"shipping": [
{
"id": <String, UUID of the shipping zone, generated by the merchant>,
"name": <String (optional), zone name>,
"id": <string, id of the shipping zone, generated by the merchant>,
"name": <string (optional), zone name>,
"cost": <float, base cost for shipping. The currency is defined at the stall level>,
"regions": [<String, regions included in this zone>],
"regions": [<string, regions included in this zone>],
}
]
}
@ -70,31 +71,36 @@ Fields that are not self-explanatory:
- each shipping zone contains the base cost for orders made to that shipping zone, but a specific shipping cost per
product can also be specified if the shipping cost for that product is higher than what's specified by the base cost.
**Event Tags**:
**Event Tags**
```json
"tags": [["d", <String, id of stall]]
{
"tags": [["d", <string, id of stall]],
...
}
```
- the `d` tag is required, its value MUST be the same as the stall `id`.
### Event `30018`: Create or update a product
**Event Content**:
**Event Content**
```json
{
"id": <String, UUID generated by the merchant.Sequential IDs (`0`, `1`, `2`...) are discouraged>,
"stall_id": <String, UUID of the stall to which this product belong to>,
"name": <String, product name>,
"description": <String (optional), product description>,
"images": <[String], array of image URLs, optional>,
"currency": <String, currency used>,
"id": <string, id generated by the merchant (sequential ids are discouraged)>,
"stall_id": <string, id of the stall to which this product belong to>,
"name": <string, product name>,
"description": <string (optional), product description>,
"images": <[string], array of image URLs, optional>,
"currency": <string, currency used>,
"price": <float, cost of product>,
"quantity": <int or null, available items>,
"specs": [
[<String, spec key>, <String, spec value>]
[<string, spec key>, <string, spec value>]
],
"shipping": [
{
"id": <String, UUID of the shipping zone. Must match one of the zones defined for the stall>,
"id": <string, id of the shipping zone (must match one of the zones defined for the stall)>,
"cost": <float, extra cost for shipping. The currency is defined at the stall level>,
}
]
@ -116,14 +122,16 @@ Fields that are not self-explanatory:
- the `base cost from the stall` for the chosen shipping option
- the result of multiplying the product units by the `shipping costs specified in the product`, if any.
**Event Tags**:
**Event Tags**
```json
"tags": [
["d", <String, id of product],
["t", <String (optional), product category],
["t", <String (optional), product category],
["d", <string, id of product],
["t", <string (optional), product category],
["t", <string (optional), product category],
...
],
...
]
```
- the `d` tag is required, its value MUST be the same as the product `id`.
@ -147,23 +155,23 @@ The below json goes in content of [NIP04](https://github.com/nostr-protocol/nips
```json
{
"id": <String, UUID generated by the customer>,
"id": <string, id generated by the customer>,
"type": 0,
"name": <String (optional), ???>,
"address": <String (optional), for physical goods an address should be provided>
"message": "<String (optional), message for merchant>,
"name": <string (optional), ???>,
"address": <string (optional), for physical goods an address should be provided>
"message": "<string (optional), message for merchant>,
"contact": {
"nostr": <32-bytes hex of a pubkey>,
"phone": <String (optional), if the customer wants to be contacted by phone>,
"email": <String (optional), if the customer wants to be contacted by email>,
"phone": <string (optional), if the customer wants to be contacted by phone>,
"email": <string (optional), if the customer wants to be contacted by email>,
},
"items": [
{
"product_id": <String, UUID of the product>,
"product_id": <string, id of the product>,
"quantity": <int, how many products the customer is ordering>
}
],
"shipping_id": <String, UUID of the shipping zone>
"shipping_id": <string, id of the shipping zone>
}
```
@ -186,21 +194,21 @@ The below json goes in `content` of [NIP04](https://github.com/nostr-protocol/ni
```json
{
"id": <String, UUID of the order>,
"id": <string, id of the order>,
"type": 1,
"message": <String, message to customer, optional>,
"message": <string, message to customer, optional>,
"payment_options": [
{
"type": <String, option type>,
"link": <String, url, btc address, ln invoice, etc>
"type": <string, option type>,
"link": <string, url, btc address, ln invoice, etc>
},
{
"type": <String, option type>,
"link": <String, url, btc address, ln invoice, etc>
"type": <string, option type>,
"link": <string, url, btc address, ln invoice, etc>
},
{
"type": <String, option type>,
"link": <String, url, btc address, ln invoice, etc>
"type": <string, option type>,
"link": <string, url, btc address, ln invoice, etc>
}
]
}
@ -214,11 +222,11 @@ The below json goes in `content` of [NIP04](https://github.com/nostr-protocol/ni
```json
{
"id": <String, UUID of the order>,
"id": <string, id of the order>,
"type": 2,
"message": <String, message to customer>,
"paid": <Bool, true/false has received payment>,
"shipped": <Bool, true/false has been shipped>,
"message": <string, message to customer>,
"paid": <bool: has received payment>,
"shipped": <bool: has been shipped>,
}
```
## Customize Marketplace
@ -226,18 +234,19 @@ Create a customized user experience using the `naddr` from [NIP-19](https://gith
### Event `30019`: Create or update marketplace UI/UX
**Event Content**:
**Event Content**
```json
{
"name": <String (optional), market name>,
"about": <String (optional), market description>,
"name": <string (optional), market name>,
"about": <string (optional), market description>,
"ui": {
"picture": <String (optional), market logo image URL>,
"banner": <String (optional), market logo banner URL>,
"theme": <String (optional), market theme>,
"darkMode": <Bool, true/false>
"picture": <string (optional), market logo image URL>,
"banner": <string (optional), market logo banner URL>,
"theme": <string (optional), market theme>,
"darkMode": <bool, true/false>
},
"merchants": <[String] (optional), array of pubkeys>,
"merchants": [array of pubkeys (optional)],
...
}
```

9
32.md
View File

@ -64,7 +64,8 @@ A suggestion that multiple pubkeys be associated with the `permies` topic.
["l", "permies", "#t"],
["p", <pubkey1>, <relay_url>],
["p", <pubkey2>, <relay_url>]
]
],
...
}
```
@ -78,7 +79,8 @@ A report flagging violence toward a human being as defined by ontology.example.c
["l", "VI-hum", "com.example.ontology"],
["p", <pubkey1>, <relay_url>],
["p", <pubkey2>, <relay_url>]
]
],
...
}
```
@ -92,6 +94,7 @@ A moderation suggestion for a chat event.
["l", "approve", "nip28.moderation"],
["e", <kind40_event_id>, <relay_url>]
],
...
}
```
@ -105,6 +108,7 @@ Assignment of a license to an event.
["l", "MIT", "license"],
["e", <event_id>, <relay_url>]
],
...
}
```
@ -119,6 +123,7 @@ is labeling their note as being related to Milan, Italy using ISO 3166-2.
["l", "IT-MI", "ISO-3166-2"]
],
"content": "It's beautiful here in Milan!",
...
}
```

2
36.md
View File

@ -33,7 +33,7 @@ options:
["l", "reason", "content-warning"],
["L", "social.nos.ontology"],
["l", "NS-nud", "social.nos.ontology"],
["content-warning", "reason"] /* reason is optional */
["content-warning", "<optional reason>"]
],
"content": "sensitive content with #hastag\n",
"id": "<event-id>"

6
39.md
View File

@ -15,15 +15,13 @@ Nostr protocol users may have other online identities such as usernames, profile
A new optional `i` tag is introduced for `kind 0` metadata event contents in addition to name, about, picture fields as included in [NIP-01](https://github.com/nostr-protocol/nips/blob/master/01.md):
```json
{
"id": <id>,
"pubkey": <pubkey>,
...
"tags": [
["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"],
["i", "twitter:semisol_public", "1619358434134196225"],
["i", "mastodon:bitcoinhackers.org/@semisol", "109775066355589974"]
["i", "telegram:1087295469", "nostrdirectory/770"]
]
],
...
}
```

2
40.md
View File

@ -2,7 +2,7 @@ NIP-40
======
Expiration Timestamp
-----------------------------------
--------------------
`draft` `optional`

14
42.md
View File

@ -24,13 +24,13 @@ A relay may want to require clients to authenticate to access restricted resourc
This NIP defines a new message, `AUTH`, which relays can send when they support authentication and clients can send to relays when they want
to authenticate. When sent by relays, the message is of the following form:
```
```json
["AUTH", <challenge-string>]
```
And, when sent by clients, of the following form:
```
```json
["AUTH", <signed-event-json>]
```
@ -41,16 +41,12 @@ Relays MUST exclude `kind: 22242` events from being broadcasted to any client.
```json
{
"id": "...",
"pubkey": "...",
"created_at": 1669695536,
"kind": 22242,
"tags": [
["relay", "wss://relay.example.com/"],
["challenge", "challengestringhere"]
],
"content": "",
"sig": "..."
...
}
```
@ -67,13 +63,13 @@ is expected to last for the duration of the WebSocket connection.
Upon receiving a message from an unauthenticated user it can't fulfill without authentication, a relay may choose to notify the client. For
that it can use a `NOTICE` or `OK` message with a standard prefix `"restricted: "` that is readable both by humans and machines, for example:
```
```json
["NOTICE", "restricted: we can't serve DMs to unauthenticated users, does your client implement NIP-42?"]
```
or it can return an `OK` message noting the reason an event was not written using the same prefix:
```
```json
["OK", <event-id>, false, "restricted: we do not accept events from unauthenticated users, please sign up at https://example.com/"]
```

21
45.md
View File

@ -16,29 +16,36 @@ Some queries a client may want to execute against connected relays are prohibiti
This NIP defines the verb `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md) for the verb `REQ`. Multiple filters are OR'd together and aggregated into a single count result.
```
```json
["COUNT", <subscription_id>, <filters JSON>...]
```
Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements.
In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`.
```
```json
["COUNT", <subscription_id>, {"count": <integer>}]
```
Examples:
## Examples:
```
# Followers count
### Followers count
```json
["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}]
["COUNT", <subscription_id>, {"count": 238}]
```
# Count posts and reactions
### Count posts and reactions
```json
["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
["COUNT", <subscription_id>, {"count": 5}]
```
# Count posts approximately
### Count posts approximately
```
["COUNT", <subscription_id>, {"kinds": [1]}]
["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}]
```

30
53.md
View File

@ -6,17 +6,17 @@ Live Activities
`draft` `optional`
## Abstract
Service providers want to offer live activities to the Nostr network in such a way that participants can easily logged and queried by clients. This NIP describes a general framework to advertise the involvement of pubkeys in such live activities.
# Live Event
## Concepts
### Live Event
A special event with `kind:30311` "Live Event" is defined as a _parameterized replaceable event_ of public `p` tags. Each `p` tag SHOULD have a **displayable** marker name for the current role (e.g. `Host`, `Speaker`, `Participant`) of the user in the event and the relay information MAY be empty. This event will be constantly updated as participants join and leave the activity.
For example:
```js
```json
{
"kind": 30311,
"tags": [
@ -38,7 +38,7 @@ For example:
["relays", "wss://one.com", "wss://two.com", ...]
],
"content": "",
...other fields
...
}
```
@ -52,7 +52,7 @@ Live Activity management clients are expected to constantly update `kind:30311`
The activity MUST be linked to using the [NIP-19](19.md) `naddr` code along with the `a` tag.
## Proof of Agreement to Participate
### Proof of Agreement to Participate
Event owners can add proof as the 5th term in each `p` tag to clarify the participant's agreement in joining the event. The proof is a signed SHA256 of the complete `a` Tag of the event (`kind:pubkey:dTag`) by each `p`'s private key, encoded in hex.
@ -60,30 +60,28 @@ Clients MAY only display participants if the proof is available or MAY display p
This feature is important to avoid malicious event owners adding large account holders to the event, without their knowledge, to lure their followers into the malicious owner's trap.
# Live Chat Message
### Live Chat Message
Event `kind:1311` is live chat's channel message. Clients MUST include the `a` tag of the activity with a `root` marker. Other Kind-1 tags such as `reply` and `mention` can also be used.
```js
```json
{
"id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>",
"pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
"created_at": "<Unix timestamp in seconds>",
"kind": 1311,
"tags": [
["a", "30311:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>", "root"],
],
"content": "Zaps to live streams is beautiful."
"content": "Zaps to live streams is beautiful.",
...
}
```
# Use Cases
## Use Cases
Common use cases include meeting rooms/workshops, watch-together activities, or event spaces, such as [live.snort.social](https://live.snort.social) and [nostrnests.com](https://nostrnests.com).
# Example
## Example
Live Streaming
### Live Streaming
```json
{
@ -107,7 +105,7 @@ Live Streaming
}
```
Live Streaming chat message
### Live Streaming chat message
```json
{

1
56.md
View File

@ -1,4 +1,3 @@
NIP-56
======

14
72.md
View File

@ -14,7 +14,6 @@ The goal of this NIP is to create moderator-approved public communities around a
```json
{
...
"created_at": <Unix timestamp in seconds>,
"kind": 34550,
"tags": [
@ -34,7 +33,8 @@ The goal of this NIP is to create moderator-approved public communities around a
["relay", "<relay where to send and receive requests>", "requests"],
["relay", "<relay where to send and receive approvals>", "approvals"],
["relay", "<relay where to post requests to and fetch approvals from>"]
]
],
...
}
```
@ -44,12 +44,12 @@ Any Nostr event can be submitted to a community by anyone for approval. Clients
```json
{
...
"kind": 1,
"tags": [
["a", "34550:<community event author pubkey>:<community-d-identifier>", "<optional-relay-url>"],
],
"content": "hello world"
"content": "hello world",
...
}
```
@ -61,7 +61,6 @@ The post-approval event MUST include `a` tags of the communities the moderator i
```json
{
...
"pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
"kind": 4550,
"tags": [
@ -70,7 +69,8 @@ The post-approval event MUST include `a` tags of the communities the moderator i
["p", "<port-author-pubkey>", "<optional-relay-url>"],
["k", "<post-request-kind>"]
],
"content": "<the full approved event, JSON-encoded>"
"content": "<the full approved event, JSON-encoded>",
...
}
```
@ -86,7 +86,7 @@ Community clients SHOULD display posts that have been approved by at least 1 mod
The following filter displays the approved posts.
```js
```json
[
"REQ",
"_",

17
75.md
View File

@ -1,6 +1,8 @@
# NIP-75
NIP-75
======
## Zap Goals
Zap Goals
---------
`draft` `optional`
@ -27,7 +29,7 @@ Example event:
["amount", "210000"],
],
"content": "Nostrasia travel expenses",
...other fields
...
```
The following tags are OPTIONAL.
@ -43,7 +45,8 @@ The following tags are OPTIONAL.
["closed_at", "<unix timestamp in seconds>"],
],
"content": "Nostrasia travel expenses",
...other fields
...
}
```
The goal MAY include an `r` or `a` tag linking to a URL or parameterized replaceable event.
@ -54,12 +57,14 @@ Parameterized replaceable events can link to a goal by using a `goal` tag specif
```json
{
"kind": 3XXXX,
...
"kind": 3xxxx,
"tags": [
...
["goal", "<event id>", "<Relay URL (optional)>"],
],
...other fields
...
}
```
## Client behavior

7
84.md
View File

@ -27,9 +27,14 @@ useful when highlighting non-nostr content for which the client might be able to
last value of the tag.
```json
{
"tags": [
["p", "<pubkey-hex>", "<relay-url>", "author"],
["p", "<pubkey-hex>", "<relay-url>", "author"],
[ "p", "<pubkey-hex>", "<relay-url>", "editor" ],
["p", "<pubkey-hex>", "<relay-url>", "editor"]
],
...
}
```
### Context

42
89.md
View File

@ -9,10 +9,12 @@ Recommended Application Handlers
This NIP describes `kind:31989` and `kind:31990`: a way to discover applications that can handle unknown event-kinds.
## Rationale
Nostr's discoverability and transparent event interaction is one of its most interesting/novel mechanics.
This NIP provides a simple way for clients to discover applications that handle events of a specific kind to ensure smooth cross-client and cross-kind interactions.
### Parties involved
There are three actors to this workflow:
* application that handles a specific event kind (note that an application doesn't necessarily need to be a distinct entity and it could just be the same pubkey as user A)
@ -22,9 +24,9 @@ There are three actors to this workflow:
* user B, who seeks a recommendation for an app that handles a specific event kind
* Queries for `kind:31989` and, based on results, queries for `kind:31990`
# Events
## Events
## Recommendation event
### Recommendation event
```json
{
"kind": 31989,
@ -48,7 +50,7 @@ The third value of the tag SHOULD be the platform where this recommendation migh
```json
{
"kind": 31990,
"pubkey": <pubkey>,
"pubkey": "<application-pubkey>",
"content": "<optional-kind:0-style-metadata>",
"tags": [
["d", <random-id>],
@ -62,19 +64,17 @@ The third value of the tag SHOULD be the platform where this recommendation migh
```
* `content` is an optional `metadata`-like stringified JSON object, as described in NIP-01. This content is useful when the pubkey creating the `kind:31990` is not an application. If `content` is empty, the `kind:0` of the pubkey should be used to display application information (e.g. name, picture, web, LUD16, etc.)
* `k` tags' value is the event kind that is supported by this `kind:31990`.
Using a `k` tag(s) (instead of having the kind onf the NIP-33 `d` tag) provides:
* Multiple `k` tags can exist in the same event if the application supports more than one event kind and their handler URLs are the same.
* The same pubkey can have multiple events with different apps that handle the same event kind.
* `bech32` in a URL MUST be replaced by clients with the NIP-19-encoded entity that should be loaded by the application.
Multiple tags might be registered by the app, following NIP-19 nomenclature as the second value of the array.
A tag without a second value in the array SHOULD be considered a generic handler for any NIP-19 entity that is not handled by a different tag.
# Client tag
## Client tag
When publishing events, clients MAY include a `client` tag in the same format as the recommendation event's `a` tags. This has privacy implications for users, so clients SHOULD allow users to opt-out of using this tag.
```json
@ -87,16 +87,16 @@ When publishing events, clients MAY include a `client` tag in the same format as
}
```
# User flow
## User flow
A user A who uses a non-`kind:1`-centric nostr app could choose to announce/recommend a certain kind-handler application.
When user B sees an unknown event kind, e.g. in a social-media centric nostr client, the client would allow user B to interact with the unknown-kind event (e.g. tapping on it).
The client MIGHT query for the user's and the user's follows handler.
# Example
## Example
## User A recommends a `kind:31337`-handler
### User A recommends a `kind:31337`-handler
User A might be a user of Zapstr, a `kind:31337`-centric client (tracks). Using Zapstr, user A publishes an event recommending Zapstr as a `kind:31337`-handler.
```json
@ -105,25 +105,27 @@ User A might be a user of Zapstr, a `kind:31337`-centric client (tracks). Using
"tags": [
["d", "31337"],
["a", "31990:1743058db7078661b94aaf4286429d97ee5257d14a86d6bfa54cb0482b876fb0:abcd", <relay-url>, "web"]
]
],
...
}
```
## User B interacts with a `kind:31337`-handler
User B might see in their timeline an event referring to a `kind:31337` event
(e.g. a `kind:1` tagging a `kind:31337`).
### User B interacts with a `kind:31337`-handler
User B might see in their timeline an event referring to a `kind:31337` event (e.g. a `kind:1` tagging a `kind:31337`).
User B's client, not knowing how to handle a `kind:31337` might display the event
using its `alt` tag (as described in NIP-31). When the user clicks on the event,
the application queries for a handler for this `kind`:
User B's client, not knowing how to handle a `kind:31337` might display the event using its `alt` tag (as described in NIP-31). When the user clicks on the event, the application queries for a handler for this `kind`:
`["REQ", <id>, '[{ "kinds": [31989], "#d": ["31337"], 'authors': [<user>, <users-contact-list>] }]']`
```json
["REQ", <id>, '[{ "kinds": [31989], "#d": ["31337"], 'authors': [<user>, <users-contact-list>] }]']
```
User B, who follows User A, sees that `kind:31989` event and fetches the `a`-tagged event for the app and handler information.
User B's client sees the application's `kind:31990` which includes the information to redirect the user to the relevant URL with the desired entity replaced in the URL.
## Alternative query bypassing `kind:31989`
Alternatively, users might choose to query directly for `kind:31990` for an event kind. Clients SHOULD be careful doing this and use spam-prevention mechanisms to avoid directing users to malicious handlers.
### Alternative query bypassing `kind:31989`
Alternatively, users might choose to query directly for `kind:31990` 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.
`["REQ", <id>, '[{ "kinds": [31990], "#k": [<desired-event-kind>], 'authors': [...] }]']`
```json
["REQ", <id>, '[{ "kinds": [31990], "#k": [<desired-event-kind>], 'authors': [...] }]']
```

29
90.md
View File

@ -80,21 +80,21 @@ If the user wants to keep the input parameters a secret, they can encrypt the `i
["param", "top-k", "50"],
["param", "top-p", "0.7"],
["param", "frequency_penalty", "1"]
]
```
This param data will be encrypted and added to the `content` field and `p` tag should be present
```
```json
{
"content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...",
"tags": [
["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"],
["encrypted"]
]
],
...
}
```
@ -113,7 +113,8 @@ Service providers publish job results, providing the output of the job result. T
["i", "<input-data>"],
["p", "<customer's-pubkey>"],
["amount", "requested-payment-amount", "<optional-bolt11>"]
]
],
...
}
```
@ -125,6 +126,7 @@ Service providers publish job results, providing the output of the job result. T
If the request has encrypted params, then output should be encrypted and placed in `content` field. If the output is encrypted, then avoid including `i` tag with input-data as clear text.
Add a tag encrypted to mark the output content as `encrypted`
```json
{
"pubkey": "<service-provider pubkey>",
@ -136,13 +138,13 @@ Add a tag encrypted to mark the output content as `encrypted`
["p", "<customer's-pubkey>"],
["amount", "requested-payment-amount", "<optional-bolt11>"],
["encrypted"]
]
],
...
}
```
## Job feedback
Service providers can give feedback about a job back to the customer.
```json
@ -154,7 +156,8 @@ Service providers can give feedback about a job back to the customer.
["amount", "requested-payment-amount", "<bolt11>"],
["e", "<job-request-id>", "<relay-hint>"],
["p", "<customer's-pubkey>"],
]
],
...
}
```
@ -178,6 +181,7 @@ Any job feedback event MIGHT include results in the `.content` field, as describ
# Protocol Flow
* Customer publishes a job request (e.g. `kind:5000` speech-to-text).
* Service Providers MAY submit `kind:7000` job-feedback events (e.g. `payment-required`, `processing`, `error`, etc.).
* Upon completion, the service provider publishes the result of the job with a `kind:6000` job-result event.
@ -207,7 +211,7 @@ This gives a higher level of flexibility to service providers (which sophisticat
# Appendix 2: Service provider discoverability
Service Providers MAY use NIP-89 announcements to advertise their support for job kinds:
```json
```js
{
"kind": 31990,
"pubkey": "<pubkey>",
@ -218,7 +222,8 @@ Service Providers MAY use NIP-89 announcements to advertise their support for jo
"tags": [
["k", "5005"], // e.g. translation
["t", "bitcoin"] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains"
]
],
...
}
```

7
94.md
View File

@ -28,9 +28,6 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr
```json
{
"id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data>,
"pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
"created_at": <unix timestamp in seconds>,
"kind": 1063,
"tags": [
["url",<string with URI of file>],
@ -47,8 +44,8 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr
["summary", <excerpt>],
["alt", <description>]
],
"content": <caption>,
"sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field>
"content": "<caption>",
...
}
```

12
98.md
View File

@ -2,7 +2,7 @@ NIP-98
======
HTTP Auth
-------------------------
---------
`draft` `optional`
@ -30,14 +30,8 @@ Example event:
"kind": 27235,
"created_at": 1682327852,
"tags": [
[
"u",
"https://api.snort.social/api/v1/n5sp/list"
],
[
"method",
"GET"
]
["u", "https://api.snort.social/api/v1/n5sp/list"],
["method", "GET"]
],
"sig": "5ed9d8ec958bc854f997bdc24ac337d005af372324747efe4a00e24f4c30437ff4dd8308684bed467d9d6be3e5a517bb43b1732cc7d33949a3aaf86705c22184"
}

6
99.md
View File

@ -1,6 +1,8 @@
# NIP-99
NIP-99
======
## Classified Listings
Classified Listings
-------------------
`draft` `optional`