Decentralised Applications (DApps)

Disclaimer: This is a summary of patterns we have observed during our research and should not be considered any form of technical or investment advice. Also, the given “known examples” do not imply they are the best implementations of the said pattern or any superior to any other implementation of the pattern not listed.

Summary

Decentralised Applications (DApps) are blockchain-based applications that allow users to interact with smart contracts deployed on the blockchain.

Context

Users interact with smart contracts by sending transactions to invoke their functions. Users could understand how to interact with a smart contract by analysing its on-chain or off-chain code (smart contracts are typically shared among all stakeholders as they need to agree on its contractual semantics). The Application Binary Interface (ABI) of the smart contract is also publicly accessible so that users can send transactions to it.

Problem

Users need a strong technical understanding of blockchain and smart contracts to be able to generate transactions calling smart contracts. Such a process is error-prone and results in a bad user experience. How to call a smart contract in a trustless environment?

Forces

  • Learning curve – Users need to understand the functionality of a smart contract before being able to interact with it. To understand the input required and output produced by a smart contract, users need to read the documentation or the source code of the smart contract.
  • Convenience – Manually generating transactions to interact with a smart contract is an error-prone process despite the understanding of the smart contract. Depending on whether many transactions need to be sent, it may be worth investing in automating the transaction submission process.
  • Trust – The user needs to trust the provider of the transaction submission tool/utility to submit transactions on his/her behalf.

Solution

Develop a front-end interface for users to easily interact with smart contracts. The front-end can use the same technology as conventional web or mobile applications to render the interface. As this interface is a gateway to an application running on a decentralised system (i.e., blockchain), it is referred to as a Decentralised Application (DApp). Typically, the transactions calling smart contracts are generated by DApps and presented to the users for further verification before being sent to the blockchain. Compared to a conventional application, a DApp is hosted on decentralised storage services like IPFS. Further, they may be rendered by DApp browsers like Ethereum Mist or could be implemented as a plug-in to a regular web browser like MetaMask.

DApp pattern

Benefits

  • Convenience – Users interact with a smart contract through a front-end provided by the DApp provider instead of reverse engineering how to submit transactions from the source code of the smart contract. This enhances the user experience as it does not require a deeper understanding of the smart contract or how to interact with it. Assuming the DApp is correctly implemented, it is also less errorprone than manually generating transactions to interact with smart contracts.

Drawbacks

  • Trust – Using DApps imposes trust on the DApp and its provider because the transactions are generated by the DApp on behalf of the user. However, the impact of the execution is not explicit without understanding the smart contracts underneath, especially if the source code of the contract or ABI is not published.
  • Learning curve – Basic technical knowledge regarding transactions and transaction fees are still required to issue a transaction via a DApp and verify its inclusion in blockchain.

Related patterns

Semi-DApp pattern further abstract a user’s interaction with a smart contract.

Known uses

  • State of the DApps provides a directory of the DApps on the Ethereum blockchain.
  • DAappRadar also provides a directory of DApps, not only on Ethereum blockchain but also included DApps deployed on EOS and TRON.
  • Remix is an open-source smart contract compiler that allows the user to write and interact with Solidity contracts straight from the browser.