From 16d577fdf5e7fe1b25012919c6882efa1894319e Mon Sep 17 00:00:00 2001 From: Jack Chakany Date: Tue, 21 Mar 2023 13:00:34 -0400 Subject: [PATCH] make room id optional depending on use --- 100.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/100.md b/100.md index 2270333f..663442f8 100644 --- a/100.md +++ b/100.md @@ -1,10 +1,16 @@ -# NIP-100 WebRTC +NIP-100 WebRTC +============== `draft` `optional` `author:jacany` This NIP defines how to do WebRTC communication over nostr. +--------------------------------- ## Defining Rooms -Rooms are essentially the space that you will be connected to. This must be defined by a `r` tag following the pubkey of the person you are connected to or some other identifier (maybe a lobby id for a joinable voice channel, etc.) +Rooms are essentially the space that you will be connected to. How rooms are defined depends. +1. Is this a one-on-one call? In that case just use the `p` tag. +2. If it is a group call (multiple people), then you will need both the `p` tag for communicating who the event is for, and the `r` tag for defining the room id. + +In that case, when you are sending `connect` or `disconnect`, the usage of the `p` and `r` tag varies on your requirements ## Peers Who the client connects to can be chosen by the client. Ex: you can connect to everyone peer-to-peer or a WebRTC media server that is listening on nostr relays. @@ -24,7 +30,7 @@ The connection ID is inferred from the provided pubkey. "pubkey": "", "tags": [ ["type", "connect"], - ["r", ""] + ...roominfo ] } ``` @@ -37,7 +43,7 @@ This is used when disconnecting from everybody else. Ex: when browser tab is clo "pubkey": "<sender pubkey>", "tags": [ ["type", "disconnect"], - ["r", "<plaintext room id>"] + ...roominfo ] } ``` @@ -51,7 +57,7 @@ Used when responding to a `type:connect`. Offering to connect to that peer. "tags": [ ["type", "offer"], ["p", "<reciever>"], - ["r", "<encrypted room id>"] + ["r", "<optional encrypted room id>"] ], "content": { "offer": "<offer>", @@ -68,7 +74,7 @@ Used when responding to a `type:connect`. Offering to connect to that peer. "tags": [ ["type", "answer"], ["p", "<reciever>"], - ["r", "<encrypted room id>"] + ["r", "<optional encrypted room id>"] ], "content": { "sdp": "<sdp>", @@ -85,11 +91,11 @@ Used when responding to a `type:connect`. Offering to connect to that peer. "tags": [ ["type", "candidate"], ["p", "<reciever>"], - ["r", "<encrypted room id>"] + ["r", "<optional encrypted room id>"] ], "content": { "candidate": "<sdp>", - <misc> + ...misc } } ``` \ No newline at end of file