<   BLOG
How to Build a Decentralized App? And Why…
30 MAY 2022

The buzz about blockchain and cryptocurrencies is basically everywhere, so most likely you heard about them. While some people still try to figure out what NFTs are, others already request decentralized application development and make money with crypto. Crypto experts say that decentralization is the future of the Internet. But do we really need to decentralize everything? I’m a developer at Brivian, and I’ll tell you what is a decentralized application, which businesses need them, and how to develop one.

What is a decentralized app and how it differs from other apps?

The first thing you need to know is that there are centralized and decentralized applications. Centralized apps perform their processes on the backend part, and store data on a server — for example, AWS. Decentralized apps run their main processes on a blockchain, and store data on multiple independent servers.

how to build a decentralized app: the difference between decentralized and centralized appsThe difference between decentralized and centralized apps

In the case of centralized apps, a server is the control center and the point of failure. It means that if someone decides to block access to the app, it would be enough to just shut down the server. As for DApps, no one can control them thanks to blockchain — you simply can’t shut down all the servers of the chain.

Basically, blockchain allows users to interact with each other without any middlemen. Let’s take financial applications as an example — when users perform financial operations, a bank serves as a mediator. The banking company has all the controls, it decides whether a user can perform an operation or not. They can block a user’s account, reject payments, etc. Users are only left to trust the bank, accept the fact that they don’t control their own money, and hope that their accounts are gonna be okay.

Financial DApps are different — they have no control point, no one owns them, and no one can block access to them. Users’ money belongs to them forever and ever, no one will freeze their accounts. Users can transfer money straight to each other, without anyone’s supervision.

how to build a decentralized app for financesHow to build a decentralized app for a financial system

Another example is from social media. In some countries, the government wants to control the media and block ‘unwelcome’ resources on the Internet. It’s possible with centralized applications: block the access to the app’s server and you’re done — users won’t be able to chat via WhatsApp without VPN. Knowing how to build a decentralized app, you can create an app that allows phones to connect with each other via a blockchain. Since there’s no control point, the hypothetic government would need to shut down every node manually, which is next to impossible. That’s why users would be able to communicate freely. The drawback is that if the app exists on a blockchain, users would need to pay a small fee for every action in the app.

People trust such apps more than the usual ones, not only because they’re protected from censorship and restrictions. Data that you save on a blockchain stays there forever — you can’t change or delete the created data block once you add it to the chain. Every member of the blockchain can see all the information it stores, and no one can falsify it. Imagine that you participate in an online lottery and you’re afraid that the organizers will trick players and choose the winner manually. It’s impossible with blockchain since the data is open for all members — anyone can check who actually won the lottery.

Data falsification is out of the question because of the blockchain’s nature. Every block contains information about the previous block. If someone tries to change the data in one block, the next block will show that this info is false. The verification system will then cut this block off as false.

how to build a decentralized app: how blockchain worksHow blockchain works: nobody owns the blockchain, and at the same time it’s transparent and open for everyone

Decentralization is better for situations where data trustworthiness is vital. In reality, regular users don’t care if an app runs on a blockchain or not — they just choose a product that meets their needs, is cheap and simple to use. Before we explain how to build a decentralized app, let’s puzzle out where this technology can be used.

Decentralized app use cases and examples

Remember that the key idea of building a decentralized app is getting rid of mediators and censorship. There’s no need to decentralize every app in the world. DApps are built for people interested in cryptocurrencies, not for users of regular apps. Imagine a decentralized Twitter: users would have to pay a fee for each post and would never be able to delete them. Would this app have millions of users? I doubt it.

It’s a good idea to decentralize if potential users can have suspicions about the product or want to interact without mediators. There are some successful solutions in the technology, financial, gaming and collectibles categories. Another idea is storing author’s rights in a blockchain — that’s what NFTs are about.

Here are a few examples of what is a decentralized app and where it can be used:

1. Auctions

Decentralization lets app creators guarantee the immutability of bids and keep records of them, which allows avoiding manipulations. Auctionity is a good example of online auction platforms working on blockchain. At the platform, users can create auctions, buy and sell NFTs.

how to build a decentralized app like auctionity

An example of a decentralized auction app

2. Prediction markets

Prediction markets are exchange platforms where people sell not goods or services, but the results of different events: it can be anything from sports events to elections. There are regular betting offices that also use this concept but the decentralized ones allow any user to create their own prediction markets, not only to bet on events offered by a platform.

An example of a decentralized prediction market is Augur — an app created on the Ethereum platform.

How to build a decentralized app like augur. An example of a decentralized prediction market appAn example of a decentralized prediction market app

