mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-23 00:45:53 -05:00
2.8 KiB
2.8 KiB
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.
Terms
user
- user operating IoT device with NOSTR key-pair and a client made specifically for IoTdevice
- 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 device
can also push data such as sensor readings and updates.
User
OR device
registering/updating a user
OR device
A device
or a user
can publish these event kinds:
Kind | Description | NIP | |
---|---|---|---|
4 |
direct_message |
Communicate between device (s) and user (s). The messages can be plain-text or JSON. |
NIP04 |
Event: Register a device
Event Content:
{
"id": <String, UUID generated by the user.Sequential IDs (`0`, `1`, `2`...) are discouraged>,
"device_id": <String, UUID of the device>,
"name": <String, device name>,
"description": <String (optional), device description>,
"categories":[ <String (optional), device category, such as 'boiler'>],
"users":[ [<String (optional), user public-key>]],
"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 auser
.
- A list that can restrict access to public-keys,
Event: Update a device
Event Content:
{
"id": <String, UUID generated by the merchant.Sequential IDs (`0`, `1`, `2`...) are discouraged>,
"device_id": <String, UUID of the stall to which this device belong to>,
"settings":[ [<String (optional), user public-key>]]
}
Note:
settings
:- Standard
settings
innclude: - eg:
[["on", <bool>], ["range", <int, 0-1000>], ["timer_on", <int unix timestamp>], ["timer_off", <int unix timestamp>]]
- Standard