December 1, 2018
What is Decentralized App

If I tell somebody that I am working on some decentralized apps, most likely the response would be: what's that exactly? The truth is that even the all-knowing Wikipedia haven't figured it out. The definition is up to debate, and current discussion is mostly about blockchain. However, I believe the concept is far beyond blockchain, and it deserves to be examined from a wider perspective.

In my opinion, a decentralized app, or DApp, is a collection of distributed processes that satisfy the following rules:

  1. Each process runs independently, with the same copy of code, for the same goal;
  2. Each process talks to other processes either directly or indirectly through another process;
  3. All processes make their own choices, but eventually they must converge on the same path to the goal.

Now let me explain the rules one by one.

Rule 1 makes sure that each process can function without the rest of the company. They can reach the end goal if let to run alone, but may take a very long time. No process is absolutely necessary, in the spirit that all processes are created equal. The code need not be exactly the same. As long as the modification doesn't change the goal or the language they talk, it's considered a compatible change and should not be taken as different.

Rule 2 is about the connectivity of processes. They need to communicate with each other, otherwise, it's no different from a tool like hammer. Processes may be isolated temporarily during their life time, but they must be able to get back online to become a part of a DApp.

Rule 3 says that although processes can make independent decisions during their execution, they need to make a collective decision at some point, and join force on the same path. If they can't reach to an agreement, then they can't be said to be a DApp. In the worst case the DApp fails completely, or in another case it will fork into different DApps.

In the broadest sense, human society is a DApp. Each one of us carries the same DNA (ok, almost), with the same purpose to survive and to reproduce. None of us is indispensable. We talk to each other, argue with each other, but we will agree on the same term either with violence or voting. When we can not communicate with each other, or disagree with each other, forking happens, that's why nations arise and countries form.

Traditional desktop apps lacks the connectedness of rule 2 and 3. Most web apps, being client-server based, violate rule 1, since clients usually won't work without the server. Internet is not a DApp, because IP and DNS are controlled by special processes that are superior to the rest of us.

Bitcoin, and its other blockchain based relatives (not those private chains) can all be called DApps. Smart contracts that run on the blockchain, despite not being able to communicate directly, they hitchhike on the back of blockchains, therefore barely fit the definition. When people talk about DApps, usually they are referring to these smart contracts.

Let's find some other DApps than cryptocurrencies. Git, the most used version control system nowadays, is a good example of decentralized app. Every git user runs the same binary, to keep track of a single stream of history of a repository. Git uses pull and push to communicate with its partners. They may diverge onto different branches, but eventually they will merge back to the main branch. Sometimes a fork happens, but that's ok, because people's goal changes, and they go different directions. Although the communication part of git is not as smooth as we would like, it's still a DApp.

For most people, collaboration on Google Docs is a far more pleasant experience than using git. Unfortunately it's not a decentralized solution. When the server goes down, or your internet connection goes down, most of its functions won't work any more.

Let's imagine what a truly decentralized text editor should look like. It's easy to make a text editor satisfy rule 1, actually almost all text editors on your computer satisfy rule 1. Of course it's not surprising nowadays to find some editors that require you to login to use the program. These strange things are called cloud apps, and they are certainly no DApps. Now the interesting part comes in. The editors, or editing processes, need to find each other at a certain place, and start chatting, and to agree on a single version of the file being edited. Changes made in one process, should spread to other editors automatically. When the network is down, any editing process can still be alive and responsive to the human user. Moreover, they should start looking for new place to meet again. This is not magical, not even new, the reality is that we haven't made it as smooth and seemless and robust as we would like to see.

DApp is a new kind of computing that happens without machine boundaries. Compared to centralized solutions, it has a life like quality, more open, more flexible, more diverse, more competitive, more adaptable to ever changing environment, which I may continue to write about in future, and which is why I got interested in this topic and spend most of this year doing research and laying some building blocks.