Our starting template for this tutorial uses the Polkadot SDK.
This is the same technology stack used to build and power the Polkadot Network.
To better understand what you will be doing in this tutorial, we need to start with a high level overview of blockchains.
Blockchains are the foundation of building Web3 technologies.
Web3 is a promise toward a world with less trust, and more truth.
Through blockchain technology, we are able to develop and deploy software that are decentralized, open, permissionless, censorship resistant, and independently verifiable.
The main purpose of a blockchain node is to come to consensus with other nodes on the decentralized network.
If you want to learn more about blockchains, check out the following video from the Polkadot Blockchain Academy:
At the heart of a blockchain is a state transition function (STF).
This is the logic of the blockchain, and defines all the ways a blockchain is allowed to manipulate the blockchain state.
In the polkadot-sdk
we refer to this logic as the blockchain's runtime.
All nodes on a blockchain network have and use the same runtime, allowing them to come to consensus about changes to a blockchain.
To learn more about the runtime, and its role inside of the polkadot-sdk
, check out this video from the Polkadot Blockchain Academy:
The polkadot-sdk
provides a developer framework called FRAME.
FRAME is an opinionated framework on how one should quickly and easily build and maintain a blockchain's runtime.
NOTE: It is important to clarify that FRAME is not the only way you can develop a runtime for the
polkadot-sdk
, but it is the one that the Polkadot Network uses and is most supported by the ecosystem.
You can see in our project, nearly all of our dependencies come from a single crate named frame
.
This crate is really just a convenience wrapper around other smaller crates, all exposed through frame::deps
.
For our tutorial, most of the types and traits we need access to are automatically brought into scope through frame::prelude::*
, however once in a while, we will need to import something more specific from frame::primitives
or frame::traits
.
FRAME's key decision is to break apart the blockchain runtime into separate logical pieces that can choose to interact with one another.
These logical pieces are called Pallets.
TODO: Add images.
You can think of different Pallets as different applications or functions that your blockchain exposes.
You can also think of Pallets very similar to traditional blockchain smart contracts, however Pallets are more powerful and execute much faster than smart contracts.
To learn more about FRAME and Pallets, check out this video from the Polkadot Blockchain Academy:
Non-Fungible Tokens (NFTs) are a type of token which can be created and traded on a blockchain.
As their name indicated, each NFT is totally unique, and therefore non-fungible with one another.
NFTs can be used for many things, for example: