1 of 41

Getting Started with

Polkadot SDK

OpenGuild

2 of 41

OpenGuild and Polkadot SEA

OpenGuild is a Web3.0 hub for

Polkadot enthusiasts in Southeast Asia (SEA) Region

OpenGuild

3 of 41

About Me

  • PBA wave 5 graduate
  • Polkadot SDK contributor
  • OpenGuild DevRel Lead
  • Rustacean

OpenGuild

4 of 41

My background as a DevRel Lead of OpenGuild

Contribution of OpenGuild to the Rust & Polkadot ecosystem

OpenGuild

5 of 41

Flashing Back on an

Amazing PBA Cohort in Singapore

OpenGuild

6 of 41

What are we going to talk about?

  • Overview of the Polkadot technology
  • A deep dive into Polkadot SDK architecture
    • Substrate
    • FRAME
    • Cumulus
  • Polkadot SDK & Runtimes
  • Contributing to Polkadot SDK & FRAME

OpenGuild

7 of 41

Let’s recap a bit on what

we know about Substrate

Substrate has been introduced by OpenGuild for a lot of times. So please revisit the videos.

  • Substrate is a core component of Polkadot SDK (but not only)
  • Substrate is powerful as a blockchain builder tool that abstracts away the complexity of sub-components in the blockchain system
  • Substrate is written completely in Rust
  • Substrate is a blockchain agnostic framework
    • You can use Substrate to build a solochain (Aleph Zero, peaq…)
    • Polkadot engineers uses Substrate to build parachains / relaychains

OpenGuild

8 of 41

If this is the first time you hear about Substrate, please take a look

OpenGuild

9 of 41

What is Polkadot SDK?

OpenGuild

The Polkadot SDK repository provides all the components needed to start building on the Polkadot network, a multi-chain blockchain platform that enables different blockchains to interoperate and share information in a secure and scalable way.

10 of 41

Resources for learning about

Polkadot SDK

OpenGuild

11 of 41

Polkadot

OpenGuild

12 of 41

Polkadot

Parachain Catridges

OpenGuild

13 of 41

Polkadot

OpenGuild

14 of 41

Benefits of a Polkadot Parachains

  • Shared Security: Instead of having to build a whole validator network with complex consensus mechanism for security, Parachain only needs a few nodes for block collation and the rest will be handled by the Relaychain
  • Cross-chain messaging: Parachain can communicate with other Parachains in the same Polkadot network through messaging protocol called XCMP.
  • Substrate compatibility with Rich ecosystem of libraries: All parachain in the Polkadot are Substrate-based. Hence, you can reuse code from other open-source parachain easily.

OpenGuild

15 of 41

Why is Native Shared Security important?

Scalability of the layer 1 protocols requires sharding on different layers of the network. Over years, we have seen many different solutions to solve the problem for the shared security of the sharded network.

  • Re-staking solutions like EigenLayer that allows native ETH stakers to restake their native tokens & LSTs to secure the Active Validation Services built on top of EigenLayer.
  • Scalability and Shared Security reached at the same time is extremely HARD. We see this in Modular Data Availability Layer like Celestium.

OpenGuild

16 of 41

Day Zero Design

Shared Security & Scalability is in the core design of Polkadot protocol

With the concept of Relaychain and hybrid consensus mechanism BABE + GRANDPA, native shared security is the core feature of the Polkadot system in day zero.

Hence, focusing on scalability in the multichain network is easier when you have less concerns on the security side.

OpenGuild

17 of 41

Easy to bootstrap & deploy a new blockchain network

With Agile Coretime and Coretime Marketplace

Blockchain Builders can easily buy a new core for their blockchain system and plug-n-play to use the full feature as a parachain under 3 hours.

OpenGuild

18 of 41

Why do we need

Polkadot SDK?

OpenGuild

19 of 41

Building a blockchain from scratch…

Building a Parachain with Polkadot SDK!!!

OpenGuild

20 of 41

Polkadot SDK Components

