Deep dive into Polkadot, Kusama & Substrate Framework

Chimezie Chuta
9 min readJan 28, 2021

PART 1 -General

Introduction:

  • Who am i?

https://chuta.me/

https://www.linkedin.com/in/chimeziechuta/

https://slides.com/chuta

https://twitter.com/ChimezieChuta

  • Why do I do what I do?

I’m a Tech innovation professional, Drupal Developer, Blockchain & Cryptocurrency Educator, Community organizer and friend of disruptive ideas!

I love to share thoughts on what i know, and I have a special skill, gift or ability to understand intricate and complicated stuff!

  • About Blockchain Nigeria User Group

https://blockchainnigeria.group/

https://blockchaindev1000.com/

https://blockchainusers.org/

https://learn.blockchaindev1000.com/

Join us on our private group on Telegram: https://t.me/joinchat/E9zeck-1cBlpcho32nb8-g

Overview of the Internet

Web 1.0

Web 2.0

Web 3.0

The problem of the current internet & web technology

  • Centralization
  • Scalability
  • Privacy
  • Value transfer
  • Data ownership issues
  • Performance….

Why Blockchain?

  1. Users get to agree on data in the blocks without trusting or even knowing one another
  2. Nobody can change this data once accepted and written to the blockchain.
  3. Virtually impossible tor anyone to permanently delete a blockchain or even stop it from running.
  4. Everyone can verify……ability to verify is a big deal in relationships.
  5. Data is transparent, so everyone can see everything.
  6. Users can own their own data
  7. Zero single points of failure

History of Blockchain & Crypto assets technology.

The Problem of current Blockchain Technology Systems

  • Interoperability — -reliance on intermediaries/ oracles
  • Transactional scalability
  • Governance
  • Security cost
  • Upgradability
  • Slowed down the innovation process
  • Customization/ one-size-fit-all kind of problem

Polkadot & Web 3 technology solutions.

Web3 stands for;

  • Fair and open internet
  • Users own their own data, privacy, and destiny including wealth not corporations
  • Global digital transactions are secure
  • Online exchanges of information and value are decentralized

Polkadot is a scalable sharded (a piece or fragment) chain and the first protocol that provides a secure environment for cross-chain composability.

An interoperable protocol for the next web.

Polkadot unites a network of heterogeneous (different kinds) blockchains called parachains and parathreads.

These chains connect to and are secured by the Polkadot Relay Chain.

They can also connect with external networks via bridges.

What makes Polkadot Blockchain infrastructure a very interesting project to watch?

  1. The Team

