Peer-to-peer chat: connecting by name, with permission
Sending a friend a message usually means opening the same messaging app and letting the platform deliver it. Even when the content is end-to-end encrypted, the conversation still depends on that platform. Could we reach
Sending a friend a message usually means opening the same messaging app and letting the platform deliver it. Even when the content is end-to-end encrypted, the conversation still depends on that platform. Could we reach a friendβs endpoint, verify who weβre talking to, and send the message there?
DHttpβs Workspace offers this kind of chat. The interface is familiar: add a contact, send some text, share a photo or file, or record a voice message. Behind the interface, the two endpoints exchange messages with each other.
First, though, how do you know youβre talking to the right person?
A DHttp identity consists of a domain-style name, a publicβprivate key pair, and a certificate. The name lets others find your endpoint, while the certificate binds that name to your public key. During connection setup, you prove possession of the matching private key, which stays on your device.
But verifying someoneβs identity doesnβt give them unrestricted access to your services.
If I want Bob to send me messages, I allow his identity to make POST requests to my messaging endpoint. If Bob wants to receive my messages, he grants permission on his side too. Workspace puts this into the contact interface: each person chooses what access to request and what to offer. Accepting a contact doesnβt automatically grant chat permission, and allowing someone to send messages doesnβt let them read my entire chat history.
This also works when weβre on different home networks. DHttp handles endpoint discovery and NAT traversal underneath, attempting a direct connection and using a relay when needed. We donβt have to configure a VPN or join the same virtual private network first. For chat, Iβd like knowing someoneβs name and having their permission to be enough to reach them, without first arranging for our devices to share a private network.
Thatβs the part I find interesting. What looks like agreeing to receive someoneβs messages is an access rule tied to their verified identity. Knowing my name doesnβt give them access to my other services. Both endpoints still need to be online and reachable, and private keys need to be kept safe. Peer-to-peer changes how we communicate; it doesnβt take care of every security concern for us.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.
