---
# System prepended metadata

title: Chapter 4 - Decentralized Apps
tags: [Module 0]

---

# Chapter 4 - Decentralized Apps

###### tags: `Module 0`

### Intro

Decentralized applications or dApps are the way forward. They're the applications that will unlock the next wave of innovation. Developers will utilize the infrastructure laid out by blockchain and build solution that weren't even possible a few years ago.
In this chapter, let's understand what a dApp is and how it's built.


### Study time

To understand dApps, you'll first need to take a look at how centralized applications are built.
Almost all the applications you use are centralized. Like Facebook, Google, Instagram, etc.

In a centralized app, the data is controlled and centrally stored by the company. 
You basically have no rights over the data and you have to trust the company to maintain your privacy. 
Also, however tight the security of an app might be, centralized applications are always hack-able. 
If there was a centralized app to keep track of how many fights your Cryptobot has won, it is possible that a hacker could penetrate the system and change the wins of your Cryptobot to 0. You wouldn't want to own a loser bot :(

This scenario isn't too far from reality, huge tech giants often get hacked. Recent one being the [Twitter hack where accounts of several well-known people were compromised](https://www.wired.com/story/inside-twitter-hack-election-plan/). 


#### Moving on to what decentralized apps are - 
dApps are essentially a user-friendly interface that communicates with the smart contract. This interface could be anything, a web app, mobile app, or even a desktop app.

dApps are powered by a collection of one or more smart contracts that are stored on a blockchain. 
The smart contract + blockchain combination replaces the traditional server backend that are used in the case of traditional apps. 
 
> Reminder: Smart contracts are simply agreements written in code, stored on the blockchain. Follows the IF x happens, DO y pattern.

This is SO much more better than the traditional model, because dApps are tamper-proof and don't undergo outages!
Your smart contracts literally can't go down. They run on top of blockchain, and blockchain is this beast that keeps running 24x7.

The interface the user will interact with is called the `frontend`.
In a typical centralized app, the frontend would communicate with the backend through Rest API calls.
But, the case is different for decentralized apps is different. Depending on which blockchain network you're using, there are libraries which lets you communicate with the smart contract directly from the frontend Javascript code. For example, Taquito for Tezos, Web3.js for Javascript. 

I know, all this can be a lot to take in. 
But don't doubt yourself, whoever you are - you can learn to code smart contracts and build on blockchain the next generation of dApps.

Even the founder of Uniswap, one of the most important dApp right now, was a mechanical engineer who started learning Ethereum when he was laid-off from his job. 
Uniswap was a dApp started by one dev, who was an ex-mechanical engineer.
Three years later, it is one of the most important decentralized application.


In the previous chapters we've discussed the benefits of building on the blockchain - dApps are what allows you to realize this potential. 
dApps are the application of blockchain, similar to how a light bulb is an application of electricity.

It's upto people like you and me, to build for the future, on blockchain. 

Now, it's time for you to get your own **`Cryptobot`** and get started on your journey of becoming a dApp development ninja 🔥

The Cryptobot you'll get is an **NFT**, which is basically a digital asset represented as a token which can be traded on the blockchain. Which means, you can literally trade Cryptobots for money.
Also, you can customize the Cryptobot as you like, it's your own!