mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-08-31 21:40:48 -04:00
format(all): json formatting
This commit is contained in:
26
90.md
26
90.md
@@ -36,7 +36,7 @@ There are two actors in the workflow described in this NIP:
|
||||
## Job request (`kind:5000-5999`)
|
||||
A request to process data, published by a customer. This event signals that a customer is interested in receiving the result of some kind of compute.
|
||||
|
||||
```json
|
||||
```jsonc
|
||||
{
|
||||
"kind": 5xxx, // kind in 5000-5999 range
|
||||
"content": "",
|
||||
@@ -46,7 +46,8 @@ A request to process data, published by a customer. This event signals that a cu
|
||||
[ "relays", "wss://..." ],
|
||||
[ "bid", "<msat-amount>" ],
|
||||
[ "t", "bitcoin" ]
|
||||
]
|
||||
],
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -81,19 +82,18 @@ If the user wants to keep the input parameters a secret, they can encrypt the `i
|
||||
["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
|
||||
```jsonc
|
||||
{
|
||||
"content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...",
|
||||
"tags": [
|
||||
["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"],
|
||||
["encrypted"]
|
||||
],
|
||||
...
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -102,7 +102,7 @@ This param data will be encrypted and added to the `content` field and `p` tag s
|
||||
|
||||
Service providers publish job results, providing the output of the job result. They should tag the original job request event id as well as the customer's pubkey.
|
||||
|
||||
```json
|
||||
```jsonc
|
||||
{
|
||||
"pubkey": "<service-provider pubkey>",
|
||||
"content": "<payload>",
|
||||
@@ -114,7 +114,7 @@ Service providers publish job results, providing the output of the job result. T
|
||||
["p", "<customer's-pubkey>"],
|
||||
["amount", "requested-payment-amount", "<optional-bolt11>"]
|
||||
],
|
||||
...
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -127,7 +127,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
|
||||
```jsonc
|
||||
{
|
||||
"pubkey": "<service-provider pubkey>",
|
||||
"content": "<encrypted payload>",
|
||||
@@ -139,7 +139,7 @@ Add a tag encrypted to mark the output content as `encrypted`
|
||||
["amount", "requested-payment-amount", "<optional-bolt11>"],
|
||||
["encrypted"]
|
||||
],
|
||||
...
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -147,7 +147,7 @@ Add a tag encrypted to mark the output content as `encrypted`
|
||||
|
||||
Service providers can give feedback about a job back to the customer.
|
||||
|
||||
```json
|
||||
```jsonc
|
||||
{
|
||||
"kind": 7000,
|
||||
"content": "<empty-or-payload>",
|
||||
@@ -157,7 +157,7 @@ Service providers can give feedback about a job back to the customer.
|
||||
["e", "<job-request-id>", "<relay-hint>"],
|
||||
["p", "<customer's-pubkey>"],
|
||||
],
|
||||
...
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -211,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:
|
||||
|
||||
```js
|
||||
```jsonc
|
||||
{
|
||||
"kind": 31990,
|
||||
"pubkey": "<pubkey>",
|
||||
@@ -223,7 +223,7 @@ Service Providers MAY use NIP-89 announcements to advertise their support for jo
|
||||
["k", "5005"], // e.g. translation
|
||||
["t", "bitcoin"] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains"
|
||||
],
|
||||
...
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user