Decentralized Application Architecture eBook
A Coursebook on Decentralized Application Architec
A Coursebook on Decentralized Application Architecture
Formats
Free sample
Chapter 1: The Trust Inversion--The most dangerous assumption in software architecture is also the most invisible: the assumption that the server you talk to today will belong to the same people tomorrow, that it will follow the same rules, that it will not one day decide that your data is its product.Most developers never question this assumption because they have never seen it break. They have built careers on top of it. They have pushed code to production assuming that the database will always be there, that the API terms will not change overnight, that the company hosting their users' photos will not go bankrupt and delete everything. These are not technical guarantees. They are social contracts, and social contracts can be revoked.I learned this the hard way in 2017.
I had built a small but thriving community platform for independent bookstores. The idea was simple: local bookstores could list their events, readers could discover readings, and everyone could discuss books in forums. I built it on a standard Web2 stack: React frontend, Node backend, Postgre SQL database, all hosted on AWS. It cost me about $200 a month to run, and I had fifteen hundred bookstores using it. The platform made no money, but it made me happy.Then Amazon changed its affiliate API terms.
Overnight, the revenue stream that funded the platform's server costs disappeared. I tried to adapt. I added a small monthly fee for bookstores. Most of them left. I tried to add advertising.
Readers complained. Within six months, the platform was generating 40amonthandcosting40 a month and costing 40amonthandcosting200. I shut it down. The bookstores that had built their event listings on my platform lost years of historical data. Readers lost their discussion threads.
No one had done anything malicious. No one had broken any laws. But the platform was gone, and so was their data.That experience taught me something that no computer science course had ever mentioned: in centralized systems, the user does not own their data. The platform owner does. The user's ability to access their own information is a privilege granted by the platform, not a right enforced by the architecture.
And privileges can be revoked.Web3 did not invent decentralization. Bit Torrent had decentralized file sharing in 2001. Bitcoin proved decentralized value transfer in 2009. But it was Ethereum, launched in 2015, that introduced the concept of a decentralized application—a program that runs exactly as written, without any possibility of downtime, censorship, or third-party interference. The promise was audacious: code that no one could stop, data that no one could delete, rules that no one could change without consensus.The reality, as with any new paradigm, has been messier.
Early decentralized applications were slow, expensive, and hard to use. Gas fees spiked to fifty dollars for a single transaction. Users lost millions because they forgot to back up a twelve-word seed phrase. Developers deployed contracts with obvious bugs and watched as hackers drained them of funds. The crypto bros and the get-rich-quick schemers dominated the discourse, drowning out the genuine architectural insights underneath.But something interesting happened between 2020 and 2025.
The technology got better. Layer 2 rollups brought transaction costs down from dollars to pennies. Account abstraction replaced unforgiving seed phrases with social recovery and sponsored gas. Indexing protocols like The Graph made querying blockchain data as easy as using a database. The hype faded, and the engineering began.This book is for the engineer who has watched the hype cycle from a distance and wondered if there is anything real underneath.
There is. But to understand it, you need to unlearn some assumptions that Web2 has baked into your mental model. You need to understand why decentralization is worth the cost—and when it is not.The Four Guarantees That Define a DApp The original Ethereum whitepaper listed four criteria that a decentralized application must satisfy. These are not marketing claims. They are architectural properties that emerge from the design of the system.
Understanding them is the first step toward deciding whether your application needs to be decentralized at all.First, the application must be open source. This does not just mean that the source code is publicly available, as with many Web2 projects. It means that the application's operation must be verifiable by anyone. Any user should be able to examine the code, compile it, and confirm that the running instance matches the source. In practice, this means that the core logic of a DApp lives in smart contracts deployed to a blockchain, where the bytecode is visible to every node.
You cannot hide proprietary algorithms. You cannot secretly change the rules. Transparency is not a feature you add; it is a property of the architecture.Second, the application's state changes must be governed by consensus. No single party can unilaterally modify the data stored on the blockchain. When a user submits a transaction that changes the state—transferring tokens, updating a profile, casting a vote—that transaction must be validated by a majority of the network's participants before it becomes final.
This is what makes blockchains "trustless." You do not need to trust a central operator because you can run a node and verify every state transition yourself.Third, the application must have no central point of failure. In Web2, every application has a central point of failure: the company that operates it. If the company goes bankrupt, changes its terms, or is legally compelled to shut down, the application dies. In a DApp, there is no company in the middle. There is no server to seize, no database to corrupt, no CEO to bribe.
The application persists as long as the network persists. This is why Bitcoin has never been shut down, despite the best efforts of governments and regulators.Fourth, the application must have a native token or some incentive mechanism. This is the most misunderstood criterion. The token is not just a fundraising mechanism. It is the economic engine that aligns the behavior of participants.
Miners or validators earn tokens for processing transactions. Users pay tokens for computational resources. Developers may hold tokens that give them governance rights over future upgrades. The token creates a closed economic loop: to use the DApp, you need its token; to earn the token, you must contribute to the network. This is not capitalism bolted onto the technology.
It is the technology.If an application does not meet all four criteria, it is not a decentralized application. It may be a centralized application that uses a blockchain for some component, or a crypto wallet attached to a Web2 backend, or any number of hybrid patterns. Those patterns have their place, but they do not offer the guarantees that make Web3 interesting.Bitcoin and Ethereum: Two Visions of Decentralization To understand decentralized application architecture, you must understand the two foundational blockchains that defined the design space. Bitcoin and Ethereum share the same core innovation—a distributed consensus mechanism that allows untrusted participants to agree on a single version of history—but they optimize for radically different use cases.Bitcoin is a global ledger. Its purpose is to track who owns which bitcoins.
The state that Bitcoin maintains is simple: a mapping from addresses to balances. The operations are even simpler: transfer value…
This is the end of the free sample. Get the eBook to keep going. Buy now
About this book
Details
- Author
- Pham Hortensia
- Publisher
- SamEnrico
- Language
- English
- Genre
- Non-Fiction, Informative, Educational
- Released
- 2026-05-09
- Pages (approx.)
- 121
- Available as
- eBook, Audiobook
Read better in the ZLOADR app
Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.
More by Pham Hortensia
Tech Imposter SyndromePham Hortensia$11.99
Student Grit GuidePham Hortensia$11.99
Dream Safe Container PracticePham Hortensia$11.99
Gaming Disorder Diagnostic WorkbookPham Hortensia$11.99
Follower Count Self Worth GuidePham Hortensia$11.99
Financial Stress And Eating Disorders GuidePham Hortensia$11.99
The Immunization Record KeeperPham Hortensia$11.99
The Move and New School TraumaPham Hortensia$11.99
ER Doctor Stress ProtocolPham Hortensia$11.99
The Secret Sauce: How a College Dropout Built a Burger EmpirePham Hortensia$11.99
The Invisible Network: How a Teen Hacker Exposed AT&T’s Dark SecretsPham Hortensia$11.99
Quetzalcoatl’s Forbidden Flight: The Serpent God’s ExilePham Hortensia$11.99