>

But is there global infrastructure in place for p2p on the global scale?
Product manager here. 
I see a few issues and they’re more UX related. 

With a public/private key managed by the users, what happens when a user inevitably forgets or needs to reset their password? No server is managing it, so a lost password is a lost identity AFAICT. Identity management is a strong reason for centralization. Has this been solved in a decentralized way?
Maybe I missed a detail. How do users select the same trusted server? How is server C negotiated? And what if user A trusts C, D, E and user B trusts F, G, H?
I’m not yet convinced this solves spam. There’s the “pure spam” problem of bots blasting messages blindly to large groups. But the issue users care more about is actually bacn. Bacn occurs anywhere users direct their attention as monetization pressure accumulates.  Decentralizing servers means any group of servers can be purchased/bot netted by an interested enough party and monetized. When you decentralize, you actually take monetary incentive away from a single “trusted” authority by making the cost/value of reputation violation very low. But perhaps I’m missing something cryptographically interesting there too. >


I'm tempted to say that's human error, and that a technically superior solution shouldn't be thrown out because people can't store their keys securely, but if a different solution was necessary, you could use an external service to back up your key, and only return it with E-Mail address access. But something like that should never be required on a protocol level.
You can have addresses just like with E-Mail. For example, User B tells User A that he can be found on example.com. That is the server he registered an account with. User A now joins example.com, and messenges User B (identified by his public key, or a corresponding nickname for convinience). User A wouldn't need an account on example.com, all he needs is a certificate that he has an account on a trusted service. The servers have to trust certificates from other servers. example.com may accept example2.com certificates, because it verified that users of this server are safe. Note that all of this certificate stuff would only be necessary to avoid spam, but the core protocol could function without it. 
Yes, anyone can create their own servers, or buy existing ones, and use it for malicious purposes. But that server would quickly be identified as a potential spam source, and servers wouldn't trust certificates from it anymore, meaning no one who registered there can get in to other servers. >



I mean I guess it depends on your goal. If you want a protocol people can use for secure decentralized chat, you need to solve the PW management issue or it won’t be secure. Because people will just reuse passwords. That’s what they’ll do. If you’re just interested in an academic solution, I could see this getting an A. But real security is practical. Having the protocol not solve the problem but relying on recentralizing services will result in what it resulted in with crypto exchanges. 


I might be missing something but this sounds a lot like e-mail. With all the issues of email. 


So people would occasionally be unreachable? How does user A rediscover user B’s new trustworthy server? >

How does your suggestion different from Discord? >

You can't self host discord, there is only one centralized server. If it went offline, your identity is gone. Futhermore, proprietary applications immediantly disquality as the ideal messaging protocol for me. It must be open source. >

What about mastodon? >

Mastodon is not really a chat protocol as much as it is for social media. Still, I think the same issues persist. Your account is tied to a server, and servers talk to servers instead of users to users, on a server. >

Is there a hardware alternative to servers? >

arguably peer to peer. >

Is that possible for large scale use across continents? There must be a middle man at some point? >

Routers and servers are generally considered different, especially in context here.
One way to think of it in context is "can a single company go down and bring everything with it."
In peer to peer protocols, you can often have a way to connect directly, without relying on a central server, while a server would be the middle man processing and/or storing data between the two points.  Meanwhile, a router just takes in and sends out (maybe with minimal error checking). >

But is there global infrastructure in place for p2p on the global scale? >

Yes, p2p uses the same type of infrastructure as the rest of the internet for communicating data.
Blockchain is p2p for example. >

You've described how email works, but you don't really clearly describe why that is "ill designed", and so I'm a little fuzzy as to what problem you're actually trying to solve here.
Meanwhile,

by using locally stored cryptographic key pairs as an identitiy

Is a pretty big drawback. Very few people want "their account" to be a key stored on their actual computer or thumb drive. You hear Bitcoin horror stories about lost keys all the time , and the only reason you don't hear more is that so many people end up relying on centralized services anyway to manage their keys, but once you start doing that, the whole point gets diluted. >


Instead of creating an account on some random server, we have our own cryptokey pair, which was locally generated. This keypair is our account. When User A wants to contact User B, they both join Server C and talk. But they can also join Server D, F or G, and still know that they are talking to the same person. Your identity remains the same, no matter which server you're on

So...  your proposal is basically to implement a harder to use version of OpenID? >

