µChat: We Just Need Each Other

By Patrick Williams – Developer at BitTorrent Inc./µTorrent

Live chat has been around since almost the dawn of the Internet. All you need is two people and a central server, and you’re connected. Until now.

You don’t need a server.

Last week, in tandem with the µTorrent 3.0 launch, we released my new app called µChat. It’s a simple idea, one that builds on the philosophy upon which BitTorrent was built. Distributed technologies are in our DNA. 

For some time, our (always passionate) users have been asking for functionality in the µTorrent client to chat with people in a swarm. Some were looking for community-based tech support and product tips, others simply wanted to thank the seeders. It would’ve been easy for us to simply plug in a third-party chat app into the client and call it a day. But that isn’t in our DNA either.

There was one problem – chat functionality wasn’t on our immediate development roadmap. Luckily, BitTorrent encourages engineers to be independently creative and innovative. And so I decided to challenge myself with a side project: find a way to use P2P technologies to enable chat without the need for a server.

From the beginning, I knew our community already had awesome building blocks in the form of torrents and magnet links. Plus, our Apps platform would give me the ability to build an independent system that would install seamlessly with µTorrent without distracting from core functionality.

It was just a matter of architecting a system that would enable peers to chat in a group setting without servers. There were three main obstacles to tackle: connecting peers, a central place to find rooms, and buddy lists.

Magnet links are the biggest key to knocking down the first barrier. Virtually every piece of functionality in µChat uses magnet links in one way or another. For example, every room you join is a magnet link, and the peers you see in the rooms are fellow swarm peers. Except I pulled a fast one on µTorrent. You’re not actually downloading anything (and the peers don’t disconnect because we’ve coded them to be very optimistic about their future chances of getting the torrent file). That all worked well, except we still needed a way to find rooms, and we didn’t have a buddy list. Two obstacles left…

Next, I needed to find a central place for users to find chat rooms. Upon launch, µChat client joins a giant predetermined swarm. We’ve seen swarms in the wild that are absolutely massive, so it is a reliable way to get all the peers together to exchange information about available rooms. µChat clients actually inform each other about rooms.

Lastly, no chat function is complete without the ability to keep track and reconnect with your friends. So the buddy list is my favorite. In the real world no one knows all your friends. Just you. And when you introduce yourself, you can say whatever you want. I think that’s a pretty good setup, and so with µChat, your buddy list is known only to you, and you can call yourself whatever you’d like. When you become friends with someone else, you both add the same unique magnet link so that you can find each other later simply by joining that swarm. We also implemented a level of crypto to verify the friend. So instead of both your information persisting on a server, a friendship on µChat is simply a common swarm, your friend’s public key, and their original name (because sometimes a contact may have changed their chat name).

That’s µChat in a nutshell: simply a way to make and keep relationships with people around the world with no central server. And while another chat client is probably not going to rev the tech world’s engines, the possibilities created by the underlying technology are pretty exciting. And the underlying tech that makes this all work is already finding it’s way into my next side project…

Written by: BitTorrent

