vacp2p / research

Thinking in code
MIT License
62 stars 4 forks source link

Private (Small) Group Chat #145

Open fryorcraken opened 1 year ago

fryorcraken commented 1 year ago

Preamble

Creating a new, separate issue, because:

Problem

Platforms using Waku to build small (<12 members) secure group communication functionality do not have any recommendation or specs to follow, nor they have out-of-the-box library to use.

Requirements

We are aware of platforms needing a way to create a secure channel between several users or nodes.

ETH2 Validators

In the case of Eth2 validators wishing to share signing responsibility for a more resilient setup.

In this case, the validators need to create a secure channel with several participants to proceed with the DKG.

group chat

In the context of a marketplace:

In this context, the maximum number of group chat member is 3 (maybe 4 if a second moderator is invited?) hence scalability over the number of members does not seem necessarry.

Notes

@oskarth mentioned that 43/WAKU2-DEVICE-PAIRING could be used to setup several 1:1 channels, similarly to the current Status protocol for group chats: 7/GROUP-CHAT.

Criteria

alrevuelta commented 1 year ago

Great! Not sure I see a DKG as a m2m, since throghouth the whole process there is some human interaction. As I see it, the ceremony is syncronous, you join, monitor how many people are participating, participate with your share (adding entropy?) and when everyone has participated, its considered done and you exit, storing your share. But correct me if I'm wrong.

Regarding the suggested implementation, are we targeting a specific language?

fryorcraken commented 1 year ago

Great! Not sure I see a DKG as a m2m, since throghouth the whole process there is some human interaction.

Rephrased.

Regarding the suggested implementation, are we targeting a specific language?

Not sure what you mean. Nwaku is the reference implementation so it should implemented there first. Then reproduced.in go-waku and js-waku if it makes sense. Which it would for this particular protocol.

alrevuelta commented 1 year ago

Not sure what you mean. Nwaku is the reference implementation so it should implemented there first. Then reproduced.in go-waku and js-waku if it makes sense. Which it would for this particular protocol.

I was asking because I wasn't sure if the plan was to implement it in nwaku, or other implementation. Just to make the Criteria "Provide a reference implementation"->"Provide a reference implementation in xxx-waku".

My initial thought was js-waku since these use cases look more browser related.

s1fr0 commented 1 year ago

The setting is very important for designing a working and then efficient protocol. Some questions we may try to answer for specific contexts are:

At the moment I believe that the easiest way to proceed is to mimic Status app by requiring each user to instantiate n-1 secure channels with other parties, but by using Noise handshakes/pairings (or derived schemes).

Main reason is because this was already planned in https://github.com/status-im/nwaku/issues/1066 and some work has been done already towards that direction, although de-prioritized at the moment (the issue/rfcs deal with multi-device communication rather than multi-user chats. However the requirement to keep synced all user's devices in multi-device communication can be seen as delivering a message to all parties in a group chat, hence that work can be easily adapted to address this issue). Unfortunately the solution based on separate Noise handshakes doesn't scale very well when many parties are involved (besides the (n 2) key-agreements necessary to instantiate all the secure channels, each outbound message has to be encrypted separately within each of the open n-1 channels).

In any case, we might try to target (in parallel to the multi-device communication development) specific contexts/scenarios with a tailored design: in such case, I believe that structuring answers to the above questions + identifying necessary security guarantees we want to provide will help in making the right protocol design choices.

fryorcraken commented 1 year ago

I was asking because I wasn't sure if the plan was to implement it in nwaku, or other implementation. Just to make the Criteria "Provide a reference implementation"->"Provide a reference implementation in xxx-waku".

nwaku is the reference client for Waku so I expect the reference implementation to be in nwaku by default. But that's an expectation I have outside of this issue.

But it does not really matter. A reference implementation need to happen and then Waku Product can take over and reproduce the implementation in the other codebases and then harden it once we get feedback from dogfooding/users.

fryorcraken commented 1 year ago

The setting is very important for designing a working and then efficient protocol.

Let's review this issue and answer the questions once we have more specific requirements from a platform that is interested.

Especially if https://github.com/status-im/nwaku/issues/1066 does not fit the needs.