From e9610d61e3e2d738050ec02ea0f01af42aaa45ca Mon Sep 17 00:00:00 2001 From: Arc Date: Tue, 10 Oct 2023 22:27:08 +0100 Subject: [PATCH] Added Nostr IoT --- 107.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 107.md diff --git a/107.md b/107.md new file mode 100644 index 0000000..bc4d61e --- /dev/null +++ b/107.md @@ -0,0 +1,73 @@ +NIP-107 +====== + +Nostr Internet of Things +----------------------------------- + +`draft` `optional` `author:benarc` `author:blackcoffeebtc` + +## Ratioanale + +The terms/conditions of IoT software/hardware is horrible. A user should be able to message a light or heating and ask it to turn on/off. Nostr gives the simple, permissionless development enviroment IoT needs. + +All communication happens over [NIP04](https://github.com/nostr-protocol/nips/blob/master/04.md). + +## Terms + +- `user` - user operating IoT device with NOSTR key-pair and a client made specifically for IoT +- `device` - device to operate over Nostr with NOSTR key-pair, using a microcontroller client like nostr-arduino + + +## Nostr IoT Clients + +### User + +Where the `user` registers 'device'(s) and its keys, then updates the `device`(s). + +### Device + +The `device` uses a client like nostr-arduino to receive commands from the `user` or another `device`. +The `devie` can also push data such as senssor readings and updates. + +## `User` OR `device` registering/updating a `user` OR `device` + +A merchant can publish these events: +| Kind | | Description | NIP | +|---------|------------------|---------------------------------------------------------------------------------------------------------------|-----------------------------------------| +| `4 ` | `direct_message` | Communicate between `device`(s) and `user`(s). The messages can be plain-text or JSON. | [NIP04](https://github.com/nostr-protocol/nips/blob/master/04.md) | + + +### Event: Register a `device` + +**Event Content**: +```json +{ + "id": , + "device_id": , + "name": , + "description": , + "categories":[ ], + "users":[ []], + "images": <[String], array of image URLs, optional> +} +``` + +Note: + - `users`: + - A list that can restrict access to public-keys, `device`(s) also has keys and can be a `user`. + +### Event: Update a `device` + +**Event Content**: +```json +{ + "id": , + "device_id": , + "settings":[ []] +} +``` + +Note: + - `settings`: + - Standard `settings` innclude: + - eg: `[["on", ], ["range", ], ["timer_on", ], ["timer_off", ]]`