Tools for Smart Contracts in Polkadot

Toma Sadova
WASM conference
Published in
10 min readApr 29, 2022

My name is Toma, I am Supercolony Market Growth Unit Lead, Product Owner of OpenBrush (tool for smart contracts in Polkadot), WASM Conference Lead, and just a girl who explores the crypto, WEB3, and Polkadot world every day.

Supercolony is a venture studio. As a venture studio, we are dedicated to converting business ideas into working companies and increasing market capitalization. And also to help existing businesses reach new levels, improve business models, tech expertise, or company structure.

Why the venture studio is focused not only on business issues but also on ecosystem growth and developing tools in Polkadot?

The vision of Supercolony is ecosystem creation, taking leadership in moving the market forward, and creating the way if there isn’t one. Now we clearly see this way: WASM in Polkadot as an essential next step in WEB3 progress.

This article is about TOOLS FOR SMART CONTRACTS IN POLKADOT. That was the topic of my speech at the AmsterDOT conference in Amsterdam, and now I would like to share this knowledge with everybody who wasn’t at this conference. Here I will explain the importance of WASM. Moreover, I would like to cover the business point of promoting/developing smart contracts in the current state of Polkadot.

So why did I decide to talk about the WASM, and why do I have confidence that it will be in the public eye for the next 2–3–4 years. Because I see a massive gap in knowledge, understanding, and vision for the whole community in that sphere, I aim to highlight all growth points and change them to breakthrough spots!

As probably all know, The Polkadot relay chain itself doesn’t support smart contracts. Polkadot was architected not for smart contracts at all. We adapted the understandable and useful technology to the new ecosystem. If we have such a need, let’s build the infrastructure for comfortable use. So for using smart contracts — you need a virtual machine such as EVM, eWASM, and WASM.

As Gavin Wood once said — “WebAssembly in the future, but legacy EVM is right now.” I think the future is coming, and we should build the necessary conditions to speed up it.

Why should we choose WASM Contract Pallet over EVM or others?

The problem with EVM is that it is a stack-based machine with its limitations, which you all probably know about, and so this means that smart contract cannot surpass a certain complexity and has some limitations in what can be done. This limits the features that the contract developers can create and discourage innovative projects from appearing on blockchains. Even with eWASM, the contract performance will be very slow, meaning that eWASM will not be as performant as a native WASM solution.

Furthermore, unlike EVM, adding additional language support for smart contract development (I’m talking about ink! ask! etc.). If we want to expand the smart contract development scene for a better future for blockchain technology, we need to make the technology more accessible for everyone.

Why WebAssembly for Smart Contracts?

  • WASM has near-native performance, which is good for blockchain cases to run faster.
  • Wasm is high performance — it’s built to be as close to native machine code as possible while still being platform-independent.
  • It facilitates small binaries to ship over the internet to devices with potentially slow internet connections. This is an excellent fit for the space-constrained blockchain world.
  • Wasm expands the family of languages available to smart contract developers to include Rust, C/C++, C#, Typescript, Haxe, and Kotlin. This means you can write smart contracts in whichever language you’re familiar with, though we’re partial to Rust due to its lack of runtime overhead and inherent security properties.
  • The whole spectrum of functionality.

Also, we need to understand the current state of WASM in Polkadot.

But what about the current status of WASM in Polkadot?

We, as a venture studio, understand that WASM contract performance on Parachains is not ideal. The main problem is the size of the contracts.

We can look at this problem from the developers’ perspective and see why the WASM contract hasn’t become mainstream yet:

  1. Because WASM is a common language, and many other languages can be compiled into WASM. Because it is so extensive, only part of it is covered in the ink! documentation. No single source of documentation.
  2. No dedicated development tools or environment compared to Solidity/EVM. Also, some tools and solutions are not available at WASM at all.
  3. There is a lack of live public networks that provide the environment for WASM contracts to live on. The reason is that the contract has a huge size — no environment for running a contract.
  4. Not enough projects are made with ink to make it the benchmark or starting point for future projects — Btw, we, as a venture studio, created — Funders(Product of AllienceBlock) is the first ink! commercial project.
  5. There is no network-specific documentation or sample projects as all WASM contract docs are pointing to the Substrate contract pallet on a local Substrate dev node, which is unthinkable for anyone from other smart contracts.

