Understanding DApps

RafaelRafaelFebruary 26, 2021
Understanding DApps

What Are Decentralized Applications (DApps)?

DApps are applications that run on a peer-to-peer network, meaning there is no central point of control or failure.

Traditional Web Applications (Web2)

In the Web2 ecosystem, applications are typically built as follows:

  • A client-side application handles logic and interacts with APIs.
  • The APIs are hosted on servers, which may be deployed across multiple instances but usually rely on a single point of failure unless a complex multi-cloud architecture is in place.

How DApps Work (Web3)

In decentralized applications, the backend logic is handled by Smart Contracts running on a blockchain, which is a decentralized peer-to-peer network of nodes.

  • Smart contracts are public, executable code that performs transactions and executes logic on the blockchain.
  • Since the blockchain runs on multiple nodes worldwide, there is no downtime.
  • Interaction with the blockchain requires a wallet, which contains a public and private key pair to sign transactions and store tokens.

Blockchain Architecture

Considerations Before Building a DApp

While DApps offer unique advantages, there are some key considerations before starting a project:

  1. Data Privacy: If using a public blockchain, all data is publicly accessible. Solutions include:

    • Running a private blockchain
    • Combining databases with blockchain
    • Using blockchains that support private transactions
  2. Transaction Fees: Every blockchain transaction requires an execution fee (gas fees). Fees vary by blockchain and network congestion.

  3. Choosing the Right Blockchain: The technology is constantly evolving, and each blockchain has different use cases.

Serving the Frontend Code (Web2 vs Web3)

In Web2, frontend code is usually served from a centralized server or CDN (e.g., AWS, Cloudflare).

In Web3, distributed file systems like IPFS, Filecoin, and Swarm allow serving frontend files (HTML/CSS/JS).

Benefits:

  • No central point of failure
  • No downtime
  • Better security

However, scalability and speed are still challenges in early-stage blockchain ecosystems.

Talking to the Backend (Web2 vs Web3)

In Web2, web apps typically call an API using REST/GraphQL.

In Web3, DApps must interact with smart contracts, requiring:

  1. A connected wallet
  2. The smart contract address (e.g., Ethereum contract example)

With these, users can execute contract functions (paying fees) or read blockchain data (which can be slow).

Standard Libraries for Web3 Development

  • Web3.js or ethers.js → Used for Ethereum & EVM-compatible blockchains.
  • These libraries enable:
    • Checking balances
    • Signing transactions
    • Interacting with smart contracts

To use these libraries, users need an in-browser wallet like MetaMask.

Blockchain & DApp Ecosystem

We started focusing on Ethereum and EVM-compatible blockchains since they have the most mature DApp ecosystem.

In the future, other blockchains such as Cardano (ADA), IOTA, EOS, Lisk, and many others may see more growth and adoption.

DApp Use Cases

Some of the most notable use cases for DApps today include:

  • Decentralized Finance (DeFi)
  • Governance (DAOs, Voting Systems)
  • NFTs (Non-Fungible Tokens)
  • Decentralized Social Networks & Communication Apps
  • AI & Machine Learning on Blockchain
  • Decentralized Domain Name Services
  • Distributed File Storage Systems

🚀 The Web3 ecosystem is evolving quickly, aiming to challenge traditional Web2 monopolies.

Getting Started with DApps

If you're interested in coding your first DApp, check out our tutorials:

How to Read the Balance of Your MetaMask Wallet with Web3.js