What Is A DApp (Decentralized Application)

By Adam | Internet
Disclosure: Bonkers About Tech is supported by its readers. When you purchase through links on our site, we may earn an affiliate commission. Thank you.

Most of the applications and websites that you see today on the Internet are what you would call ‘centralized’ apps.  In other words, they are owned by a company and run in a data center somewhere, again, owned by a company.  But what is a ‘de-centralized’ app?  I didn’t know either.  I knew it had something to do with the blockchain, but I wanted to dig deeper and find out a little more.  Here’s what I found out:

A DApp or Decentralized Application is an application that runs on a decentralized peer-to-peer network rather than a single computer.  DApps do not rely on a centralized authority to connect the user and the app.  Instead, they are open-source, governed by the community, don’t have a single point of failure and are profitable not only for their creators but also the users.

If that’s still unclear, let’s consider Bitcoin.  

Bitcoin is a cryptocurrency that most people have heard of and it was the first real-world application of blockchain technology.  Bitcoin uses blockchain technology as a globally distributed ledger which records transactions and is secured cryptographically.

Bitcoin however, is just one use for the blockchain, there are other uses too – you can run DApps on it. 

If you think about traditional webapps, they usually consist of a front-end and a back-end.  The front-end consists of HTML, CSS and Javascript and when the browser executes this code, the result you see is a website.  The front-end interacts with the back-end which can be built using languages such as Java, NodeJs, C#, PHP etc.  These traditional webapps run on a server which is owned and run by a company.

DApps still have a front-end and a back-end.  The front-end is exactly the same and runs in the browser, however the back-end would be a blockchain solution and would run on a platform such as Ethereum.  The front-end and the back-end still interact with each other, but as far as the user is concerned, they wouldn’t be able to tell whether the front-end was interacting with a Java server or the Ethereum blockchain for example.

DApps built on blockchain technology have opened up the possibility of a newer and more exciting world and many have dubbed DApps as the Web 3.0, but what benefits do they have?  Well, let’s have a look shall we?

What are the benefits of DApps?

The problem with traditional webapps is that they are hosted on a centralized hosting service provided by your hosting provider, like my website which is hosted by Linode for example.  But it’s not just your webapp that’s being hosted on those servers, many people around the world might be hosting their webapps on there too.  This creates a single point of failure for the Internet.  If you were to take down Amazon’s AWS for example, you could probably take down half the Internet!

This isn’t a resilient architecture for the Internet and it puts a lot of pressure on individual organisations to build and maintain this infrastructure.  There is also the issue of control.  If the hosting provider wanted to take down your webapp, they could do very easily.

This is where the DApps and the blockchain come in.  If your application was a DApp, it runs everywhere on many computers that are part of the blockchain and it wouldn’t be easy at all to take down.  With centralized, traditional apps, we are making it easier for attackers to gain access to our honeypots of centralized data.  We have seen this time and time again with hacks on Equifax, TalkTalk, Reddit, Dixons Carphone to name just a few.

For attackers, it is very lucrative to get access to personal data.  It’s relatively easy too, attackers just have to get access to a single database to get millions of people’s personal data.  It’s not just hackers you want to be aware of either.  I mean, do you trust your hosting provider 100%?  Although the company you use maybe trustworthy, there is nothing to stop a disgruntled employee from getting access to your data.

With a decentralized database like the blockchain, data attacks are a lot less trivial.

Another problem with centralized services is montization.  Take YouTube for example.  Millions of people around the world provide videos for the platform, yet the bulk of the revenue generated doesn’t go to the creators or to the users.  YouTube take the majority of the revenue that these videos generate.  With decentralized applications however, users can regain control of their data and decide for themselves whether to monitize it or not.  The users get to keep the money and not some huge corporate.

Another aspect of centralized data is failure.  Unless you backup your databases on a regular basis, there’s not guarantee that your data will survive catastrophic failures.  Everyone that owns a web application has to take responsibility to backup their databases and what’s more, there’s no standard way to do this.  Some organizations might not backup their databases or they may handle the process badly and make it easier for attackers to take advantage.

The difference with the blockchain is that everything is publicly readable and redundantly copied to other nodes within the network.  So even if a node did go down, your data will never be lost and the database will continue to work.

Now DApps have problems of their own and they certainly aren’t a silver bullet, but they do have superior fault tolerance built into them and they are ‘trustless’ which means you don’t have to put your trust into a single person or organization.

