Comparing Parity’s ink! with Solidity: EVM VS Substrate programming

Edinyanga Ottoho
Coinmonks
6 min readNov 20, 2022

--

In this series, I’ll be contrasting EVM chains and Substrate-based chains to clarify underlying misconceptions and misunderstandings associated with this subject matter.

The core focus of this article is on the technical (programming) aspect of both chains, but I’ll throw some light on a few other rudimentary concepts associated with them.

Substrate VS EVM

Substrate, developed by Parity technologies, is an open-source framework that offers a sort of “SDK” that can be used to build custom Blockchains.

Fun fact: Polkadot is the most prominent Blockchain developed using the Substrate framework at the core; being termed as the “Polkadot Runtime Environment”.

The core language for developing smart contracts on Substrate layers is Rust.

Some notable chains developed using Substrate are Polkadot, Aleph Zero, Apron Labs, Aventus, e.t.c.

On the other hand, the Ethereum Virtual Machine or EVM, initially created by Vitalik Buterin, is a program (or software) that runs smart contracts and computes the Ethereum network’s state each time a new block is added to the chain. The EVM lies upon Ethereum's hardware and node network layer.

Smart contracts on the EVM are developed using Solidity. Some Blockchains compatible with or capable of running the EVM are Binance Smart Chain (BSC), Polygon, Avalanche, e.t.c.

First of all, I’ll like to outline the core differences between the two chain types in a tabular checklist format.

Comparing Substrate framework to EVM

In my honest opinion, the Substrate framework is an amazing innovation by Parity technologies and holds the key to modern, ideal and futuristic Blockchain networks.

Having spotted the core differences between both infrastructures, I’ll be diving into comparing ink! (Rust) and Solidity.

Note that Substrate and EVM are not Blockchains.

Solidity

Solidity is an object-oriented, high-level language for developing smart contracts. Designed as a curly-bracket language type, it is made to target the Ethereum Virtual Machine (EVM). Its syntax and design pattern are influenced by C++, Python and JavaScript.

A typical Solidity smart contract looks as thus (from the Solidity documentation):

ink!

ink! is an embedded Domain Specific Language (eDSL) developed by Parity technologies to write smart contracts in Rust for Blockchains built upon the Substrate framework. ink! contracts are compiled into WebAssembly and can be deployed to any Substrate-based chain.

An example smart contract from the ink! docs can be seen below:

Having seen the syntactic differences between both programming languages, it’s appropriate to know the differences in terms of behaviour and execution as well.

Comparing ink! and Solidity

  • ink! is capable of running on any WASM (WebAssembly) Virtual Machine, while Solidity is designed specifically for EVM-compatible networks.
  • Programs written in ink! are encoded in WebAssembly, while those in Solidity are encoded in EVM Byte code.
  • Multiple constructor functions can be written in ink!, whereas only a simple constructor function must be written in Solidity.
  • ink! smart contracts are written with overflow protection by default, while Solidity doesn’t cater for overflows at its core (one has to manually cater for situations that would lead to overflows).
  • ink! programs can be written with tools that support Rust, whereas, Solidity has a custom toolkit.
  • Both programming languages are designed with Semantic versioning.
  • Both programming languages have metadata; i.e. Application Binary Interface (ABI).
  • Storage size is dynamic (variable) for ink!, whereas, Solidity defines storage in 256 bits.

Rust is an ideal smart contract language; take this from me.

Kudos to Parity tech for developing a framework this revolutionary!

Check out some of the biggest networks running on Substrate below (this isn’t a complete list):

Image credits: https://substrate.io/ecosystem/projects/

I strongly believe that you have seen the differences between both of these programming languages and that you’d be willing to get started developing in ink! today (Solidity is cool too, but ink!, due to the power that Rust has, is a better option for your next Blockchain project, compared to Solidity).

Ceteris paribus, I hope you enjoyed reading this article.

Kindly check me out on Twitter and drop a follow 💚

Thanks for reading up to this point of this article, fren!

New to trading? Try crypto trading bots or copy trading

--

--

Edinyanga Ottoho
Coinmonks

Senior Software Engineer | Blockchain Engineer & Enthusiast