OpenGuild

Cumulus ☁️

FRAME ⚙️

Substrate ⚒️

Cumulus transforms FRAME-based runtimes into Polkadot-compatible parachain runtimes, and Substrate-based nodes into Polkadot/Parachain-compatible nodes.

XCM

FRAME is the framework used to create Substrate-based application logic, aka. runtimes.

XCM short for “cross consensus message”, is the primary format that is used for communication between parachains, but is intended to be extensible to other use cases as well.

Substrate is the base blockchain framework used to power the Polkadot SDK. It is a full toolkit to create sovereign blockchains, including but not limited to those who connect to Polkadot as parachains.

21 of 41

What is Substrate?

Consensus Layer

Database Layer

Networking Layer

Substrate is the base blockchain framework used to power the Polkadot SDK. It is a full toolkit to create sovereign blockchains, including but not limited to those who connect to Polkadot as parachains.

Platform-agnostic language

OpenGuild

22 of 41

  • Ready to hack
  • Modular design
  • Highly customized
  • Forkless upgrade

23 of 41

Building with Substrate

Runtime

Node

FRAME Pallets

FRAME is optional for Substrate-based chain

Run a Substrate node

Configure Runtime

Programming a logic in Pallet

OpenGuild

24 of 41

What is FRAME?

FRAME development environment provides modules—called pallets—and support libraries that you can use, modify, and extend to build the runtime logic to suit the needs of your blockchain.

25 of 41

26 of 41

FRAMEless Substrate is Possible

  • Substrate already provides complete elements for building a blockchain from scratch
  • But Substrate only has a set of tools for building blockchain system
    • Cryptography, hashing, networking, non-standard data structures…
  • A frameless Substrate codebase is a like a tremendous LEGO piece
    • Not reusable
    • Many little LEGO pieces in frameless Substrate that we have to rebuild from scratch (Consensus, Finality, Asset Management, Governance…)

OpenGuild

27 of 41

FRAME-based Runtime without Substrate is Possible

  • FRAME provides a set of libraries for developers to magically turn their runtime into a complete blockchain runtime
    • Governance, Staking, Consensus, Block Authoring, Block Finality…
    • Runtime construction & configuration
    • Storage & no-standard data structures
  • FRAME makes your runtime code reusable and well-structured

OpenGuild

28 of 41

without FRAME

SUBSTRATE

OpenGuild

with FRAME

29 of 41

Let’s play LEGO

Understand how does Substrate work

This is what you want to build

Your custom blockchain

This is what you have

Substrate Framework & FRAME

OpenGuild

30 of 41

EVM-compatible Blockchain

EVM-compatible blockchain

Substrate

pallet-evm

pallet-ethereum

pallet-dynamic-fee

OpenGuild

31 of 41

Proof-of-Stake Blockchain

Proof of Stake Blockchain

Substrate

pallet-staking

pallet-session

pallet-offences

pallet-authorship

OpenGuild

32 of 41

Cumulus

OpenGuild

Cumulus transforms FRAME-based runtimes into Polkadot-compatible parachain runtimes, and Substrate-based nodes into Polkadot/Parachain-compatible nodes.

33 of 41

Parachain

OpenGuild

Cumulus

Substrate-based

Blockchain

34 of 41

Let’s get started

OpenGuild

35 of 41

Deep Dive into

Polkadot SDK

OpenGuild

36 of 41

OpenGuild

37 of 41

Contributing to Polkadot SDK & FRAME

OpenGuild

38 of 41

Contributing to Polkadot SDK & FRAME

OpenGuild

39 of 41

Tip for your contribution

OpenGuild

40 of 41

Tip for your contribution

NOTE: Never ask for tip on your PR. The maintainers of the repository are aware of the tip system and they will give you tip if they see the contribution worths a treasury tip.

OpenGuild

41 of 41

Discuss more about the Github issues

Technical Fellowship Chat Room

on Element Matrix

Polkadot Forum

OpenGuild