BitTorrent is a company of over 100 people, based in downtown San Francisco. We’re passionate about building a better, smarter Internet through distributed computing.

  • S Ike

    I think the Linux 64 bit version with the web gui does not have a “Find Content panel”. So it doesn’t work with uchat?

    • http://port6969.wordpress.com BitTorrent

      sadly so. unfortunately only windows clients have access to the apps.

  • Anon

    Is the chat encrypted? If it is, it means you have created an unstoppable communication tool.

    • http://guardianproject.info eighthave

      Use OTR end-to-end chat encryption, and you have private serverless chat.

    • Wladimir

      You could take a look at torchat, it offers an encrypted “unstoppable” communication tool.

  • Ben Thomas

    Really great work! Love the idea and the play by play on how it all came together.

    • http://pwmckenna.wordpress.com pwmckenna

      Thanks! I’m going to continue blogging about app developement at pwmckenna.wordpress.com for some of the less formal posting. It’ll be mostly about uchat for a while, then as it moves closer to being stable I’ll probably start working on some of my other ideas.

  • http://gravatar.com/m3thos m3thos

    please tell me that it uses encryption to/in all the network interactions.

    • http://www.utorrent.com Patrick Williams

      encryption is a feature that will be available for the private conversations in the immediate future (most of the functionality is there…minus the ui for it), though doing it for general rooms would likely give people a false sense of security.

      there are not really any technical hurdles left, I simply think its important for people to feel secure when they are legitimately protected, and to know that they’re exposed when they’re not.

      keep requests coming. if you guys will use a feature, i’ll do my best to get it in there.

      • http://jimbowery.blogspot.com jabowery

        What is false about the sense of security with encrypted rooms?

      • http://pwmckenna.wordpress.com pwmckenna

        well, if your goal is to prevent someone sniffing your wire, then encrypting your entire group chat is perfectly appropriate, however if the goal is to keep your conversation private, then there’s no way to prevent them from simply joining your conversation and reading your text. In private conversations, encryption makes a lot more sense when your “attacker” can’t just join your conversation.

        I think one of the main things to consider when determining an appropriate encryption scheme is that there is never a point in uchat where you can verify the identity of anyone. Therefore, everyone must be treated as a potential attacker. You can friend people who you enjoy chatting with, and we can guarantee that when you see them online, they will be the same person and that only they can see what you’re typing. However even in this situation, you cannot overcome the fact that you did not know who they were initially. And I mostly don’t want to hide this fact from anyone.

  • Pingback: µChat Removes the Need for Servers in Chatrooms

  • Pingback: Links 7/1/11 « naked capitalism

  • http://gravatar.com/diablo581 diablo581

    So I was just talking to a friend of mine the other day about something like this, but taking it farther than you guys did.

    I think this should be used to make a p2p social network. Continue on just like you did, but make it run on smartphones as well as desktops and then make it support all the picture sharing and stuff that the facebook sites have. Then you can use the p2p for really cool stuff, like if your friends come online while you are offline they get the last copy of whatever you put out there from the rest of swarm. Then when you come back online everyone gets the latest that you have posted.

    I really think this could be the ultimate use of the technology and make it so that people really own their social content.

    • Christopher

      Probably you should check out open.buddycloud.com — they’re working on a decentralised social network based on open protocols.

    • http://pwmckenna.wordpress.com pwmckenna

      I dare say that you’re not even thinking far enough…That being said, I have quite grand ambitions myself and have been quite humbled by the process of making things work in a completely distributed system. The security concerns are significant, as are simply overcoming the churn of the peers. I do think the days of server-less computing are ahead of us…

  • http://identi.ca/lmarcetic lmarcetic

    Sounds good. Now where’s the knowledge (the paper and/or the code)?

    • http://pwmckenna.wordpress.com pwmckenna

      A paper sounds great, but for now I’m just going to blog about it. Its much easier to balance blogging with a full time job :) …the code will likely be available on github in the near future. Its entirely javascript, so its essentially open source anyhow. I’ll make sure to post links when I’ve released the source.

  • http://web.ncf.ca/shawnhcorey/ Shawn

    Now all that is needed is a way for mobile devices to talk to each other rather than a cell tower and we can kiss the ISPs goodbye forever. :)

  • http://guruz.de guruz

    I’m curious for technical details / specs :)

  • Jeremy

    Do the community a big favor and implement some sort of standard encryption, preferably GPG. It is proven, already public-key based, and the specs for using it are all out there. You could make it work with existing key rings, leveraging as well as expanding the existing web of trust.

    For private group chat, just have the client encrypt the messages using the private keys of all included members in the group, just as you do when sending an encrypted email to many recipients. Disadvantage is any time a new person is added to the group they will not be able to see the previous messages. Advantage is there is never one common key that could be compromised to have access to the entire past and future messages. If a participant’s private key were compromised, the attacker would only have view of the conversation while the attackee were a participant. This wouldn’t scale well, but would be the best choice for small groups as needed, not necessarily a large omnipresent chat.

    Alternatively a private group chat symmetric key could be randomly generated by the initiator, and passed, encrypted to the invitee(s) of course, along with the invitation to join the chat. Any added participant would be able to see the chat history, but there would be one point of compromise. This will scale well for a large omnipresent group, however your concerns are very valid as the sense of security will become more and more false as more users join and leave the chat.

    Developing your own encryption scheme just introduces more opportunity for mistakes to cause compromise, and will prevent interoperability in the future.

    • Jeremy

      Oops, I meant to say use the PUBLIC key of all participants, not the PRIVATE key.

    • http://guardianproject.info eighthave

      GPG is great for communication where you aren’t worried about deniability. GPG allows people to prove that the encrypted communications came from your key. This is a big benefit of OTR encryption: it provides identity authentication, encryption, and deniability. If only there was some kind of web-of-trust for OTR.

      • Alex

        I wonder if it would be possible to build a system that used an asymmetic keypair for identity, but used a socialist millionare system similar to OTR for deniability between established friends? i imagine an OTR-like system would not be that difficult to layer on top of uChat…

    • http://pwmckenna.wordpress.com pwmckenna

      the entire app was written in javascript (and it was admittedly written like a c dev encountering javascript for the first time), which seems to lack a standard crypto library. That being said, I’m doing my absolute best to not hand roll my own encryption. My background in security is pretty strong, but I agree that it should be something proven doing the dirty work.

      I’m not completely sold on OTR, as its a bit heavy handed for this situation (given that no one knows your identity to begin with, do you really need to be able to deny the message came from “you”?). My guess is that I’ll just use rsa to negotiate a symmetric key for the conversation, then use aes from there. I love that the community is knowledgeable about this stuff though. Keep the suggestions coming!

  • http://twitter.com/anonymousor Anonymousor

    how can i install, i can’t find the uchat in app studio, where to download

    • http://pwmckenna.wordpress.com pwmckenna

      You need to be running uTorrent 3.0, which came out 8 days ago. You can upgrade, or simply download the new client from http://www.utorrent.com

      • http://twitter.com/anonymousor Anonymousor

        Thank U, I can’t find it in app studio, it turns out we can install only by downloading the client, why not add it into app studio

  • Pingback: µChat: We don’t need servers, we just need each other. « pwmckenna

  • Pingback: µChat Goes Decentralized, Loses Servers : P2P ON!

  • Pingback: P2PTalk » µChat Goes Decentralized, Loses Servers

  • Pingback: : neutek : µChat Goes Decentralized, Loses Servers

  • Pingback: Urs Hölzle is wrong, yet another analysis of Google Social « Truth of the Lesser Men

  • Pingback: Jayce Haliwell's AntiBlog

  • http://gravatar.com/topfivesociamedia topfivesociamedia

    ya through internet we chat together directly good one.

  • http://Help ivomaidla

    My status bar, of a film I have down loaded, is dark read, and says its uploading, but it is not. Its stopped. Why ? What is happening ? All the other ones are green and are working. Please send answer to ivomaidla@gmail.com

  • Rick Hindriks

    I have the app, but I don’t often see many users online.
    Also, I saw that I could give other chat users magnet links to my other torrents. Is it also possible to give other chat users in a channel a magnet link to other channels?

  • Aaron

    I don’t ever see anybody on uChat, has everybody abandoned it? I don’t get it.

  • Aaron

    What is uchat doing with localhost port 22907? It can’t connect, it keeps timing out. What’s supposed to be running that isn’t?

  • Wesam2011

    How can I add friends?

  • Josh

    So is this still in development?
    Is it still available for BitTorrent?
    I can not find any place to download it for BitTorrent, so I’m assuming it’s only available for uTorrent or it’s not being developed anymore.

  • Alex

    Hey, really awesome work! I’m very excited about the future of this technology!

    Crank up the cryptography, slap it on i2p, and i think we found a winner!

    Question: when will you publish a protocol specification for this extension? Are you going to publish a BEP on bittorrent.org?

    When will a stable standardized spec for this protocol become available? Will you eventually release a reference library implementation? Will that library have bindings in other languages besides C?

    Would you welcome a young developer who wants to reimplement this uChat as an Android or IPhone app? How difficult do you think it would be to recode?

    Questions aside, I’m very excited about this project, and I want to see a LOT more on this. keep it coming!

  • sunil

    i’ll try that

  • Rodolfo

    You guys should make this into the new Whatsapp alternative. I think it would be amazing.