diff options
Diffstat (limited to '90.md')
| -rw-r--r-- | 90.md | 28 |
1 files changed, 14 insertions, 14 deletions
| @@ -36,7 +36,7 @@ There are two actors in the workflow described in this NIP: | |||
| 36 | ## Job request (`kind:5000-5999`) | 36 | ## Job request (`kind:5000-5999`) |
| 37 | 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. | 37 | 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. |
| 38 | 38 | ||
| 39 | ```json | 39 | ```jsonc |
| 40 | { | 40 | { |
| 41 | "kind": 5xxx, // kind in 5000-5999 range | 41 | "kind": 5xxx, // kind in 5000-5999 range |
| 42 | "content": "", | 42 | "content": "", |
| @@ -46,7 +46,8 @@ A request to process data, published by a customer. This event signals that a cu | |||
| 46 | [ "relays", "wss://..." ], | 46 | [ "relays", "wss://..." ], |
| 47 | [ "bid", "<msat-amount>" ], | 47 | [ "bid", "<msat-amount>" ], |
| 48 | [ "t", "bitcoin" ] | 48 | [ "t", "bitcoin" ] |
| 49 | ] | 49 | ], |
| 50 | // other fields... | ||
| 50 | } | 51 | } |
| 51 | ``` | 52 | ``` |
| 52 | 53 | ||
| @@ -81,19 +82,18 @@ If the user wants to keep the input parameters a secret, they can encrypt the `i | |||
| 81 | ["param", "top-p", "0.7"], | 82 | ["param", "top-p", "0.7"], |
| 82 | ["param", "frequency_penalty", "1"] | 83 | ["param", "frequency_penalty", "1"] |
| 83 | ] | 84 | ] |
| 84 | |||
| 85 | ``` | 85 | ``` |
| 86 | 86 | ||
| 87 | This param data will be encrypted and added to the `content` field and `p` tag should be present | 87 | This param data will be encrypted and added to the `content` field and `p` tag should be present |
| 88 | 88 | ||
| 89 | ```json | 89 | ```jsonc |
| 90 | { | 90 | { |
| 91 | "content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...", | 91 | "content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...", |
| 92 | "tags": [ | 92 | "tags": [ |
| 93 | ["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"], | 93 | ["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"], |
| 94 | ["encrypted"] | 94 | ["encrypted"] |
| 95 | ], | 95 | ], |
| 96 | ... | 96 | // other fields... |
| 97 | } | 97 | } |
| 98 | ``` | 98 | ``` |
| 99 | 99 | ||
| @@ -102,7 +102,7 @@ This param data will be encrypted and added to the `content` field and `p` tag s | |||
| 102 | 102 | ||
| 103 | 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. | 103 | 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. |
| 104 | 104 | ||
| 105 | ```json | 105 | ```jsonc |
| 106 | { | 106 | { |
| 107 | "pubkey": "<service-provider pubkey>", | 107 | "pubkey": "<service-provider pubkey>", |
| 108 | "content": "<payload>", | 108 | "content": "<payload>", |
| @@ -114,7 +114,7 @@ Service providers publish job results, providing the output of the job result. T | |||
| 114 | ["p", "<customer's-pubkey>"], | 114 | ["p", "<customer's-pubkey>"], |
| 115 | ["amount", "requested-payment-amount", "<optional-bolt11>"] | 115 | ["amount", "requested-payment-amount", "<optional-bolt11>"] |
| 116 | ], | 116 | ], |
| 117 | ... | 117 | // other fields... |
| 118 | } | 118 | } |
| 119 | ``` | 119 | ``` |
| 120 | 120 | ||
| @@ -127,7 +127,7 @@ Service providers publish job results, providing the output of the job result. T | |||
| 127 | 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. | 127 | 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. |
| 128 | Add a tag encrypted to mark the output content as `encrypted` | 128 | Add a tag encrypted to mark the output content as `encrypted` |
| 129 | 129 | ||
| 130 | ```json | 130 | ```jsonc |
| 131 | { | 131 | { |
| 132 | "pubkey": "<service-provider pubkey>", | 132 | "pubkey": "<service-provider pubkey>", |
| 133 | "content": "<encrypted payload>", | 133 | "content": "<encrypted payload>", |
| @@ -139,7 +139,7 @@ Add a tag encrypted to mark the output content as `encrypted` | |||
| 139 | ["amount", "requested-payment-amount", "<optional-bolt11>"], | 139 | ["amount", "requested-payment-amount", "<optional-bolt11>"], |
| 140 | ["encrypted"] | 140 | ["encrypted"] |
| 141 | ], | 141 | ], |
| 142 | ... | 142 | // other fields... |
| 143 | } | 143 | } |
| 144 | ``` | 144 | ``` |
| 145 | 145 | ||
| @@ -147,7 +147,7 @@ Add a tag encrypted to mark the output content as `encrypted` | |||
| 147 | 147 | ||
| 148 | Service providers can give feedback about a job back to the customer. | 148 | Service providers can give feedback about a job back to the customer. |
| 149 | 149 | ||
| 150 | ```json | 150 | ```jsonc |
| 151 | { | 151 | { |
| 152 | "kind": 7000, | 152 | "kind": 7000, |
| 153 | "content": "<empty-or-payload>", | 153 | "content": "<empty-or-payload>", |
| @@ -157,7 +157,7 @@ Service providers can give feedback about a job back to the customer. | |||
| 157 | ["e", "<job-request-id>", "<relay-hint>"], | 157 | ["e", "<job-request-id>", "<relay-hint>"], |
| 158 | ["p", "<customer's-pubkey>"], | 158 | ["p", "<customer's-pubkey>"], |
| 159 | ], | 159 | ], |
| 160 | ... | 160 | // other fields... |
| 161 | } | 161 | } |
| 162 | ``` | 162 | ``` |
| 163 | 163 | ||
| @@ -185,7 +185,7 @@ Any job feedback event MIGHT include results in the `.content` field, as describ | |||
| 185 | * Customer publishes a job request (e.g. `kind:5000` speech-to-text). | 185 | * Customer publishes a job request (e.g. `kind:5000` speech-to-text). |
| 186 | * Service Providers MAY submit `kind:7000` job-feedback events (e.g. `payment-required`, `processing`, `error`, etc.). | 186 | * Service Providers MAY submit `kind:7000` job-feedback events (e.g. `payment-required`, `processing`, `error`, etc.). |
| 187 | * Upon completion, the service provider publishes the result of the job with a `kind:6000` job-result event. | 187 | * Upon completion, the service provider publishes the result of the job with a `kind:6000` job-result event. |
| 188 | * At any point, if there is an `amount` pending to be paid as instructed by the service provider, the user can pay the included `bolt11` or zap the job result event the service provider has sent to the user | 188 | * At any point, if there is an `amount` pending to be paid as instructed by the service provider, the user can pay the included `bolt11` or zap the job result event the service provider has sent to the user. |
| 189 | 189 | ||
| 190 | Job feedback (`kind:7000`) and Job Results (`kind:6000-6999`) events MAY include an `amount` tag, this can be interpreted as a suggestion to pay. Service Providers MUST use the `payment-required` feedback event to signal that a payment is required and no further actions will be performed until the payment is sent. | 190 | Job feedback (`kind:7000`) and Job Results (`kind:6000-6999`) events MAY include an `amount` tag, this can be interpreted as a suggestion to pay. Service Providers MUST use the `payment-required` feedback event to signal that a payment is required and no further actions will be performed until the payment is sent. |
| 191 | 191 | ||
| @@ -211,7 +211,7 @@ This gives a higher level of flexibility to service providers (which sophisticat | |||
| 211 | # Appendix 2: Service provider discoverability | 211 | # Appendix 2: Service provider discoverability |
| 212 | Service Providers MAY use NIP-89 announcements to advertise their support for job kinds: | 212 | Service Providers MAY use NIP-89 announcements to advertise their support for job kinds: |
| 213 | 213 | ||
| 214 | ```js | 214 | ```jsonc |
| 215 | { | 215 | { |
| 216 | "kind": 31990, | 216 | "kind": 31990, |
| 217 | "pubkey": "<pubkey>", | 217 | "pubkey": "<pubkey>", |
| @@ -223,7 +223,7 @@ Service Providers MAY use NIP-89 announcements to advertise their support for jo | |||
| 223 | ["k", "5005"], // e.g. translation | 223 | ["k", "5005"], // e.g. translation |
| 224 | ["t", "bitcoin"] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains" | 224 | ["t", "bitcoin"] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains" |
| 225 | ], | 225 | ], |
| 226 | ... | 226 | // other fields... |
| 227 | } | 227 | } |
| 228 | ``` | 228 | ``` |
| 229 | 229 | ||