
In this course, you’ll learn the fundamentals of Rust and how to apply them in real-world Web3 development using the Substrate framework. At the beginning, Nikola will guide you through the basics, which will help you dive into building Web3 projects with Substrate later on. Whether you're new to Rust or already familiar with Web2 development, by the end of this course, you'll have the tools and knowledge to confidently build decentralized applications and blockchain solutions using Rust and Substrate. Let’s get started!
In this lecture, we’ll break down what Web3 is and why it’s considered the next major evolution of the Internet. You’ll learn about the key principles of decentralization, transparency, permissionless access, and trustless systems that drive the Web3 vision. We’ll explore how blockchains enable this new network by ensuring every transaction is visible, secure, and tamper-proof. By the end, you’ll not only understand the role of smart contracts in automating processes but also how to build your own blockchain using tools like Substrate to power decentralized applications.
In this lecture, we’ll explore why Rust is such a powerful tool in the Web3 space. You’ll learn how Rust’s speed, safety, and ability to compile to WebAssembly make it the go-to choice for many blockchain projects. We’ll also dive into its role in key frameworks like Substrate for blockchain logic and its use in ecosystems like Solana and Polkadot. By the end, you’ll see why Rust is often considered the Swiss Army Knife for Web3 developers and how we’ll use it in building decentralized applications.
In this lecture, we’ll walk through setting up your local development environment for Rust. Nikola will guide you step-by-step to ensure everything runs smoothly. We’ll cover how to install Rust, check your Rust compiler and toolchain versions, and introduce essential tools. By the time you’re done with this setup, you’ll have a fully functional Rust environment, and you’ll have written and executed your very first Rust code.
In this lecture, Nikola will show you how to set up your development environment in VS Code, which he'll be using throughout the course. You’re free to use any IDE you prefer, but if you choose VS Code, it is highly recommended connecting it to WSL for better performance on Windows. We’ll also add essential extensions like Rust Analyzer for code suggestions and error detection, and Even Better TOML for managing configuration files.
When you finish this lecture, your development environment will be equipped with the best tools for coding in Rust, making it easier to write and debug as we progress through the course.
In this lecture, we’ll dive into the basic structure of a Rust project and break down its key components. Nikola will also highlight important Rust features like its strong typing system, semicolon usage, and function return behavior. By the end of this lecture, you’ll have a clear picture of how Rust projects are organized and be ready to start building more complex, scalable applications.
In this lecture, we’re starting with the foundation of Rust’s data types by exploring the primitive types. Booleans, integers, floats, and text types. They all play critical roles in shaping how Rust handles data. We’ll break down each type, showing you how they work and how they’re used in practical coding scenarios, including logical operations and comparisons.
At the conclusion of this lesson, you'll not only be familiar with how Rust treats these basic types, but also how to apply them effectively in your projects, ensuring your code is efficient and robust.
This time, we’re diving into the world of sequence types by looking at tuples and arrays. These are essential tools for organizing data in Rust, and we’ll explore how to use tuples to return multiple values from a function and how arrays handle collections of elements of the same type.
Once you finish this section, you’ll have a strong understanding of how to utilize tuples for multi-value returns and arrays for fixed-size collections, making your code cleaner and more structured.
In this lecture, Nikola will take you through user defined types in Rust, focusing on structs and enums. You’ll explore how structs allow you to model complex data structures, like blockchain components, and add methods for more dynamic functionality. You’ll also dive into enums, which are ideal for handling specific states or errors in your program. Along the way, Nikola will show practical examples to help you understand how these types work together to build flexible, organized, and efficient systems.
By the end of this lecture, you’ll have the skills to define and implement both structs and enums in your Rust projects, laying the foundation for more advanced, structured programming.
In this part of the lesson, Nikola will demonstrate how to combine key Rust concepts to solve the classic FizzBuzz problem. You’ll see how control flows, loops, and conditionals come together to create a simple but effective solution.
By the conclusion of this section you will learn how to adapt your solution using different loop structures like while and loop to further enhance your understanding of Rust's control flow capabilities.
Great job! Now that we’ve covered some of the core aspects of the Rust programming language, we’re getting closer to diving into Substrate. Up until now, we’ve focused on beginner-friendly topics that may have been familiar if you’ve worked with languages like C, C++, JavaScript, or Python.
In the next phase, Nikola will guide you through a deeper understanding of how computers manage memory and how Rust helps avoid the memory management issues commonly seen in languages like C++. You’ll also explore dynamic types like vectors, sets, and hash maps, along with more advanced topics such as pattern matching, error handling, generics, traits, and macros.
By the time we wrap up this part of the course, you’ll be well-prepared to tackle more complex Rust concepts and ready to build on them when we start working with Substrate.
In this segment, Nikola will introduce how Rust’s ownership model stands out from the memory management techniques used in other languages like C, C++, Java, and C#. To fully grasp Rust’s approach, you’ll first explore how computers manage memory, focusing on the roles of the CPU, RAM, and storage devices like hard drives or SSDs. You’ll then dive into how traditional languages handle memory allocation, using the stack and heap, and how issues like memory leaks arise in languages such as C and C++.
By the end of this lecture, you’ll have a solid understanding of how Rust manages memory without needing a garbage collector, making it more efficient than higher-level languages, and setting the stage for learning Rust’s ownership system.
In this lesson, Nikola will guide you through one of Rust’s most defining features—the ownership model. You’ll learn how Rust manages memory compared to other programming languages, and how the concept of ownership prevents common issues like memory leaks. Through practical examples, you’ll explore how variables in Rust pass or borrow ownership and how to handle references. Additionally, Nikola will walk you through mutable references, variable shadowing, and the key differences between the String and str types, showcasing Rust's unique approach to memory management.
By the end of this lecture, you'll have a strong grasp of Rust’s ownership model, be confident in handling both mutable and immutable references, and understand how to effectively manage memory with dynamic and static types in Rust.
In this lesson, Nikola will introduce you to vectors in Rust—dynamic data structures similar to arrays, but with the ability to grow and shrink in size. You’ll learn how to create vectors using both the new function and the vec! macro, how to iterate over their elements, and how to modify them by adding, removing, or updating values. Nikola will also explain how Rust manages vectors in memory and how pushing new elements reallocates memory for efficient dynamic storage.
By the time you finish this lesson, you’ll have a solid understanding of how to create and manipulate vectors in Rust, making them an essential tool for dynamic data management in your programs.
In this lesson, Nikola will walk you through another powerful dynamic data type in Rust: the hash set, or simply, set. Unlike vectors, sets only store unique elements, meaning no duplicates are allowed. You’ll learn how to create sets, insert and remove elements, and check for the presence of values.
By the end of this lecture, you'll know how to efficiently use sets to store and manage unique data in Rust, making them an essential part of your programming toolkit for scenarios where duplicates are not allowed.
Throughout this part of the course, Nikola will take you through the workings of HashMaps in Rust, focusing on how they allow you to associate keys with values for more organized data management. You’ll explore how to create HashMaps, insert key-value pairs, and iterate through both the keys and values independently or together.
Once you’re done with this lecture, you’ll be well-equipped to implement HashMaps in your Rust projects, efficiently mapping and managing data to solve more complex programming challenges.
In this lecture, Nikola will introduce you to pattern matching in Rust, an essential tool that allows you to handle various scenarios explicitly and exhaustively. Nikola will guide you through examples of matching enums, tuples, slices, and even results from functions, demonstrating how Rust ensures robust error handling and data validation.
By the time you complete this part, you’ll have a solid understanding of how to leverage pattern matching in Rust to create more reliable, error-resistant programs while handling different data types and results.
In this lesson, Nikola will introduce you to closures in Rust, a powerful feature inspired by functional programming languages. You’ll learn how closures resemble anonymous functions and how they can capture variables from their surrounding environment, making them especially versatile. Nikola will demonstrate how to create simple closures, use them within loops, and explain how they differ from regular functions, particularly in their ability to capture local variables without explicitly passing them.
By the end of this lesson, you’ll understand how to write and utilize closures in Rust, seeing how they can streamline your code and offer flexibility, especially when iterating through data or managing complex calculations.
Nikola will guide you through the basics of generics and traits in Rust. Generics allow you to write flexible and reusable code by enabling functions or data types to work with different data types, while traits define the behavior a type must implement. You’ll learn how to define generic functions that can handle multiple types and specify traits that those types must fulfill, ensuring your code works consistently across various inputs.
In this final lecture of the first of the course, Nikola will walk you through macros, a key feature in Rust that allows you to write code that generates other code. While similar to macros in C and C++, Rust's macros are safer and more flexible. You’ll focus on declarative macros, which substitute patterns in code with predefined logic, and explore how they work by creating a simplified version of the widely-used vec! macro.
Once you finish this lecture, you’ll understand how to define and use declarative macros in Rust, giving you the ability to write more efficient and reusable code, especially when working on larger projects like Substrate.
Welcome to the Substrate part of the course! Substrate is a framework built on Rust for developing custom blockchains. You’ll learn the core concepts behind Substrate, including its modular and flexible architecture, which allows developers to create pallets—reusable, configurable units of blockchain logic. These pallets can be modified to run on any Substrate-based network, making Substrate a highly adaptable tool in the blockchain space.
In this lecture, Nikola will cover the core concepts of Substrate. You’ll learn about pallets, the building blocks of a blockchain, used to manage tasks like account balances, asset minting, and smart contracts. Next, Nikola will introduce FRAME, a template providing essential pallets and nodes, which act as the communication hub for the blockchain. Finally, you’ll explore the runtime, where all blockchain operations and pallet interactions occur.
Now that you’ve learned about Substrate’s components, Nikola will introduce the default pallets included in the FRAME Node Template. Key pallets include Aura and Grandpa, which handle consensus, Sudo for admin privileges, Assets for asset transfers, and Collective for managing accounts. Additional pallets like Treasury, Elections Phragmen, and Timestamp support asset management, voting, and block timestamps.
Dark green pallets are included by default, while light green ones are optional. You’re encouraged to explore which pallets are included and what additional ones can be added to a FRAME node project.
In this lecture, you'll learn how to set up a local blockchain using the FRAME Node Template. We’ll clone the project, set up the environment (including Windows-specific tips), and walk through the essential project files and folders.
By the end, you'll know how to: Clone and configure the FRAME Node Template, Understand and manage key project files, Build your local blockchain for development.
In this lecture, Nikola will walk you through the final steps of compiling, building, and running your local blockchain. You’ll learn how the build process works and why it can take time due to the complexity of Substrate projects.
By the end of this lecture, you’ll know how to build, run, and shut down your local blockchain network for development and testing.
In this lecture, we'll explore how to connect and interact with your local blockchain using Polkadot.js. Polkadot.js serves as both a block explorer and a tool for interacting with Substrate-based networks, similar to Remix for Ethereum. You'll learn how to view block history, execute extrinsics (function calls), check account balances, and query the state of various pallets.
By the end of this session, you'll be able to connect to your local development blockchain, use Polkadot.js to send transactions, explore block details, and understand how to interact with blockchain states manually. Additionally, you'll see how to connect external accounts and test blockchain functionality with real-time feedback.
In this lesson, we explore how to integrate an external pallet into a Substrate-based blockchain. The example used is the nicks pallet, which allows users to set nicknames for accounts on the chain by depositing a fee. We walk through editing the Cargo.toml and lib.rs files to include and configure the pallet, and then test it by setting and clearing nicknames.
By the end of this lecture, you'll know how to add and configure external pallets, handle dependencies, and test pallet functionality on your local blockchain through Polkadot.js.
In this lecture, we’ll go over how to create your own custom pallet and integrate it into the FRAME node. You’ll learn how to set up the project structure, including the necessary files like Cargo.toml and lib.rs. We’ll cover how to configure dependencies, write core logic, and ensure that your pallet works smoothly with Substrate’s runtime.
By the end of this session, you’ll understand the process of defining and configuring a pallet, setting up benchmarks, and preparing it for further development and integration into your blockchain.
In this lecture, we dive into creating the logic for a custom pallet by explaining the lib.rs file. We go over how to define a structure for our DeFi pallet, set up necessary configurations, and create storage options like value storage and storage maps. You’ll understand how to work with storage types, query functions, and default values for blockchain assets.
By the end, you will be familiar with configuring storage and understanding the core of the pallet structure in Substrate.
In this lecture, we configure our custom DeFi pallet into the runtime, ensuring it integrates properly into our blockchain. This involves editing the cargo.toml and lib.rs files of the runtime, importing the new pallet, and configuring essential parameters like the block count and currency.
Once you're done, you'll know how to properly add and configure a custom pallet in the runtime, including key constants and storage mappings.
In this section, we go over how to add extrinsic calls (or functions) to our custom DeFi pallet. These functions allow users to interact with the pallet, performing operations like depositing, withdrawing, borrowing, and repaying loans. The logic behind each function is explained step-by-step, and key concepts such as transactional extrinsics, pallet hooks, and error handling are covered.
By the end of this lesson, you'll understand how to add extrinsics to a Substrate pallet, handle errors, dispatch events, and create functions that manage lending and borrowing positions on the blockchain.
In this section, we address the importance of configuring the RuntimeEvent for the pallet to prevent errors during compilation. After making the necessary updates in the lib.rs file of our runtime, we rebuild the project and test it on the Polkadot.js platform.
This walkthrough demonstrates how to handle extrinsics (transactions), such as updating the collateral factor, and how errors are handled when unauthorized actions or insufficient funds are involved. The section also highlights the value of automated unit tests and benchmarking over manual testing to ensure error-free execution.
Welcome to the Rust course - part of the Web3 Academy Masterclass program!
Join Nikola in the course that offers a comprehensive guide to mastering Substrate development with Rust. You will become equipped with the tools to build, test, and deploy custom blockchain networks and decentralized finance (DeFi) solutions.
We begin by introducing you to the core principles of Rust programming, essential for writing robust and efficient code in Substrate-based projects. You will progress through creating your own custom pallet, learning about key concepts such as control flow, loops, and how to structure and optimize Rust code for blockchain applications.
As the course advances, you will explore more complex topics, including how to write and execute tests for your pallet, benchmark its performance, and handle off chain workers. Off chain workers are particularly vital for handling computationally expensive tasks efficiently without overloading the network. You’ll also learn how to perform runtime upgrades and migrations, ensuring your network can evolve without downtime.
The course is designed for developers looking to create scalable blockchain networks.
Ready to take your blockchain development skills to the next level? Enroll now and start building the future of decentralized technology with hands-on guidance and real-world projects. Dive into the world of Substrate and Rust—your journey to mastering blockchain begins here!