|
|
|
|
|
by colejohnson66
3648 days ago
|
|
Serious question: how would you decentralize something like a messaging app? Don't you need /something/ to facilitate routing? Or do you use some kind of public-private key encryption on a blockchain? But then how do you get someone's public key if they're offline? And why would you want to store a blockchain of everyone's encrypted messages? To get around that, you'd end up with some centralized server storing the whole blockchain and you only receiving yours? But then you're back at the problem Bitcoin has: You want a decentralized blockchain, but people don't want to store 73,745 megabytes[0] of other people's transactions they don't care about. Bittorrent's DHT system still relies on a few "kickstart" servers to send you a list of peers who can send you a list of peers... [0]: https://blockchain.info/charts/blocks-size (26 Jun 2016, 0519 UTC) |
|
1) Have "tracker" servers set up around the world. The App needs to know at least one of the IPs, preferably all, in order to get a list of Peers it can connect to. This is still considered "decentralized" so long as none of the "trackers" is considered a "master" over the others.
2) Have UserA manually enter the IP of another UserB. Then, UserB tells UserA all of the Peers it knows about, which UserA will then connect to, and so on and so forth. This approach can quickly get out of hand unless there is some sort of limit on how many peers a User can be connected to at once. That's up to the developer (or possibly user) to decide.
Theoretically, as long as one Peer is alive and doesn't forget the list of other Peers it has been told of, the network will never completely shut down. Even if it does, however, the network can "start back up" again, but there may be cases of "subnets" within the P2P network if no peers from one subnet ever know of peers from another subnet.
In regards to the actual chat functionality, it's very simple. As long as you can preserve consistency between peers (which is its own subject), it's relatively easy to have each Peer keep a copy of the current chat. Even if the chat is between >2 Peers.
There are intricacies to this, but it's not actually that difficult. It's a lot more complicated to design, but once the groundwork has been laid, it can sustain itself for the most part.