Picture a chat platform. Take irc or discord for example.
They have a list of users in their chat room.
In essence i’m looking to accomplish exactly that same concept on a website with no central server.
Picture there to be a chat site (perhaps like discord, just go with the concept here) with no central server at all. Serving the website would just be serving the static data. The site would be served from IPFS.
Assume for a moment that every user is communicating over pubsub over at least 1 common known channel.
In this concept i’m having a really hard time figuring out how to get the user list up to date and send to every new user opening the site. As there is no central server, i can’t get it from there.
Thus far i have come up with two possible ways to get this working.
At some point the site goes from 0 to 1 users. That 1 user now has the full list of users. Then a second user opens the site and asks on the pubsub channel: “whoever is online, tell me who the users are in this channel”. Then that new user would get a message from the already active user with a list of the users on the channel. With 1 user this concept is ok’ish for data consumption. With 1000 this would basically be ddos’ing that one new user so a method of consensus would have to be added here to keep it limited somewhat. Regardless, i feel this way is very error prone. It would be easy to have a malicious user sending garbage.
Another way i can think of is, sadly, adding a “fake” trusted user that i control. That fake user also knows whoever is online. New users ask that fake user who the users are. This would work but adds a bit of centralization back in the mix. Exactly what i want to prevent. Though it’s still decoupled centralization. It would be like any other user only one that is always known and trusted.
Do note that i cannot use OrbitDB in this case either. OrbitDB by default marks the creator of the database as the one who can write. That means it has a central single owner who can do writes which means there would need to be a entity somewhere active on that site (a server in the web 2.0 world) that would be in control of managing the database.
I don’t like either of my potential solutions. I’m looking for a trustless way to do this. Including a blockchain - due to transaction costs - is a no-go. Besides, the site would have to wait for the transaction to be propagated and i’m not even sure if a blockchain is a solution at all in this case. Using Ceramic is, i think, also a no-go because someone needs to write updates to a document in there (the user list) and as there is no central authority, every user would need to do that. That smells very error prone and unsafe.
I’m hoping someone else has a brilliantly simple idea of how to do this.