3. Gambling

Betting platforms based on blockchain give better transparency to the online gambling industry. While traditional online gambling services can’t prove that they operate in a fair manner, gambling dApps can. They record all gaming activity on a blockchain — including payouts, wins, and losses.

The TRON network is now known as the ‘Las Vegas of blockchain’ because it supports a thriving dApp gambling market.

How to build a decentralized app based on tron. A decentralized gambling appHow to build a decentralized app for the gambling industry? Use the TRON network

4. Gaming

Games are another popular industry for decentralized application development. Users can play such games to earn some bonuses, exchange NFTs, etc.

One of such decentralized games is Etheremon. It’s a simulation of an Ether monster world, based on the popular Pokemon TV series. Users can catch, trade, and evolve Etheremon to beat the other players. Users buy the monsters for ETH and get a percent depending on the popularity of each monster.

how to build a decentralized app like etheremon, an example of a decentralized gaming appHow to build a decentralized app for the gaming industry: get inspired by Etheremon

Basically, a DApp can have any features that centralized apps have. But before building a decentralized app, you need to understand why this app needs decentralization. If you’re aiming at people interested in cryptocurrencies, decentralization is definitely the answer.

How do decentralized apps work?

Most often, these apps live on Ethereum — it’s a blockchain platform that has its own cryptocurrency and allows using smart contracts required for building a decentralized app. A smart contract is a computer protocol that helps users to award contracts and automatically enforces contract rules via the code. To establish the terms of the contract, users must agree on the rules that govern transactions, explore all possible exceptions, and deсide how disputes will be resolved.

For example, you want to leave someone an apartment as an inheritance. You need to draw up a contract together with the heir and prescribe the conditions in it. To get an apartment, the heir must fulfill these conditions. Then this contract must be approved by a notary. Smart contracts are the same, the difference is that you don’t need a notary — if the conditions are met, the contract is fulfilled automatically.

Since a decentralized app runs on the blockchain, every action in the app is a transaction. It means that the user needs to have a cryptocurrency wallet — they will pay a bit of ETH every time they do something in the app. So, the app needs to be integrated with a wallet.

how to build a decentralized app with wallet connectHow to build a decentralized app: integrate it with a crypto wallet

How do these apps make money?

1. Transaction fees

You can charge fees for some actions in your DApp. For example, a user buys an NFT from another user, and you get a percentage of that transaction.

2. Premium features

It’s possible to add premium features apart from the free ones. If you want to make a gaming DApp, add a possibility for users to get upgrades faster by paying some cryptocurrency.

3. Ads

Just like in traditional apps, you can place advertisements of other blockchain-based products in your DApp and get money for it.

4. Donations

Allows users to make donations by placing a donation button on your DApp or website. You can even send donation links directly to people — they only need to have a crypto wallet.

5. Selling digital goods

Another way to make money on a DApp is to create digital collectibles and sell them via the app. The same thing that Etheremon or CryptoKitties creators do.

How to build a decentralized app: step by step

Step 1. Choose a blockchain platform. Ethereum is the first and the most popular platform for building decentralized applications. It has a large toolset and ready-made solutions for developers. There are other blockchain platforms like TRON, Solana, EOS, NEO that allow decentralized application development. You need to research them, weigh all the pros and cons to find out which one fits your project. You can always ask the Brivian team for advice — we have enough expertise to help you choose the right tools.

Step 2. Write the code for the smart contract. The smart contract is responsible for the app logic — it’s the code running on the blockchain. To create such a protocol on Ethereum, you need a developer who knows Solidity.

Step 3. Create an interface. We suggest focusing on the UX design of the app — most DApps on the market have awful user experience, so it’s a great opportunity to overcome competition. At Brivian, we know how to design easy-to-use interfaces and can help you with that.

Step 4. Build the frontend part of the app. You can use any desired technology for decentralized application development and build as many front ends as you need for mobile and web applications. Without a frontend, users won’t be able to interact with your DApp.

Step 5. Build the backend part. The blockchain only stores an important part of the app logic. You simply can’t fit all the info onto a chain and you won’t be able to delete it. But applications have other data that needs to go somewhere, that’s why you need a backend part. When it’s a matter of trust — store the data on the blockchain. As for the user data, marketing information, and analytics — better keep it on a backend server.

How much does decentralized application development cost?

An MVP of a decentralized application may cost from $60.000 to $80.000, depending on the number and the complexity of features.

If you have a decentralized application development idea but are not sure if it actually needs decentralization, contact us for a consultation. In case you really want to build your solution on a blockchain, we have Web3.js and Solidity developers ready to help you.
Related Articles