diff options
| author | pablof7z <p@f7z.io> | 2023-07-23 23:37:20 +0300 |
|---|---|---|
| committer | pablof7z <p@f7z.io> | 2023-07-23 23:37:20 +0300 |
| commit | d8b0e7d757206098f65b8ff868e8c59a9ac92ea6 (patch) | |
| tree | 28e23e4ec54e90e25f1e0665c9a8adb2d26df77e | |
| parent | 53bd97373b5442445f5c387945cf5685ac39ab80 (diff) | |
wip
| -rw-r--r-- | vending-machine.md | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/vending-machine.md b/vending-machine.md index 4dbc5a3..4934d4c 100644 --- a/vending-machine.md +++ b/vending-machine.md | |||
| @@ -9,13 +9,13 @@ Data Vending Machine | |||
| 9 | This NIP defines the interaction between customers and Service Providers to perform on-demand computation. | 9 | This NIP defines the interaction between customers and Service Providers to perform on-demand computation. |
| 10 | 10 | ||
| 11 | ## Kinds | 11 | ## Kinds |
| 12 | This NIP reserves the range `65000-69999` for data vending machine use. | 12 | This NIP reserves the range `65000-66000` for data vending machine use. |
| 13 | 13 | ||
| 14 | | Kind | Description | | 14 | | Kind | Description | |
| 15 | | ---- | ----------- | | 15 | | ---- | ----------- | |
| 16 | | 65000 | Job feedback | | 16 | | 65000 | Job feedback | |
| 17 | | 65001 | Job result | | 17 | | 65001 | Job result | |
| 18 | | 65002-69999 | Job request kinds | | 18 | | 65002-66000 | Job request kinds | |
| 19 | 19 | ||
| 20 | ## Rationale | 20 | ## Rationale |
| 21 | Nostr can act as a marketplace for data processing, where users request jobs to be processed in certain ways (e.g. "speech-to-text", "summarization", etc.), but where they don't necessarily care about "who" processes the data. | 21 | Nostr can act as a marketplace for data processing, where users request jobs to be processed in certain ways (e.g. "speech-to-text", "summarization", etc.), but where they don't necessarily care about "who" processes the data. |
| @@ -33,7 +33,7 @@ A request to have data processed -- published by a customer | |||
| 33 | 33 | ||
| 34 | ```json | 34 | ```json |
| 35 | { | 35 | { |
| 36 | "kind": 6xxxx, | 36 | "kind": <65002-66000>, |
| 37 | "content": "", | 37 | "content": "", |
| 38 | "tags": [ | 38 | "tags": [ |
| 39 | [ "i", "<data>", "<input-type>", "<marker>", "<relay>" ], | 39 | [ "i", "<data>", "<input-type>", "<marker>", "<relay>" ], |
| @@ -46,6 +46,8 @@ A request to have data processed -- published by a customer | |||
| 46 | } | 46 | } |
| 47 | ``` | 47 | ``` |
| 48 | 48 | ||
| 49 | All tags are optional. | ||
| 50 | |||
| 49 | * `i` tag: Input data for the job, (zero or more inputs may exist) | 51 | * `i` tag: Input data for the job, (zero or more inputs may exist) |
| 50 | * `<data>`: The argument for the input | 52 | * `<data>`: The argument for the input |
| 51 | * `<input-type>`: The way this argument should be interpreted, MUST be one of: | 53 | * `<input-type>`: The way this argument should be interpreted, MUST be one of: |
| @@ -55,11 +57,11 @@ A request to have data processed -- published by a customer | |||
| 55 | * `content`: | 57 | * `content`: |
| 56 | * `<marker>`: an optional field indicating how this input should be used. | 58 | * `<marker>`: an optional field indicating how this input should be used. |
| 57 | * `<relay>`: if `event` or `job` input-type, the relay where the event/job was published, otherwise optional or empty string. | 59 | * `<relay>`: if `event` or `job` input-type, the relay where the event/job was published, otherwise optional or empty string. |
| 58 | * `output` tag (opt): MIME type. Expected output format. Service Providers SHOULD publish the result of the job in this format if it has been specified. | 60 | * `output`: MIME type. Expected output format. Service Providers SHOULD publish the result of the job in this format if it has been specified. |
| 59 | * `bid` tag (opt): Customer MAY specify a maximum amount (in millisats) they are willing to pay. | 61 | * `bid`: Customer MAY specify a maximum amount (in millisats) they are willing to pay. |
| 60 | * `relays` tag: relays where Service Providers SHOULD publish responses to. | 62 | * `relays`: relays where Service Providers SHOULD publish responses to. |
| 61 | * `p` tags (opt): Service Providers the customer is interested in having process this job. Other SP MIGHT still choose to process the job. | 63 | * `p`: Service Providers the customer is interested in. Other SP MIGHT still choose to process the job. |
| 62 | * `exp` (opt): expiration timestamp. Service Providers SHOULD not send results after this timestamp. | 64 | * `exp`: expiration timestamp. Service Providers SHOULD not send results after this timestamp. |
| 63 | 65 | ||
| 64 | ## Job result | 66 | ## Job result |
| 65 | The output of processing the data -- published by the Service Provider. | 67 | The output of processing the data -- published by the Service Provider. |