How do decentralized apps work?

As I’ve previously mentioned, decentralized apps work very similarly to centralized apps, well at least on the front-end in any case.  The difference is in the back-end.  With DApps, the back-end is connected to the blockchain, like the Ethereum blockchain for example, whereas with traditional apps, they are connected to a centralized server owned by a company.

Because DApps are connected to the blockchain, data can be stored and things like financial transactions can be also be made through the blockchain. This completely changes the perspective on things because you don’t need a third party to oversee things and potentially provides a completely new business model for apps on the Internet.

Currently Etheremum is one of the platforms that is leading the way when it comes to DApps and more and more DApps are being created every day to run on the blockchain.  One of the features that make DApps run effectively on the Ethereum blockchain is the ‘smart contract’.

Smart contracts bascially allow you to exchange money, property, shares, or anything of value in a transparent, conflict-free way and at the same time, avoids any middlemen.  The best way to think about smart contracts is a bit like a vending machine.  In other words, you insert a coin into the vending machine and you get something in return – but only when and if you insert the correct money.  Smart contracts define rules and penalties around an agreement, in a similar way that a vending machine or traditional contract does.  They also automatically enforce any obligations that may be present.

How do you build a decentralized application?

One of the ways you can get started building decentralized apps is by programming for the Ethereum Virtual Machine.  The Ethereum Virtual Machine (EVM) allows Ethereum nodes to store and process data in exchange for payment.  You can do a bunch of stuff including responding to real-world events and it opens up new opportunities to support on-chain applications that were never previously available to developers and real-world users.

In order to take advantage of this incredible platform and to start building DApps, then you need to learn about smart contracts.  Smart-contracts provide a way for people all across the world to do business with each other regardless of the language they speak or the currency they use.

Smart contracts allow you to define programmatically the rules of a business contract, in a simple machine language.  It has the capability to bring people together and allow them to conduct business in a trustable, secure, and automated fashion.

One way to program a smart contract is to use the Solidity language.  Solidity is basically a tool which can generate machine-level code that will execute on the EVM.  Like any programming language and compiler, it takes our high-level human-readable code and breaks it down into simple instructions like “put data into a register”, “add data from two registers”, “jump back to instruction at memory point xxxxx” etc.  These instructions, when combined, form the basis of a microprocessor executable program.

You don’t have to use the Solidity language and there are several other languages which can be compiled into EVM bytecode, such as Serpent. Each language might have several compiler tools but in essence, they all do the same thing, which is to generate EVM machine-level bytecode to be run on the Ethereum nodes, for payment.

If you want to learn more, check out this tutorial here or check out the video below:

What are some examples of decentralized apps?

Now that I’ve gone over some of the basics of DApps, let’s look at some examples.  Hopefully these will give you a better idea as to how DApps work and how they fit into this highly networked and decentralized world.

Augur

Agur is a financial forecasting platform that combines the power of decentralized networking and financial prediction markets.  It sits on top of the Ethereum blockchain and allows you to make predictions about real-world events such as the next election, natural disasters, the weather and more.  The platform turns your prediction into “shares” that other users can buy or sell.

Decentralized News Network

DNN uses tokens as a way to incentivize factual news coverage, so it could be used to help combat fake news.  As with all DApps, it has no central authority and is run by the people who use the site, so it makes it harder for people to create fake and/or biased news.  All news is fact checked by reviewers and they are paid in tokens for checking.  Writers are also rewarded based on the quality of their content rather than how click-baity their headlines are for example.

Cryptokitties

CryptoKitties is a virtual game where users breed and trade digital kitties using Ethereum-based smart contracts.  Cryptokitties are generated by code, and bred by spending Ether tokens on smart contracts that use two base cats to create a new one.  Each new cat is unique and persistent and recorded on Ethereum’s public ledger.

Wrapping up

So that’s pretty much it.  Like it or not, I’m pretty sure that the future web will be fully decentralized.  I think the Internet will stay the same at least from the users point of view but I think we will start to see the back-ends of well known services moved across to the blockchain which in my opinion will bring a number of benefits and has the power to be truly transformative.

In the coming years I think will start to see the true potential of platforms such as Ethereum and its DApps and who knows, decentralized app stores like Spheris could be the next big thing.