What could we do?

  • Promote WASM as workshops etc.
  • work on improving existing instrumentation and documentation
  • create infrastructure projects
  • Create some simple projects as an example of performance and low-cost
  • build tools to make the starting point easier.
  • encourage developers to build their projects on wasm and share it
  • Create a lower entry threshold for newcomers

As I mentioned, one of the points that we could make — is to build the tools for the smart contract development.

Let’s talk about the specific instruments in our ecosystem.

What do we have for now for smart contract development?

Europe(Patract)
Europa is a private test blockchain-based on Substrate to help Runtime Pallet and pallet-contracts development. It modifies the native Substrate chain by removing unnecessary components such as Wasm execution and adding great features to help developers get more insights into the contract execution details.

The advantage was that Europe helps quickly generated blocks and allows developers to see the call stack of the smart contract — it was useful for debugging.

Redspot(Patract)
Redspot is named after Jupiter’s Great Red Spot, which is also the largest DOT in the solar system. Redspot’s target project is like Truffle in Truffle Suite. Redspot is a development environment, testing framework, and asset pipeline for pallet-contracts. Redspot is trying to let the development of ink! be projectized and simplify the testing and interaction with contracts. With Redspot help — pallet-contracts could be integrated into any substrate chain with some partial modification.

This project is used for contracts developers if developers want to deploy and test on a blockchain.

As Patract Labs is no longer active, so the problem is that their products(Europe, Redspot, Jupiter) don’t maintain at all.

Polkadot js (Parity)

It is a Javascript library for interacting with the Substrate Blockchain. Without this tool, it is almost impossible to interact with the Substrate blockchain, and the same issue is with contracts.

The main problem is that not many developers are working on Polkadot.js. Furthermore, the need and demand for this tool are growing.

Canvas UI (Parity)
Substrate Contracts UI is a React.js application for testing WASM smart contracts deployment and interaction on compatible Substrate blockchains. It was created by the Parity team too. Currently works only with smart contracts written in ink! but should support similar smart contract languages in the near future.

In order to deploy a smart contract, you have to run a local Substrate Contracts Node.

Btw, Support for Canvas Testnet and other smart contract chains coming soon.

ink!

ink!- an extension of the Rust programming language, is what allows developers to write smart contracts for blockchains that utilize the Contracts pallet.

You can use any language to build a smart contract. In the final, it should be compiled into WASM and deployed to the network. The contract pallet is agnostic to language, so you only need to call its methods. It can be done in a raw way like in Solana, GEAR, where you call each method. ink! provides developer-friendly Rust-like language to simplify the development and hide the raw implementation under the hood. It provides useful abstraction and defines rules on how to develop a contract and how to interact with other contracts. It aims to save developers time by removing redundant code.

OpenBrush

Finally, let’s talk about OpenBrush. More than 9 months ago, we created OpenBrush with a mission to foster ink! and WASM development and adoption. The mission of this project is to make ink! usable and facilitate WASM ecosystem adoption. Here are some key statements related to OpenBrush.

  1. OpenBrush is a library for secure smart contract development on ink!
  2. We know that — OpenBrush should serve as a starting point for every developer entering a Polkadot(ink!) ecosystem.
  3. In addition to having a standard implementation, Openbrush has macros to simplify and abstract up applications(smart contracts) development.

This project is important to us as it’s our strategic Supecolony goal to accelerate Polkadot ecosystem development. Applications on Ink! are a considerable part of it. From our side, we’ve already made a huge contribution to WASM, ink!

