Community Writer Series

Kiran Pachhai
ELASTOS
Published in
7 min readMay 4, 2018

Elastos Carrier: The Great Spam Filter

Background

Elastos Carrier is a decentralized peer-to-peer (P2P) platform that takes over all network traffic between virtual machines and conveys information on applications’ behalf.

What does this mean? Well, to understand more about what Elastos Carrier is, we need to revisit what a peer to peer network actually refers to. A peer to peer network is created when two or more personal computers (like your windows, mac, etc) are connected to each other and share data directly without having to go through a separate server or computer.

As an example, in the traditional world like, for telegram chat or whatsapp or viber to work, when person A sends a message to person B, the message has to first go to a central server that’s managed by the respective company. This central server then connects to person B and then routes your message to them.

You can see how there might be a problem with this kind of traditional architecture. With that said, there are many apps out there right now that do use peer-to-peer architecture such as skype or bittorrent. Skype uses a protocol that is a proprietary internet telephony network based on peer-to-peer architecture.

The problem with this is that the protocol’s specifications are not publicly available and official apps using this protocol are closed-source so it’s hard to say what really goes on and how it’s implemented.

On the other hand, an app like bittorrent is a communication protocol for peer-to-peer file sharing that is used to distribute data and files over the internet. It has been used by millions of users to transfer electronic media, games, etc from one person to another. Bittorrent used to be open source but ever since they switched to the codebase from uTorrent, the code has not been publicly available so it’s hard to know how it’s implemented underneath and we cannot know about any flaws or bugs that might be prevalent.

How Elastos Carrier Works

Elastos Carrier is a decentralized peer to peer communication framework so in the case of a regular chat app built using elastos carrier, there’s no central server where the messages have to all go through.

With that said, this is not like a traditional peer-to-peer architecture. There might be a firewall for person A that might be blocking some traffic to person B. In cases like this, the person A will look for other people in the network, that may have a path to person B, we’ll call them person C.

Then the message is encrypted and can only be decrypted if you have an appropriate private key with you. This message is then sent from person A, then it might go to person C and if person C has a path to person B, this message from person A then gets routed via person C.

This is possible because of the decentralized nodes in the elastos network. In other words, even if person A doesn’t have direct access to person B, they can still talk to each other. This is a huge deal because this essentially means that as long as there’s ONE path open between different nodes (where the decentralized chat app is running from), the message will always get delivered while also having a piece of mind that no one can interfere with this as there’s no central server and the message itself is encrypted.

So, you could theoretically have two people living in the United States and China respectively talk to each using this DApp on elastos without any issue. A firewall cannot block this transmission because the only way to block this communication would be to block every traffic from every source which is not feasible.

Let’s take a closer look

When person A sends a message to person B, the way the message tries to get relayed first is using the UDP (User Datagram Protocol). In addition to UDP, there’s also TCP (Transmission Control Protocol). The main difference between TCP and UDP that you probably care about is the fact that the UDP has a higher penetration rate through firewalls while TCP does not. The other difference is that for TCP to work, the sender and the receiver are always connected and the messages are acknowledged in order so because of this, the speed at which the TCP transports data is slow compared to UDP. For UDP to work, the sender just keeps on sending data to the recipient and the sender doesn’t even wait to make sure the recipient received the message. It just keeps on sending. It’s because of this reason that the transfer rate is very fast for UDP compared to TCP.

Now let’s move on from the technical details. So, the first time person A sends the message to person B, the message first tries to get relayed using the UDP however if the message cannot go through, the message then gets sent to person B using TCP. Since there needs to be a two way communication when using the TCP protocol, the message from person A can first go to person C and since person C can talk to person B, the message then gets relayed to person B. In either case, a firewall between person A and person B will not affect the user experience as the messages always get transported no matter what because of the decentralized network that elastos platform provides.

Elastos Carrier v traditional TCP/IP v Cellphone

On a regular cell phone, you can call someone as long as you know someone’s number. Well, as long as you have a valid phone number, you can call them even if you don’t know that person at all.

With TCP/IP, messages or more commonly known as packets can be intercepted as long as one knows the target IP address. With Elastos Carrier, you need to authenticate each other before you can transfer any kind of messages or data back and forth.

A cell phone is susceptible to fake tower attacks. With TCP/IP, you have a problem when your data gets transferred because the text header is in plain text and easily modified by a man in the middle attack. However with elastos carrier, all the data is encrypted, immutable and cannot be imitated. In other words, no chance of man in the middle attacks.

With cell phones, you’re susceptible to the PRISM program which is a code name for a program under which the United States National Security Agency(USA) collects internet communications from various U.S. internet companies.

In the TCP/IP world, the server where your data is stored may be unsafe. Also, people may be able to intercept the data on route and steal sensitive data. With Elastos Carrier, since there’s no central server and everything is peer-to-peer and decentralized, data routing is unpredictable so there’s no way to target specific people.

On your cell phone, you need to change phone numbers to prevent spam so the cost is high. And even then, you might get bombarded with more spam later down the road. Elastos Carrier completely eliminates spam and there’s no cost associated with using it whatsoever.

Other real world use cases

I talked about a simple use case for a chat DApp built using the Elastos Carrier SDK above. This kind of communication is not limited to only a simple messaging app. Elastos Carrier also lets you transfer any kind of digital media such as music, movies, games, etc. This is what it makes it possible to build any kind of decentralized peer-to-peer application using Elastos that lets you transfer any sort of data from one person to another. So, you could have a DApp on Elastos that not only lets you play games but also trade games amongst one another. Elastos Runtime provides you with a safe environment that lets you play the game on any device while Elastos Carrier provides you with the ability to transfer these games from one person to another. And all of this happens using the platform elastos is building. Your games are safe and sound because everything is encrypted before you try to access it.

Conclusion

This is just a tiny fraction of what Elastos is trying to build. They are building an entire ecosystem with Elastos Carrier, Ela Pay, the issue of decentralized ID, etc these are all part of Elastos runtime. Once everything is said and done, developers will have one SDK (elastos runtime SDK) to work with that will be in multiple languages (NodeJS, Android, iOS). When everything is ready, you will able to build decentralized applications using this SDK for any device out there.

--

--