Dr. Gavin Wood, founder of Web 3 Foundation, Kusama, Polkadot co-founder and former CTO at Ethereum. Dr. Wood designed and stewarded the Solidity language, was the project chief of the IDE, and designed and implemented the Whisper protocol.

  1. The technology innovation
  • GRANDPA (GHOST-based Recursive Ancestor Deriving Prefix Agreement) consensus.
  • Very high Transaction Speed
  • Safe on-chain upgrade without a fork
  • Bridges for other blockchains
  • Ethereum Smart Contract Porting
  • Security from ground zero
  1. The Company — Parity Technologies
  2. Unique developer tools
  • Substrate -Modular Framework
  • Starter Kit for rapid development of blockchain projects
  • Online IDE
  • WASM (Web Assembly)
  • Multiple programming languages ( RUST, C# /C++, Typescript)
  1. Open Source, so anyone can contribute
  2. The go-to protocol attracting billions in project investments.
  3. Huge opportunities for entrepreneurs to re- build new products and services
  4. Hundreds of tech teams are flocking and building on Polkadot https://polkaproject.com/
  5. Polkadot is the future of DeFi
  6. Already achieved a peak market capitalization of over $17 billion

The DOT Token

  • Governance -
  • Staking -
  • Bonding -

DOT holders have certain functions within the Polkadot platform, including:

  • The ability to act as a validator, nominator or fisherman.
  • The ability to participate in the governance of Polkadot.
  • The ability to be a collator for a parathread by making bids for block inclusion that are denominated in DOT.
  • The ability to participate in the decision-making process in relation to global upgrades and/or changes to Polkadot

Where Can You Buy Polkadot (DOT)?

The top exchanges for Polkadot (DOT) trading are currently Binance, FTX.com, Huobi Global, HBTC, OKEx and Binance.

Listed in August 2020 @$2.8 ATH=$18.33 Current MKT CAP= $14,303,623,775

PolkaWallet

Polkawallet does much more than just enabling you to store, send or receive digital assets. It provides a cross-chain asset one-stop management, convenient staking and governance, the private key is self-owned.

Available for iOS, Android and. APK file.

Learn more link

https://polkawallet.io/

Kusama Network

Kusama is a scalable network of specialized blockchains built using Substrate and nearly the same codebase as Polkadot.

Kusama is a network built as a risk-taking, fast-moving ‘canary in the coal mine’ for its cousin Polkadot. It’s a living platform built for change agents to take back control, spark innovation and disrupt the status quo.

Kusama serves as a proving ground, allowing teams and developers to build and deploy a parachain or try out Polkadot’s governance, staking, nomination and validation functionality in a real environment.

A live TESTNET of Blockchains built with Substrate!

Kusama Token = KSM (Listed December 2019 @ $1.7) ATH= $116

  • Validate the network
  • Nominate validators
  • Bond parachains or parathreads
  • Vote on governance referenda

PART 2 -Developers & Tech Teams

Building your Blockchain Project on Substrate Framework

What is Substrate?

An open-source framework for building Blockchain projects on Polkadot or Kusama.

Substrate enables you to create purpose-built blockchains by composing custom or pre-built components.

Just like web development frameworks like Codeigniter, Drupal etc revolutionized web application development, Substrate is set to do the same for blockchain development.

The substrate was built by blockchain developers for blockchain developers.

Substrate builds upon the achievements from the major blockchain protocols like Bitcoin and Ethereum and uses the lessons learned to give developers the latest technology to build flexible blockchains.

  • Architected on industry-standard WebAssembly
  • Highly extensible Libp2p networking
  • Rust-based primary implementation for speed and reliability
  • Javascript secondary implementation for developability
  • Wasm WebAssembly interpreter, written in Rust

Learn more Links:

Substrate Architecture

  1. Storage — is used to persist the evolving state of the decentralized system represented by a blockchain.
  2. Runtime — logic defines how blocks are processed, including state transition logic. In Substrate, runtime code is compiled to Wasm and becomes part of the blockchain’s storage state — this enables one of the defining features of a Substrate-based blockchain: forkless runtime upgrades
  3. Peer-to-Peer Network — capabilities allow the client to communicate with other network participants. Substrate uses the libp2p network stack.
  4. Consensus — engines provide logic that allows network participants to agree on the state of the blockchain.
  5. RPC (remote procedure call) — capabilities allow blockchain users to interact with the network. Substrate provides HTTP and WebSocket RPC servers.
  6. Telemetry — metrics (insights into what is going on on the network) are exposed by way of an embedded Prometheus server.

Components/ Pallets/ Modules

The runtime of a blockchain is the business logic that defines its behavior. In Substrate-based chains, the runtime is referred to as the “state transition function”; it is where Substrate developers define the storage items that are used to represent the blockchain’s state as well as the functions that allow blockchain users to make changes to this state.

Smart Contract Languages

Because Substrate uses Wasm, developers can build their smart contracts using any compatible language.

ink!

ink! is a Rust-based eDSL for writing Wasm smart contracts specifically for the Contracts module. It is designed for correctness, conciseness and efficiency.

Start Learning inK! Substrate Smart Contract development now!

Smart Contracts vs Runtime Modules

Substrate runtime modules and Substrate smart contracts are two different approaches to building “decentralized applications” using the Substrate framework.

In summary, Substrate Smart Contracts:

  • Are inherently safer for the network.
  • Have built-in economic incentives against abuse.
  • Have computational overhead to support graceful failures in logic.
  • Have a lower bar to entry for development.
  • Enable fast pace community interaction through a playground to write new logic.

Runtime Modules

Runtime modules on the other hand afford none of these protections or safeguards that Smart Contracts give you. As a runtime developer, the bar to entry on the code you produce jumps way up.

In summary, Substrate Runtime Modules:

  • Provide low-level access to your entire blockchain.
  • Have removed the overhead of built-in safety for performance.
  • Have a high bar to entry for developers.
  • Not necessarily to write working code, but to avoid writing broken code.
  • Has no inherent economic incentives to repel bad actors.

Setting up your Ubuntu Linux Substrate development environment.

Sorry, i don’t own a Mac!

Here’s the command to run on the terminal;

— — — — — — — — — — — —

apt update

apt install curl

curl https://getsubstrate.io -sSf | bash

source ~/.cargo/env

substrate

— — — — — — — — — — — —

Warning: This could take up to 1 hour to complete.

Learn more Links:

https://substrate.dev/substrate-contracts-workshop/

Development Environments/ Tools

  • Local Machine: — Node JS, Docker, Docker Composer, Visual Studio Code, or any good IDE
  • Substrate Playground online IDE
  • GitHub account

Learn more Links:

https://www.rust-lang.org/

https://substrate.dev/en/tutorials

https://playground.substrate.dev/

https://play.rust-lang.org/

Substrate-front-end-template

A Polkadot.js API + React based template for building Substrate Front Ends

https://github.com/substrate-developer-hub/substrate-front-end-template

Wasm (WebAssembly)

WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications.

Learn more Links:

https://webassembly.org/

Jobs/ Careers

https://dotjobs.net/

Build a DEMO Blockchain Nigeria User Group DAO using Substrate with Substrate Starter KIT

Substrate Blockchain Starter Kit is a tool that brings the simplicity of creating a blockchain to another level!

Drag and drop pallets to a codebase, and have your customized blockchain deployed in less than a minute!

Link:

https://substrate-starterkit.mvpworkshop.co/

BNUG DAO will be built with a premade Governance template, the resulting blockchain will support the forming of governing councils and democratic functionalities such as voting to fund the Treasury with a portion of the block reward and use the funds to pay developers and other content creators within the Nigeria Blockchain Ecosystem.

The Pallets in the templates by default include:

pallet-democracy

pallet-collective

pallet-elections-phragmen

pallet-membership

pallet-treasury

Additional Pallets to handle Identity, Assets, and Transactions will be added separately.

Export Codebase to Github, and create a new repository.

Wrapping up & next steps.

For Developers- Runtime developer, Client Side JS developer, or Smart Contract developer

Start your journey by applying to join the Certified Substrate Runtime Developer program.

Substrate gives blockchain innovators the framework for maximum freedom with minimal effort. It is highly customizable, adaptable, and made by blockchain developers for blockchain developers. It allows developers to focus their effort on the thing they care most about — the state transition function — while providing them with the networking, consensus and security as well as an upgrade path to interoperability with Polkadot.

• 6-week course (Videos + Live Workshops), 6–8 hours per week for class and assignments. The closed cohort has limited admission

• 4-week project-based internship (Optional). Opportunity to participate in a Polkadot ecosystem job fair.

• Engaging community support to interact with mentors, fellow students, and alumni through Discord

• Lifetime community membership through our alumni network

• Certification.

APPLY NOW!

https://www.industryconnect.org/substrate-runtime-developer-academy/#applynow

Tech teams & Startup entrepreneurs can use Polkastater to raise funds.

Polkastarter

Polkastarter is a protocol built for cross-chain token pools and auctions, enabling projects to raise capital on a decentralized, permissionless, and interoperable environment based on Polkadot.

https://docs.polkastarter.com/

--

--

Chimezie Chuta

IT Professional & Drupal Web Developer. Trainer @ Lagos DrupalVersity. Founder, BlockSpace.Africa, Coordinator, Blockchain Nigeria User Group, 3D Printing guy!