I wonder if it's possible to have a peer-to-peer group chat protocol, where anybody is free to join the chat and broadcast with a chosen username to all others who have joined it, but with a strong anonymization property. The property desired is that it is impossible, or at least difficult, for a man-in-the-middle to determine which IP address is associated with each username in the chat. To be clear the man-in-the-middle is able (like anyone else) to join the chat and observe everything being said, and he can also be assumed able to monitor all transmissions of at least some members of the chat.
Naturally, the timing of packets could give away who is who, so it would be necessary for all users to be sending packets at regular intervals to hide which users are actually speaking.
If the chat system uses a server, the man-in-the-middle can be assumed to have access to the server. So it's no good to simply encrypt all messages between each user and the server.
I'm thinking about a scheme where users are constantly passing "pieces" of messages between each other, and trying to assemble pieces into completed messages by XORing recent pieces, in a way that it's not clear who first sent all the pieces required for a message. Each peer to peer link could be encrypted with the recipient's public key.
However, the man-in-the-middle may be free to create as many users as he wishes, which might defeat this scheme. If man-in-the-middle users greatly outnumber other users, then the man-in-the-middle can trace most of what's going on.
Is it possible?