Semi Decentralised Applications (Semi-DApp)

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

Semi Decentralised Applications (Semi-DApp) provides a typical web or mobile application that fully abstracts blockchain and smart contract interactions.

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.
  • User experience – Due to the decentralisation nature of DApps, the front-end of most DApps is quite simple and exposes too many technical details of the underlying smart contract and blockchain platform, which not all users are capable of grasping.

Solution

DApp provides a user interface simplifying the interaction with smart contracts. Semi-DApps further abstracts the technical details of the smart contract interactions to simplify the interface and user interaction. Develop a conventional web or mobile application for user interaction. Then couple it to the DApp backend through an API (typically implemented as a RESTful API) that translates API calls into the blockchain-specific transactions/messages. Thus, the backend is responsible for interacting with the smart contracts on behalf of the user. However, the user will not able to inspect nor validate the transactions being sent to the blockchain. The transaction ID is usually returned to the user enabling him/her to independently validate the transaction using a blockchain explorer like EtherScan. Typically user’s private key is managed by the Semi-DApp; hence, the user is not prompted to sign the transaction nor set the transaction fee.

Semi-DApp pattern

Benefits

  • Convenience – Users interact with smart contracts through a web or mobile application provided by the DApp provider. The user experience is similar to that of a conventional web or mobile application. This solution offers maximum convenience and the lowest learning curve.

Drawbacks

  • Trust – Users need to completely trust the Semi-DApp provider who is responsible for managing their private keys.

Related patterns

DApp pattern provides more visibility to the users about the transaction generation and inclusion.

Known uses

Cryptocurrency exchanges are common examples of these patterns as they always interact with the blockchain on behalf of the users. While they typically manage a pool of funds, sometimes they are also entrusted to manage individual accounts.

  • Kraken is a San Francisco-based Bitcoin exchange.
  • Binance is a cryptocurrency exchange founded in China.