diff options
| author | pablof7z <p@f7z.io> | 2023-07-11 22:25:54 +0200 |
|---|---|---|
| committer | pablof7z <p@f7z.io> | 2023-07-11 22:25:54 +0200 |
| commit | def620e1ce4417a4e78b5012c3a43adbe105f43e (patch) | |
| tree | 7df4b7df0fff872d0cdf8ff7e63ddcf82d086d20 | |
| parent | a9dd5574531229df065eb9df2212bb7510db1f61 (diff) | |
more cleanup
| -rw-r--r-- | vending-machine.md | 57 |
1 files changed, 36 insertions, 21 deletions
diff --git a/vending-machine.md b/vending-machine.md index 0f0b003..8121ffc 100644 --- a/vending-machine.md +++ b/vending-machine.md | |||
| @@ -27,19 +27,10 @@ A request to have data processed -- published by a customer | |||
| 27 | "kind": 68001, | 27 | "kind": 68001, |
| 28 | "content": "", | 28 | "content": "", |
| 29 | "tags": [ | 29 | "tags": [ |
| 30 | // The type of data processing the user wants to be performed | ||
| 31 | [ "j", "<job-type>", "<optional-model>" ], | 30 | [ "j", "<job-type>", "<optional-model>" ], |
| 32 | |||
| 33 | // input(s) for the job request | ||
| 34 | [ "i", "<data>", "<input-type>", "<marker>" ], | 31 | [ "i", "<data>", "<input-type>", "<marker>" ], |
| 35 | 32 | [ "output", "<mime-type>" ], | |
| 36 | // expected output format | ||
| 37 | [ "output", "mimetype" ], | ||
| 38 | |||
| 39 | // relays where the job result should be published | ||
| 40 | [ "relays", "wss://..."], | 33 | [ "relays", "wss://..."], |
| 41 | |||
| 42 | // millisats amount that the user is offering to pay | ||
| 43 | [ "bid", "<msat-amount>", "<optional-max-price>" ], | 34 | [ "bid", "<msat-amount>", "<optional-max-price>" ], |
| 44 | [ "exp", "<timestamp>" ], | 35 | [ "exp", "<timestamp>" ], |
| 45 | [ "p", "service-provider-1" ], | 36 | [ "p", "service-provider-1" ], |
| @@ -94,7 +85,6 @@ The result of the job SHOULD be included in the `content` field. If the output i | |||
| 94 | * `status` tag: Service Providers MAY indicate errors or extra info about the results by including them in the `status` tag. | 85 | * `status` tag: Service Providers MAY indicate errors or extra info about the results by including them in the `status` tag. |
| 95 | * `amount`: millisats that the Service Provider is requesting to be paid. | 86 | * `amount`: millisats that the Service Provider is requesting to be paid. |
| 96 | 87 | ||
| 97 | ## | ||
| 98 | # Protocol Flow | 88 | # Protocol Flow |
| 99 | * Customer publishes a job request | 89 | * Customer publishes a job request |
| 100 | `{ "kind": 68001, "tags": [ [ "j", "speech-to-text" ], ... ] }` | 90 | `{ "kind": 68001, "tags": [ [ "j", "speech-to-text" ], ... ] }` |
| @@ -127,7 +117,7 @@ Service Providers might opt to give feedback about a job. | |||
| 127 | ### E.g. Payment required | 117 | ### E.g. Payment required |
| 128 | ```json | 118 | ```json |
| 129 | { | 119 | { |
| 130 | "kind": 7, | 120 | "kind": 68003, |
| 131 | "content": "Please pay 7 sats for job xxxx", | 121 | "content": "Please pay 7 sats for job xxxx", |
| 132 | "tags": [ | 122 | "tags": [ |
| 133 | [ "e", <job-request-id> ], | 123 | [ "e", <job-request-id> ], |
| @@ -148,11 +138,6 @@ Service providers are at obvious risk of having their results not compensated. M | |||
| 148 | 138 | ||
| 149 | It's out of scope (and undesirable) to have this NIP address this issue; the market should. | 139 | It's out of scope (and undesirable) to have this NIP address this issue; the market should. |
| 150 | 140 | ||
| 151 | ## Notes | ||
| 152 | |||
| 153 | ### Multitple job acceptance | ||
| 154 | * Nothing prevents a user from accepting multiple job results. | ||
| 155 | |||
| 156 | # Appendix 1: Examples | 141 | # Appendix 1: Examples |
| 157 | 142 | ||
| 158 | ## Transcript of a podcast from second `900` to `930`. | 143 | ## Transcript of a podcast from second `900` to `930`. |
| @@ -162,7 +147,7 @@ It's out of scope (and undesirable) to have this NIP address this issue; the mar | |||
| 162 | { | 147 | { |
| 163 | "id": "12345", | 148 | "id": "12345", |
| 164 | "pubkey": "abcdef", | 149 | "pubkey": "abcdef", |
| 165 | "content": "I need a transcript of Bitcoin.review", | 150 | "content": "", |
| 166 | "tags": [ | 151 | "tags": [ |
| 167 | [ "j", "speech-to-text" ], | 152 | [ "j", "speech-to-text" ], |
| 168 | [ "i", "https://bitcoin.review/episode1.mp3", "url" ], | 153 | [ "i", "https://bitcoin.review/episode1.mp3", "url" ], |
| @@ -173,13 +158,30 @@ It's out of scope (and undesirable) to have this NIP address this issue; the mar | |||
| 173 | } | 158 | } |
| 174 | ``` | 159 | ``` |
| 175 | 160 | ||
| 176 | ### `kind:68002`: Job fulfillment | 161 | ### `kind:68003`: Job Feedback: request for (partial) payment |
| 162 | ```json | ||
| 163 | { | ||
| 164 | "kind": 68003, | ||
| 165 | "content": "", | ||
| 166 | "tags": [ | ||
| 167 | ["e", "12345"], | ||
| 168 | ["p", "abcdef"], | ||
| 169 | ["status", "payment-required"], | ||
| 170 | ["amount", "1000"] | ||
| 171 | ] | ||
| 172 | } | ||
| 173 | ``` | ||
| 174 | |||
| 175 | * User zaps 1000 sats to event kind:68003. | ||
| 176 | |||
| 177 | ### `kind:68002`: Job fulfillment + request for remaining payment | ||
| 177 | ```json | 178 | ```json |
| 178 | { | 179 | { |
| 179 | "content": "blah blah blah", | 180 | "content": "blah blah blah", |
| 180 | "tags": [ | 181 | "tags": [ |
| 181 | ["e", "12345"], | 182 | ["e", "12345"], |
| 182 | ["p", "abcdef"], | 183 | ["p", "abcdef"], |
| 184 | ["amount", "6000"] | ||
| 183 | ] | 185 | ] |
| 184 | } | 186 | } |
| 185 | ``` | 187 | ``` |
| @@ -208,7 +210,7 @@ User publishes two job requests at the same time in the order they should be exe | |||
| 208 | { | 210 | { |
| 209 | "id": "12346", | 211 | "id": "12346", |
| 210 | "pubkey": "abcdef", | 212 | "pubkey": "abcdef", |
| 211 | "content": "I need a summarization", | 213 | "content": "", |
| 212 | "tags": [ | 214 | "tags": [ |
| 213 | [ "j", "summarization" ], | 215 | [ "j", "summarization" ], |
| 214 | [ "params", "length", "3 paragraphs" ], | 216 | [ "params", "length", "3 paragraphs" ], |
| @@ -227,13 +229,26 @@ User publishes two job requests at the same time in the order they should be exe | |||
| 227 | "content": "", | 229 | "content": "", |
| 228 | "tags": [ | 230 | "tags": [ |
| 229 | [ "j", "translation" ], | 231 | [ "j", "translation" ], |
| 230 | [ "i", "<hexid>", "event" ] | 232 | [ "i", "<hexid>", "event", "wss://relay.nostr.com" ] |
| 231 | [ "params", "language", "es_AR" ], | 233 | [ "params", "language", "es_AR" ], |
| 232 | [ "bid", "100", "500" ] | 234 | [ "bid", "100", "500" ] |
| 233 | ] | 235 | ] |
| 234 | } | 236 | } |
| 235 | ``` | 237 | ``` |
| 236 | 238 | ||
| 239 | ### `kind:68003`: Job respomse | ||
| 240 | ```json | ||
| 241 | { | ||
| 242 | "kind": 68003, | ||
| 243 | "content": "Che, que copado, boludo!", | ||
| 244 | "tags": [ | ||
| 245 | ["e", "12346"], | ||
| 246 | ["p", "abcdef"], | ||
| 247 | ["amount", "1000"] | ||
| 248 | ] | ||
| 249 | } | ||
| 250 | ``` | ||
| 251 | |||
| 237 | ## AI-image of the summarization of 2 podcasts | 252 | ## AI-image of the summarization of 2 podcasts |
| 238 | 253 | ||
| 239 | ### `kind:68001`: Job request #1 (transcribe podcast #1) | 254 | ### `kind:68001`: Job request #1 (transcribe podcast #1) |