We’re planning to continue to do that — together with the Astar Network team. Astar is a multi-chain smart contract platform that supports multiple blockchains and virtual machines. They are WASM believers, and together, we will make it usable. On AmsterDOT, only Supercolony & Astar were talking about the importance of WASM. We promise you that lots of new WASM-addicted people and projects will appear in the Dotsama ecosystem in the nearest time.

  • Our team created the first accepted Polkadot Standard for fungible tokens targeting Substrate based blockchains. (PSP22 — analog of ERC20).
  • Also, we are integrating contracts with XCM in order to have all the benefits of Substrate in WASM!
  • OpenBrush provides tools and documentation to improve the development experience. For example, modifiers, like in Solidity, wrap around the traits to simplify cross-contact communication. Or Documentation with the description of how to better start development, how to better organize your project, and so on.
  • We have the final vision for the development of smart contracts and not all ideas can be done on the OpenBrush level, so it requires the changes on ink! level — and we do it step by step to success.

We are working in all directions to simplify the development and adaptation of Solidity developers. The documentation will cover all popular topics with examples in the code and tests. Here is the thing — you could start the development of a smart contract really easily with OpenBrush using!

To sum it up, It is a lack of existing tools in the Polkadot ecosystem. We don’t have tools like Sol2Ink (simple compiler from Solidity to ink!) or Indexer( Event indexer for DApp to create a proper UI). Supercolony will lead the creation of the Infrastructure Alliance of tools — with good/useful tools for smart contracts development.

You know — the Crypto world is very volatile, one day, you are a winner, next day, you are a loser because the situation on the market has drastically changed. Typically, this forces on project teams too by inclining to cover some holes with tactical solutions. The current blockchain engineering market is overfilled with the Solidity developers who use EVM. However, there was WASM introduced as a competitor in blockchain technologies.

But beyond, it`s not enough to know some languages and use tools. You need to understand what is going on in the ecosystem, what is the hottest things and just be “in trend”. To keep moving the ecosystem forward and make the first step in Infrastructure Alliance building, Supercolony is pioneering The First Virtual WASM Conference. The one-day virtual event, 31 May, free registration. Our goal is to create a future of WASM in WEB3.0 by making it the starting point for business in the Polkadot ecosystem. It will accelerate main WASM stakeholders and key players in the whole ecosystem to discuss hot questions about WASM and ink!, and determine the vector of ecosystem development. Conference attendees will help grow the ecosystem by resolving pertinent issues, accelerating innovation, and attracting more top talent to the Polkadot.

This conference aimed to accelerate main stakeholders and key players in the whole ecosystem to discuss hot questions like — “Why WASM is the base layer of decentralized application development.”, “Why WebAssembly Matters in Polkadot”, “Future of the smart contracts», and more exciting things! We will cover everything that was covered today, but more and more deeply way. We aim to develop the Polkadot ecosystem further.

Moreover, we believe that the attendees could help grow the ecosystem by resolving relevant issues, accelerating innovation, and attracting more top talent to the Polkadot ecosystem. Also, I strive for each participant to understand why it is essential to develop the ecosystem in this direction. At the conference, you understand why you will be left “overboard” without going to WASM!

That’s why it was vital for us to continue our work and make the WASM Conference as significant as possible. And we continued to do our work. Here is the line — WASM is not just about the future, decentralization, and web3.0 — it’s about a new, honest and fair world.

Supercolony and I personally want to push everything related to WASM and bring the future (especially WASM) to the Web3.0 world.

Personal Contact 🦦

Toma Sadova
Market Growth Lead, Supercolony
toma.sadova@supercolony.net

About Supercolony 🪐

Supercolony is a venture studio dedicated to converting business ideas into successful high-level companies, leading the development processes, improving and strengthening business models, and increasing market capitalization. Supercolony’s goal is ecosystem creation, taking leadership in moving the market forward, creating the vector of ecosystem development, and making the entrance points for businesses more accessible.

Our main mission is to make blockchain usable for everyone.

LinkedIn | Website | Twitter |Telegram | GitHub | YouTube

--

--