Book a free call

What Is a dApp, and How Does It Work?

A dApp is an application that runs on a blockchain instead of a company server, with its rules in smart contracts. Here is how it works and when to use one.

Hertiv engineering teamReviewed by a senior engineer
6 min read
What Is a dApp, and How Does It Work?
On this page

Short answer

A dApp, or decentralised application, is an application whose core rules and records live on a blockchain rather than on servers owned by one company. Smart contracts enforce the rules, users connect with a crypto wallet instead of an account, and the data sits on a shared ledger that no single party can rewrite.

What is a dApp?

A dApp is an application that runs on a blockchain instead of on servers owned by one company. Its core rules live in smart contracts, its records sit on a shared ledger, and users connect with a crypto wallet rather than creating an account with a username and password.

The point of a dApp is that no single company controls it. The rules are visible in the contract code, the ledger is shared by everyone who uses the network, and users hold their own assets and identity in their wallet. A company can still build and maintain the interface, but it cannot change the rules or freeze balances on its own.

Most dApps still have a normal-looking interface: a website or a mobile app. The difference is underneath. When a user takes an action, such as swapping tokens or casting a vote, the interface sends a transaction to a smart contract, the network confirms it, and the result is recorded on the ledger for anyone to check.

How is a dApp different from a normal app?

A normal app stores its data in a database owned by one company, and that company decides who can use it and what the rules are. A dApp splits those jobs: the blockchain holds the rules and the records, the user holds their identity and assets, and the interface is only a window into the system.

PartNormal appdApp
RulesCompany code on its serversSmart contracts on the blockchain
DataCompany databaseShared ledger, visible to all
IdentityUsername and passwordCrypto wallet and signed messages
AssetsHeld by the companyHeld by the user in their wallet
DowntimeCompany servers go downNetwork of nodes keeps running
ChangesCompany deploys an updateContract upgrade needs a defined process

The trade-off is real. A dApp is harder to change, slower than a centralised app for many tasks, and every on-chain action costs a fee. Teams choose dApps when openness, user control or shared rules matter more than speed and convenience.

What do smart contracts do in a dApp?

Smart contracts are the rules of a dApp, written as code and stored on the blockchain. They hold funds, check conditions and carry out actions automatically when those conditions are met. A lending dApp, for example, uses a contract to hold collateral, release a loan and liquidate the position if the collateral falls below a set level.

Contracts run exactly as written, which is both their strength and their risk. Nobody can change a deployed contract's behaviour on a whim, so users can trust the rules. But a bug in the contract is also hard to fix, which is why serious dApps get their contracts audited before launch and tested on a test network first.

Most dApps use several contracts together: one for the core logic, one for the token, and sometimes one for governance votes. Keeping contracts small and focused makes them easier to test and easier to audit. For the audit side, see what a smart contract audit covers.

How do wallets and identity work?

A wallet is how a user identifies themselves to a dApp. Instead of a username and password, the user connects a wallet, and the dApp asks the wallet to sign messages that prove the user controls an address. The signature is checked on-chain, so no password ever leaves the user's device.

Because the wallet holds the user's assets, every action that moves value needs the user's approval in the wallet. The dApp shows what the transaction will do, the user confirms it, and the wallet signs it. This is why dApps cannot move a user's funds without their signature.

Losing access to a wallet means losing access to the assets in it, since there is no company to reset a password. Good dApps explain this clearly, show the transaction details before asking for a signature, and never ask a user to sign a message they cannot read. For the wallet types involved, see what a hot wallet is.

What runs on-chain and what runs off-chain?

Not everything in a dApp runs on the blockchain. The parts that need shared trust run on-chain: the rules, the balances, the votes and the ownership records. The parts that need speed, privacy or large files run off-chain: the interface, the images, the search index and the analytics.

This split is a design decision, not an accident. Storing a photo on-chain would be slow and expensive, so dApps store the file off-chain and keep only a fingerprint of it on-chain. The fingerprint proves the file has not changed, while the file itself lives where storage is cheap.

A common pattern is to keep the contract small and move the heavy work off-chain, then bring only the result back on-chain. A game might run its graphics and matchmaking off-chain and record only the final result and the rewards on-chain. The art of building a dApp is choosing the right split for the product.

Example: a small community voting dApp

Example (hypothetical): a 120-member community wants to vote on how to spend a shared treasury of 6,000 dollars. They build a simple voting dApp: members connect a wallet, read the proposals, and cast a vote that is recorded on-chain.

The arithmetic is simple. A proposal needs more than half the votes to pass, so with 120 members it needs at least 61 yes votes. If each vote costs a network fee of 40 cents, a full round of 120 votes costs 48 dollars in fees. The treasury keeps 6,000 dollars for spending, and the voting costs stay separate so fees never eat into the funds.

The community also sets a rule: a proposal must stay open for three days, and only members who joined before the proposal was posted can vote. Those rules live in the contract, so nobody can shorten the vote or add voters after seeing the early result.

What are the common mistakes?

The most common dApp mistakes are putting everything on-chain, treating a contract audit as optional, and designing an interface that hides what a transaction actually does.

  • Putting everything on-chain. Files, images and search indexes belong off-chain. Only the rules and records that need shared trust should live on the blockchain.
  • Skipping the audit. A contract bug can lock or drain funds, and deployed contracts are hard to fix. Audit before launch, not after a problem.
  • Hiding transaction details. Users should see exactly what they are signing. A dApp that asks for blind signatures will lose trust fast.
  • No upgrade plan. Contracts need a defined way to fix bugs and add features, agreed before launch.
  • Ignoring fees. If every action costs a fee, small actions become too expensive and users stop using the product.

Key takeaways

  • A dApp runs its rules in smart contracts and its records on a shared ledger
  • Users connect with a wallet instead of a username and password
  • Smart contracts run exactly as written, so bugs are hard to fix after launch
  • Files, images and search belong off-chain; only trust-critical records go on-chain
  • A dApp trades speed and easy changes for openness and user control

Frequently asked questions

Is a dApp the same as a blockchain?

No. A blockchain is the network and ledger that stores data and runs contracts. A dApp is an application built on top of it, with an interface, smart contracts and a wallet connection. Several dApps can run on the same blockchain.

Do I need crypto to use a dApp?

Usually yes, at least a small amount to pay network fees for on-chain actions. Some dApps cover fees for the user or use networks with very low fees, but reading data from a dApp is normally free.

Are dApps safe to use?

It depends on the dApp. A well-built dApp has audited contracts, clear transaction details and a public record of its code. An unaudited dApp can contain bugs that risk funds. Check for an audit and read what the transaction does before signing.

Can a dApp be shut down?

The contracts and ledger keep running as long as the blockchain does, but the interface can disappear if the team stops hosting it. Other teams can build a new interface for the same contracts, which is one reason dApps are hard to censor.

What are dApps used for?

Common uses include token swaps, lending, voting, gaming, marketplaces and identity. The pattern fits wherever users want shared rules and control of their own assets rather than trusting one company.

How long does it take to build a dApp?

A simple dApp with one or two contracts and a basic interface can take a small team a few weeks. Audits, testing and the interface take most of the time. Complex dApps with governance and upgrades take considerably longer.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning a dApp and unsure what should run on-chain? Talk to Hertiv.

A senior engineer replies within one business day. Or see our dApp Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call