XMPP doesn't have to be federated though. In fact, the largest non-federated, closed XMPP network has over 2 billion users: WhatsApp uses XMPP as its chat protocol. Users log in to its distributed network of XMPP servers using public key cryptography, though this is tied to a phone number too and is handled automatically by the app. >

I'm aware of that, though apparently WhatsApp uses both XMPP and the Signal protocol. Not sure how that works, but it's true. >

Product manager here. 
I see a few issues and they’re more UX related. 

With a public/private key managed by the users, what happens when a user inevitably forgets or needs to reset their password? No server is managing it, so a lost password is a lost identity AFAICT. Identity management is a strong reason for centralization. Has this been solved in a decentralized way?
Maybe I missed a detail. How do users select the same trusted server? How is server C negotiated? And what if user A trusts C, D, E and user B trusts F, G, H?
I’m not yet convinced this solves spam. There’s the “pure spam” problem of bots blasting messages blindly to large groups. But the issue users care more about is actually bacn. Bacn occurs anywhere users direct their attention as monetization pressure accumulates.  Decentralizing servers means any group of servers can be purchased/bot netted by an interested enough party and monetized. When you decentralize, you actually take monetary incentive away from a single “trusted” authority by making the cost/value of reputation violation very low. But perhaps I’m missing something cryptographically interesting there too. >


I'm tempted to say that's human error, and that a technically superior solution shouldn't be thrown out because people can't store their keys securely, but if a different solution was necessary, you could use an external service to back up your key, and only return it with E-Mail address access. But something like that should never be required on a protocol level.
You can have addresses just like with E-Mail. For example, User B tells User A that he can be found on example.com. That is the server he registered an account with. User A now joins example.com, and messenges User B (identified by his public key, or a corresponding nickname for convinience). User A wouldn't need an account on example.com, all he needs is a certificate that he has an account on a trusted service. The servers have to trust certificates from other servers. example.com may accept example2.com certificates, because it verified that users of this server are safe. Note that all of this certificate stuff would only be necessary to avoid spam, but the core protocol could function without it. 
Yes, anyone can create their own servers, or buy existing ones, and use it for malicious purposes. But that server would quickly be identified as a potential spam source, and servers wouldn't trust certificates from it anymore, meaning no one who registered there can get in to other servers. >



I mean I guess it depends on your goal. If you want a protocol people can use for secure decentralized chat, you need to solve the PW management issue or it won’t be secure. Because people will just reuse passwords. That’s what they’ll do. If you’re just interested in an academic solution, I could see this getting an A. But real security is practical. Having the protocol not solve the problem but relying on recentralizing services will result in what it resulted in with crypto exchanges. 


I might be missing something but this sounds a lot like e-mail. With all the issues of email. 


So people would occasionally be unreachable? How does user A rediscover user B’s new trustworthy server? >

You've described how email works, but you don't really clearly describe why that is "ill designed", and so I'm a little fuzzy as to what problem you're actually trying to solve here.
Meanwhile,

by using locally stored cryptographic key pairs as an identitiy

Is a pretty big drawback. Very few people want "their account" to be a key stored on their actual computer or thumb drive. You hear Bitcoin horror stories about lost keys all the time , and the only reason you don't hear more is that so many people end up relying on centralized services anyway to manage their keys, but once you start doing that, the whole point gets diluted. >


Instead of creating an account on some random server, we have our own cryptokey pair, which was locally generated. This keypair is our account. When User A wants to contact User B, they both join Server C and talk. But they can also join Server D, F or G, and still know that they are talking to the same person. Your identity remains the same, no matter which server you're on

So...  your proposal is basically to implement a harder to use version of OpenID? >

How does your suggestion different from Discord? >

You can't self host discord, there is only one centralized server. If it went offline, your identity is gone. Futhermore, proprietary applications immediantly disquality as the ideal messaging protocol for me. It must be open source. >

What about mastodon? >

Mastodon is not really a chat protocol as much as it is for social media. Still, I think the same issues persist. Your account is tied to a server, and servers talk to servers instead of users to users, on a server. >

Is there a hardware alternative to servers? >

arguably peer to peer. >

Is that possible for large scale use across continents? There must be a middle man at some point? >

Routers and servers are generally considered different, especially in context here.
One way to think of it in context is "can a single company go down and bring everything with it."
In peer to peer protocols, you can often have a way to connect directly, without relying on a central server, while a server would be the middle man processing and/or storing data between the two points.  Meanwhile, a router just takes in and sends out (maybe with minimal error checking).