After developing Dapps and Layer-2 for two years, Substrate ends up to be my next stop

Cdot Network
4 min readNov 27, 2019

--

Written by John Wu,CTO of Cdot Network

I was involved in three hackathons recently using Substrate stack and achieved great outcomes. Friends around me were quite curious about what Substrate is.

As a developer who devoted in Dapps and Layer-2 for two years and also played around with forking Ethereum, I decided to get deep into the community of Substrate six months ago. In my opinion, Substrate could be a better paradigm for developing decentralized applications.

1. Comparisons for three ways to develop decentralized applications.

Firstly, I would like to share with you my understanding on developing a decentralized application.For a small team, there are only three ways to develop a decentralized application.

  1. Dapp based on the smart contract
  2. Building a layer-2 solution
  3. Forking Ethereum

These three solutions, however, all have their own drawbacks in terms of operational costs, performance and flexibility.

Developing on smart contract has the lowest operational and development costs. However, its runtime is strictly restricted by the public chain it sits on. For instance, currently the signature on ed25519 is not possible to be verified on Ethereum. At the same time, projects have to compete with each other for the limited resources on the platform. For example, when ERC-20 Tethers are being transferred frequently or some gambling projects are really popular, users need to pay more transaction fees for their transactions to smart contracts yet the transactions are settled more slowly.

For layer-2 and forking Ethereum, the main problem is the high operational and development costs. In the case of layer-2, adaptors are needed for different smart contract platforms (like Ethereum, EOS, Ontology…), which is much repetitious. Here, we even ignore the fact that layer-2 performance may be limited by the base layer. In the case of forking Ethereum, apart from those shit projects who just change a name, those genuine will customize and optimize certain modules, which require a number of good developers to work on. Apart from that, projects also need to invest in much resources on developing their business logic. After all, these two approaches need much more resources comparing to smart contract.

Additionally, these three solutions are all immature from governance perspective. First of all, they all implement off-chain governance which is neither open nor fair. Also, smart contracts are not upgradable from day one, which suffers most of the Ethereum muti-sig wallets. For layer-2 and forked Ethereum, all upgrades need to be done off-line altogether by the community and any small mistakes may cause forking. (For example, Ropsten testnet of Ethereum, forking happened recently in Istanbul upgrade as most of the miner nodes did not upgrade the software.)

2.The advantages of Appchain

It was quite a shock when I saw the video last year of Dr. Gavin Wood launching a blockchain in 15 minutes on Web3 Summit. After I have done my research, I deeply felt that Appchain could be a way to implement decentralized applications.

Firstly, the development frameworks like Substrate make teams easy to develop a blockchain. The most basic parts of blockchain like consensus algorithm and P2P network have already been included by the framework, developers need to only focus on the runtime logic. The cost is much lower than layer-2 and forking Ethereum.

Secondly, as the application enjoys the resources of an entire chain, the competition on resources between Dapps will no longer be a problem. At the same time, the performance of Appchain will not be inferior to public chains like Ethereum and EOS. Comparing to smart contracts, teams can pay more attention to the development of runtime. Nevertheless, teams can also adjust parameters and even change consensus algorithm according to their practical needs.

3.Advantages of Substrate

After talking about the merits of Appchains paradigm, let’s talk about the advantages of Appchain’s framework like Cosmos SDK and Substrate (I’m also expecting Muta by Nervos). Cosmos SDK surely has its own advantages, however, I would like to talk about the comparative advantage of Substrate.

  1. More abstractive, more general purpose, less development work needed. By using the template provided by the framework, developers only need to focus on writing their storage, function logic and event. Application like crypto kitty may only require fewer than a hundred lines of codes to become an Appchain. Also, by using the front end provided by the official, interaction through user interface can be achieved without any extra work. Being able to accomplish this is all owing to the Parity’s rich experience of developing blockchain clients.
  2. Complementary tools are well equipped. For example, the front-end libraries provided by the official made it easy to build a user interface of the application. And the RPC client libraries provided by official or third party made customized RPC client easy to write.
  3. As all the runtimes are written in Wasm, Appchains built on Substrate support online upgrades. In other words, if any proposal gets passed in process of on-chain governance, full nodes will run the newest version automatically. This made seamless onchain governance and upgrade and the experience is more like an upgrade on traditional software which basically solved the governance and upgrade problem of other three solutions.
  4. Currently, official has provided WASM and EVM modules which made developing a smart contract chain nice and easy.

The first and second point mentioned above made substrate very friendly to small teams. If you are really familiar with Rust, developing an Appchain using Substrate has similar workload to developing a Dapp on Ethereum. This is also the reason why we could complete our projects on all the hackathons in very short time recently.

--

--