Decentralized apps (dapps) are the catalysts for the adoption of decentralized web and bridge the gap between the end user and decentralized networks.
Despite their significant importance (or precisely for that reason), their development is no plain sailing. The tech that builds a dapp is not only extremely complex, but the immutable and irreversible character of operations on the blockchain complicates the process even further once a developer encounters errors or issues.
In this article, we explore the frequent way of developing a dapp and the common impediments of this approach.
The essence of dapps are decentralized systems that run them and execute their functions. Most often, dapps utilize the blockchain tech, sometimes also the distributed ledger tech. In combination with cryptography, decentralized systems enable inherently immutable, irreversible and sealed operations.
The features of dapps are therefore not only powerful but also pose a massive obstacle in the development process.
When building a dapp, developers can’t count on straightforward instructions let alone a template that would guide them through a fixed order of needed steps. Instead, they face a mess similar to this:
Developing a dapp requires multiple and often iterations and adaptations, as well as a thorough understanding of various layers of decentralized systems and communication elements.
An example of a dapp built on the Ethereum blockchain demonstrates quite accurately the common process of building a dapp.
First, you establish the environment for writing smart contracts, you proceed to install the nodes (Geth, Parity, etc.) and MetaMask, and launch the code editor. Then, you start writing smart contracts in Solidity.
Once you create your smart contract, you test, compile and deploy it onto the Ethereum blockchain.
Then, you realize that the code is not working. It worked fine in the local test, but not on the Geth node. You return to the beginning, look for the errors (Solidity does not provide Error messages as other languages do), fix them, and test the contract again, compile and deploy it. By now, it should be working.
But it doesn’t. This time, the smart contract works fine on the Geth node, but the Parity node is something else.
You go back to look for the glitch, after a while you manage to find, and finally fix it. You deploy the dang thing again and expect it to work.
But somehow - it doesn't. It did work on the Parity node, there’s no issue with the Geth node, either. So where’s the catch? Maybe, the connection with MetaMask failed.
Again, you go back and fix this, too. Now, it seems like all the issues have been solved and the smart contract seems to be working well.
If luck (or tech) is not on your side, you encounter issues with Ganache. Maybe, the checkSum does not work as it used to. Or, lower-cased addresses don’t produce the same result on MetaMask as they did locally. And the struggle continues...
Frequent trials and iterations are an unavoidable part of dapp development, which means loads of time but also solid experience in the field is required. Dapp developers should be able to foresee potential problems as soon as possible to avoid excessive testing which consumes gas in ETH.
Even once the dapp works, a developer should analyze the operation that was executed successfully. If, for example, a function of the smart contract was asset transfer, its result should be verified, too. Also, dapp's price performance should be assessed by checking the gas fee that had been consumed in operation and comparing it to other transactions and values.
Next comes audit. Third-party inspection of smart contracts is important to eliminate as many malfunctions as possible. Great auditors ideally know the best practices of the Ethereum blockchain and are a step ahead of you in detecting issues and proposing solutions. However, even audit service can sometimes be subpar, and projects therefore often rely on community feedback. Community review is an optimal solution because both parties share the same interest - to produce and then to use a top-notch dapp. Bug bounties thus serve as a great incentive for the developer community that benefits all partakers.
Then, there’s dapp front-end which should effectively connect the dapp's UI with the blockchain via communication logic. Often, developers are left with an incredibly extensive library when building the communication logic, which impedes front-end optimization.
Last but not certainly not least, a dapp - as much as a centralized app - needs some essential elements like API, hosting, domains, etc.
This way of developing a dapp is far from optimized, as it creates some considerable issues:
1. Solidity is somehow less developer-friendly compared to mature languages since it lacks error warnings. Developers should foresee the issues, and once they occur, they're on their own to detect them.
2. Cryptographic sealing of each block of the data string prevents the developer to go back and edit it.
3. Frequent testing is essential before deploying the smart contract onto the blockchain, but it also costs ETH.
4. Choosing the most appropriate framework is difficult since each protocol comes with a different set of functions.
5. Substantial gas fees are induced with frequent testing. Furthermore, if additional functions are integrated into the smart contract, the gas cost increases.
6. Massive libraries in the communication layer come in many versions and produce specific errors, which leads to...
7. Very complicated front-end optimization of a dapp.
Dealing with all these issues takes time and a strong team of developers with years of experience, which produces significant expense, yet still does not quite guarantee a quality dapp result. Even a small error can cause a lot of damage, so it also takes its toll on the developer experience.
Ultimately, this slow and cost-ineffective process is one of the biggest blockers that impede the adoption of the blockchain tech and dapps in real businesses and institutions.
If we could funnel all the above complexity down to just a few lines of code, it would cut down development time and budget significantly while providing faster and quality results.
Instead of addressing and improving one issue at a time, the whole dapp development process should be redefined. Developers should leverage a tool that saves them time and tackles the listed issues effectively.
The 0xcert Framework happens to be just that.
It was built specifically for application developers by solving several adoption issues:
It cuts the need for a blockchain expert with years of experience.
The project doesn't have to hire security experts and expensive auditors.
All a dapp developer needs is knowledge of building a website.
The Framework establishes the communication directly with the Ethereum node, and all the calls are tested to work on all the Ethereum nodes as well as MetaMask.
All the errors that we've found during development are tackled successfully within the Framework and developers don't even encounter them. And as soon as Solidity starts supporting error handling, the Framework will include that, too.
All the contracts are pre-written, audited, and packed into a single line of code for deployment.
There is an opinionated Framework made for application developers and supports two officially approved standards and hence two types of assets: the ERC-20 standard for fungible tokens (currencies) and the ERC-721 standard for non-fungible tokens (assets). This means you can use the Framework to create dapps for the financial sector (currency) or the industry (assets) - or both.
Another powerful and unique part of the Framework is the certification layer, an innovative Merkle tree algorithm that enables selective verification of data of any JSON Schema format.
And the best part? It's open-source and free for the developer community to bring dapp development to a whole new level. Curious to learn about the Framework? Check here for more.
A guest post by 0xcert and stay tuned for the next one.