A decentralized application (dApp) is software that runs its core logic on a blockchain through smart contracts rather than on servers controlled by a single operator. The frontend can be a normal website or mobile app, but the backend – the part that holds funds, enforces rules, and records state – lives on-chain and executes exactly as written.
The term covers a huge range: DEXs like Uniswap, lending protocols, prediction markets, games, DAOs, and more. What they share is that users interact with contracts directly from their own wallet, and no one can unilaterally change the rules once the contracts are deployed.
Architecture#
A dApp has two layers:
- Frontend. A conventional web or mobile interface. It reads chain state through an RPC provider and submits transactions on the user’s behalf. Some projects host their frontend on IPFS or Arweave so it cannot be taken down, but most still use traditional hosting.
- Backend (smart contracts). One or more contracts deployed to a blockchain like Ethereum. These handle all state that needs to be trustless – token balances, pool reserves, governance votes. Once deployed, the code is immutable unless the contract is explicitly upgradeable.
The wallet (MetaMask, Rabby, a hardware signer) bridges the two layers. It holds the user’s private key, signs transactions locally, and sends them to the network.
How a swap works on Uniswap#
A concrete example makes the architecture tangible:
- The user opens the Uniswap web app and connects their wallet.
- They select an ERC-20 token pair and enter an amount.
- The frontend calls the router contract’s
swapfunction, encoding the parameters into a transaction. - The wallet prompts the user to sign. Once signed, the transaction goes to the Ethereum network.
- Uniswap’s smart contracts pull tokens from the user’s wallet, route through one or more liquidity pools, and send the output tokens back – all atomically in a single transaction.
No intermediary custodies the funds at any point.
Categories#
| Category | What it does | Examples |
|---|---|---|
| DeFi | Lending, trading, yield farming | Uniswap, Aave, Compound |
| Governance | On-chain voting and treasury management | DAOs, Gnosis Safe |
| Gaming / NFTs | Ownership of in-game assets | Axie Infinity, OpenSea |
| Storage | Decentralized file hosting | Filecoin, Arweave |
Trade-offs#
Censorship resistance. Because the contracts live on a public blockchain, no single entity can shut them down. Even if a frontend is taken offline, anyone can interact with the contracts directly or deploy an alternative frontend.
Transparency. Contract code and all transactions are publicly auditable. For financial applications this is a meaningful trust improvement over opaque centralized systems.
Scalability. Blockchains have limited throughput. On Ethereum mainnet, gas costs spike during congestion. Layer-2 rollups (Optimism, Arbitrum, Base) improve this by batching transactions off-chain and posting proofs on-chain.
User experience. Users must manage wallets, approve token spending, pay gas fees, and understand transaction finality. The UX gap between dApps and traditional apps is narrowing but still significant.
Smart contract risk. Bugs in contracts can lead to permanent loss of funds. There is no customer support to reverse a transaction. Audits and formal verification reduce but do not eliminate this risk.