emberclear icon indicating copy to clipboard operation
emberclear copied to clipboard

Investigate if joining forces with Tox makes sense

Open NullVoxPopuli opened this issue 5 years ago • 2 comments

Tox seems to have similar goals as emberclear, so a partnership may be mutually beneficial.

  • No storage / history
  • Push as much into the hands of clients as possible
  • Totally distributed, nodes/servers act more as relays than anything... minimal code
  • Fully end-to-end encrypted

Right now, the "Tox Core" is written in C: https://github.com/TokTok/c-toxcore. In order to prepare for the Web, a few things need exploration:

  • can this C project be compiled to WASM
  • Rust implementation in progress - depending on timeline, this could be compiled to WASM with less hoops to jump through
  • Needs to support TCP connections and TCP relays (the web only runs on TCP)
  • Needs to support TURN/STUN for WebRTC versions of Video/Audio chat

Specific needs of emberclear from a protocol or "core" implementation:

  • Ephemeral Connections for Login Transfers and destroyable chats
  • Web Frontend relies on "Workers" to try to optimize the main thread for resposiveness
    • Today, emberclear's crypto all happens in a worker, and eventually the socket connections and data management would benefit from living in a worker as well
    • If Tox is adopted, being able to communicate with it via a worker would be ideal.
  • Channels / Group Chats
    • Need moderation
    • (at the time of writing this), a prototype of a decentralized democracy system is being implemented
    • Optional password protection

Future goals of emberclear that would like to be seen in Tox:

  • browser data encrypted at-rest
  • relay would need to support push notifications for mobile devices using the PWA version of emberclear so that users may receive messages while the app is not in focus on their phone / tablet / etc
  • complete transparency of relays
    • expose logs / activity
    • map of what's connected to what
      • would need to figure out privacy issues since currently users are contacted via public key

NullVoxPopuli avatar Apr 26 '20 15:04 NullVoxPopuli

Some thoughts:

  • Tox supports running on TCP using TCP relays. It also supports HTTP and SOCKS5 proxies, so adding another proxy-type that's websockets should be pretty straightforward.
  • Talking to tox via a worker connection should be pretty easy as well. You'd need to bind whatever it is that does the worker protocol to the tox public API. That should be sufficient.
  • Password protection for groups exists in the prototype.
  • Browser data should be handled by the application, not toxcore. Toxcore just does the network I/O and crypto, and some ephemeral state management.
  • Push notifications will need a bit of work, because they require that the relay knows a bit more about the client.

Future thoughts:

  • If you want to store things like "friends" and share them across devices, we need a way to link devices and sync between them.

iphydf avatar Apr 26 '20 19:04 iphydf

If you want to store things like "friends" and share them across devices, we need a way to link devices and sync between them.

I'm about to finish this capability here: https://github.com/NullVoxPopuli/emberclear/pull/733 Statecharts have been a huge help with getting me through all the data flows / edge cases / etc.

another proxy-type that's websockets should be pretty straightforward

excellent. emberclear currently uses Phoenix "Channels", which is a little more than websockets, but I'm sure there are other abstractions out there that could be implemented with the proper fallbacks.

Everything else makes sense, thanks for the info!

NullVoxPopuli avatar Apr 26 '20 19:04 NullVoxPopuli