tari-project / tari-dan

BSD 3-Clause "New" or "Revised" License
7 stars 16 forks source link

feat(signalling-server): change tarijs to use libp2p web and relay through seed nodes #1065

Closed sdbondi closed 2 months ago

sdbondi commented 3 months ago

Problem

Deploying a separate signaling server to facilitate web connections is probably an anti-pattern and a centralising force. We should be able to leverage libp2p to facilitate ICE connections.

This is a solved problem so we should investigate how it's achieved elsewhere.

Proposal 1

TODO: investigate and understand how this problem is solved and implement this.

Implement libp2p webtransport on validator nodes and/or indexers to allow them to facilitate connections.

Use the following high-level scenario as a guideline:

  1. Given a Tari network NETWORK_1
  2. Given a tari-enabled wallet (walletd, metamask snap etc) WALLET_1
  3. Given a tari-enabled website (tari.js) WEB_1
  4. Given WEB_1 establishes an ICE connection to a random member of NETWORK_1
  5. When WEB_1 wants to connect to WALLET_1, it provides ICE details (this could be an URL or some other approach)
  6. Then WALLET_1 uses the ICE details to establish a connection to WEB_1
  7. And WEB_1 can interact with WALLET_1

ICE details may include:

Related links:

sdbondi commented 2 months ago

Closing this because we've gone another direction