Learn Python by Building a Blockchain & Cryptocurrency
4.7 (2,016 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
12,803 students enrolled

Learn Python by Building a Blockchain & Cryptocurrency

Learn Python from the ground up and use Python to build your own basic Blockchain and Cryptocurrency (Coin)!
4.7 (2,016 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
12,803 students enrolled
Last updated 2/2019
English
English [Auto-generated]
Current price: $11.99 Original price: $179.99 Discount: 93% off
30-Day Money-Back Guarantee
This course includes
  • 17.5 hours on-demand video
  • 25 articles
  • 224 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Assignments
  • Certificate of Completion
Training 5 or more people?

Get your team access to Udemy's top 3,000+ courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Students can take advanced Python courses and build real projects with it
  • Students may build upon the Python and Blockchain knowledge gained in this course and start working on their own Blockchain

  • Students can dive into Web Development or Data Science with Python

Course content
Expand all 229 lectures 17:41:12
+ Getting Started
11 lectures 37:15

Let me introduce you to this course and to what you'll learn inside of it.

Preview 01:51

Let's dive into the most important question first: What is Python? In this lecture, we'll take a closer look.

Preview 05:07

With the theory out of the way it's time to dive into Python. For that we first have to install it so let me guide you through the required steps!

Preview 03:11

In this course we'll use Python 3 - here's how to run it.

Running Python 3 as a Default (on macOS)
00:38

We installed and Python and we are ready to go, so let's actually write our first Python code!

Preview 05:05

We already wrote our first Python code, but the course comes with a special project where we will be able to apply our new knowledge - The Blockchain. Let's have a closer look at that now!

Preview 06:48

You know what Python is and how the Blockchain theoretically works but what does the course actually offer you? This lecture will answer that question.

Preview 04:41

Python is of course not the only programming language you can dive into. Let's take a closer look at some alternatives you have.

Preview 03:58

Python comes with two different versions available on the market. Let me compare these two versions and show you why learning the latest one, as we will do it throughout the course, is definitely not a bad idea.

Preview 02:22

There's more than one way of taking a course. Let's find out how you can get the most out of this course in this lecture.

Preview 03:28

Attached to this lecture, you find the module source code. Inside of the lecture, you can find some helpful links.

Useful Resources & Links
00:05
+ Diving Into the Basics of Python
26 lectures 01:31:07

Let me introduce you to this module and to what you'll learn inside of it.

Module Introduction
02:16

Before we start setting up a local environment, let's have a look at the command line, the "REPL", once again. What is the REPL, how does it work and which data types do we actually have in Python?

Understanding the REPL and Data Types
04:25

Variables are a very important core concept not only in Python but in any programming language. Variables are data containers defined by us which allow us to store information in it. Time to find out more about these!

Working with Variables
04:46

We will use numbers in our Blockchain, so let's see which numbers are supported in Python and how we can work with these!

Working with Numbers
05:36

Operators are very useful when writing our code as they allow us to add, subtract, multiply and divide data in our code. Let's have a look at how we can manage these arithmetic operations in Python!

Using Operators
03:48

We understood the basics about numbers but there is one special behaviour that we should also have a look at before we continue: Let me show you how the binary system our computers work with impacts the result of certain calculations!

Understanding a "Special" Behaviour when Working with Numbers
03:35

In addition to numbers, we can of course also work with strings in Python. Fortunately these are really easy to use, so let's have a look!

Working with Strings
02:18

Numbers and strings are fine but we want to build a Blockchain right? For that we will create a list or an array as you might know it from other programming languages. Let me show you which values lists in Python can hold and how we can access these list items!

Working with Lists
05:09

Typically you won't hardcode your list items, so we need a way to dynamically add and delete list items. Let me show you how this can easily be done in Python with special built-in functions - ".append" and ".pop"!

Adding & Removing List Items
03:02

The very basics are set - now it's time to work on the Blockchain! Let's leave the REPL for the moment, use a real development environment and start building our Blockchain. But what do we want to achieve, how should our Blockchain work?

Preparing the Blockchain - The Theory
02:02

For our local environment we want to write code in text files. An IDE (Integrated Development Environment) will make writing code a lot easier and a lot more fun. Let me show you how to get started with Visual Studio Code, the IDE I'll use throughout this course, in this video!

Installing our IDE
05:17

Functions are a very important core concept of any programming language as they allow us to define code which is executed whenever we want. Let me show you the syntax of functions in Python and let's also apply some functions to do the first steps in our Blockchain.

Using Functions to Add List Items
06:45

What are "Blocks" in a Blockchain?

Blockchain Theory: Understanding Blocks
00:49

We started adding values to our Blockchain, but until now we always refer to the first value in our list. Let me show you how we can easily access the last item in our list, because to make our Blockchain work correctly we need to be able to do so!

Accessing the Last List Item
03:24

We understood how functions work in general but they can do more: Functions can receive arguments. Let me show you why arguments are an important feature of functions and how such arguments can be a big help in our Blockchain!

Adding Arguments to Functions
02:36

Let's have a look at another powerful feature of functions: The "return" keyword which allows us to return any value once our function gets called. Let's then also add this keyword to our Blockchain!

Understanding the "return" Keyword
03:57

We already learned how to use function arguments but we can also use default arguments. These will be used if you call a function without passing the data for that specific argument. Time to find out more about that in this lecture!

Using Default Arguments
04:06

We saw that functions are really powerful, but there is one last important feature we should understand: Keyword arguments (kwargs). These arguments allow us to call a function in a different, more flexible way, so let's see why kwargs can be helpful in our Blockchain!

Working with Keyword Arguments
02:59

The Blockchain evolves, but wouldn't it be great if the user could actually enter values? Let's see how we can easily implement that feature by adding the "input" function (a special built-in function) to our code!

Using the "input" Function
03:00

Currently, we are repeating ourselves as we call the same code again and again. Once we dive into loops in the next module this issue can easily be fixed but we can already improve our code at this stage by creating an additional function. Let's do this!

Avoiding Repetitive Code Execution
02:07

We achieved a lot up to this point and we implicitly used a special concept: The Variable Scope. This defines where our variable is available in our code, anywhere or only inside the function where it was defined. Time to dive deeper into that!

Understanding the Variable Scope
06:49

A lot of the basics were covered and we'll dive a lot deeper throughout the course. In addition to that it's always worth to have a look at the official docs so let me quickly guide you through these!

Exploring the Official Documentation
02:25

We had a look at the PEPs and saw that Python comes with best practices regarding the way we should comment our code. Let me show you how to add comments to your code and let's also have a look at Doc Strings.

Adding Comments and Doc Strings
04:20

When working in Python, you might end up with relatively long code. Adding line breaks can be very helpful to bring more structure into your code, so let me show you how to add these!

Structuring Multi Line Code in Python
01:56
You already learned a lot about the core features of Python, now it's time to practice!
Time to Practice - The Basics
1 question

Let me wrap this module up and summarize what you learned thus far.

Wrap Up
03:28

Attached to this lecture, you find the module source code. Inside of the lecture, you can find some helpful links.

Useful Resources & Links
00:12
+ Working with Loops & Conditionals
22 lectures 01:14:12

Let me introduce you to this module and to what you'll learn inside of it.

Module Introduction
01:38

Loops allow us to repeat code: We write the code once and then we define conditions to run the code multiple times. Let me show you how we can work with loops in Python!

Understanding Loops - Theory
02:55

Time to add a "for" loop to our Blockchain to loop through our list items!

Creating a "for" Loop
03:02

We added the "for" loop, but what about the "while" loop? Let's use this loop to create a user interface which offers multiple options for our users to choose from.

Creating a "while" Loop
03:33

How to close the REPL properly.

Closing the REPL
00:16

Besides loops, conditionals are another core concept of each programming language. Time to have a look at "if-else" to understand how we can use it to execute different code depending on the user input!

Understanding Conditionals - Theory
02:01

The theory behind "if" is clear now, so let's implement it in our Blockchain!

Adding "if-else" to our Blockchain
07:45

The "while" loop, including the "if-else", statement only supports two cases at the moment. But what if the user adds invalid input or if we want our users to be able to quit the loop? For that, we need "elif", so let's dive into that!

Working with "elif"
03:43

What if we want to quit the loop upon user input, so before the loop is actually finished? Then we need the "break" keyword. Let's have a look at this and additionally at the "continue" keyword which allows us to skip one iteration only!

Understanding "break" & "continue"
03:31

We had a closer look at loops and conditionals throughout this module, so let's use this knowledge to make our code a bit leaner and cleaner!

Improving our Code with Loops & Conditionals
06:39

We had a look at Boolean Operators already, but we didn't have a look at all of these. Specifically, let's find out more about "!=", "is" and "in" in this video!

Understanding Boolean Operators - "is" & "in"
03:37

We understood the "is" and "in" keywords, but what if we you just want to check the opposite? Then we can add the "not" keyword, so let's see how this works!

The "not" Keyword
01:17

Time to have a look at three additional important features we should know: Let's see how two of these - "and" & "or" - work in this lecture!

Understanding "and" and "or"
02:26

In addition to "and" & "or", grouping conditionals is also very important to ensure our conditionals work correctly. Let me show you how this works!

Grouping Conditionals
03:22

In case you already know other programming languages you might also know the "switch" statement. Can we also use this in Python?

What About "switch" in Python?
00:41

At the moment we can manipulate past transactions in our Blockchain, which definitely shouldn't be possible. Let me show you how we can prevent such manipulations!

Verifying our Blockchain
13:10

It's important that we can ensure the validity of our blockchain. Here's the first important building block.

Blockchain Theory: Understanding Blockchain Verification
00:50

We added the Blockchain verification, but I also wanted to show you an alternative to the "break" keyword we use in our code. Let's see how we can add conditions to a "while" loop to get rid of "break"!

Using Conditions inside the "while" Loop
01:56

One additional and good to know feature of "while" and "for" loops is the possibility to specify an "else" case. Time to have a look at that in this lecture!

Using "else" in Loops
02:07

"for" loops in other programming languages come with a built-in index function. Unfortunately Python doesn't ship with such a feature, but turns out that the "range" function can also get us there!

Adding the "range" Function
07:09
Loops and Conditionals make executing code a lot easier. Let's practice what we learned about these in this assignment
Time to Practice - Loops & Conditionals
1 question

Let me wrap this module up and summarize what you learned thus far.

Wrap Up
02:31

Attached to this lecture, you find the module source code. Inside of the lecture, you can find some helpful links.

Useful Resources & Links
00:03
+ Understanding Complex Data Structures
26 lectures 02:03:25

Let me introduce you to this module and to what you'll learn inside of it.

Module Introduction
02:50

Before we dive deeper, let's have another look at the general logic of a Blockchain and how transactions should be handled in it. What information should be transferred, how should it be transferred and what about the miners of a new block?

Understanding the Required Data Structure for our Blockchain
07:03

Which data structures do we have? In the end, all data structures will be iterables so let me give you an overview of iterables in this lecture!

Working with Iterables
05:02

The core data structures/ iterables are clear now, but which data structure should we use for our Blockchain? Let's ensure to choose the right one!

Choosing the Right Datastructure
02:55

Let's go back to our Blockchain and work on our transactions. For that, dictionaries and tuples will be really helpful, so time to have a look at these now!

Transactions with Dictionaries & Tuples
07:46

Transactions are a crucial part of a cryptocurrency blockchain. Here's a brief summary.

Blockchain Theory: Understanding Transactions
00:28

We added the tuple to our Blockchain, but now we need to pass on that data. We have multiple ways to do that, unpacking the tuple is one of our options!

Unpacking the Tuple
03:20

The transactions are one important core concept of a Blockchain, the other one is the actual mining of a block. Time to implement the block data structure to our Blockchain!

Mining Blocks
06:17

Let's continue the work on our mine-block functionality. To make our Blockchain work correctly, we need to be able to add the hash of the previous block to our new block. Time to learn how we can do this!

Hashing Previous Blocks
06:23

We implemented a basic hashing algorithm, but there is a nice alternative to that. List Comprehensions! Let me show you what these are and how we can use them to create our hashing algorithm.

Understanding List Comprehensions
05:48

We understood List Comprehensions, but what are Dict Comprehensions then? Although we won't use them very often, let me also quickly introduce you to these!

And What are Dict Comprehensions?
01:39

Back to List Comprehensions, because wouldn't it be great if we could combine these with "if"? Turns out this is possible!

Combining List Comprehensions & "if"
02:53

With our newly gained knowledge, we should go back to our Blockchain now and improve our validation logic!

Improving the Blockchain Validation Logic
08:20

One feature we didn't consider so far is the fact that we want to manage a list of participants - so senders and recipients. Because in the end, our Blockchain should become a network, so let's work on that list now!

Managing a List of Participants in the Blockchain
03:33

We can output our participants, but wouldn't it be great if we would know how many coins each participant has? Additionally, we have a little flaw in our code as we never reset our transactions. Time to change that!

Calculating Balances
07:46

Our transaction structure works now, but one very important thing is missing: We don't have any coins in our system up to now! We should definitely change that so let's make sure that miners receive a reward for mining a block. And this reward should be coins!

Rewarding the Miners of our Blockchain
03:23

We added the mining reward and we can get the balance for our participants but we should also make sure to verify our transactions! 

Verifying Transactions
05:45

The Blockchain takes shape, time for some theory now: Lists in Python are copied by reference and not by value - what does that mean and which implications does this have for your code? Let me explain the difference between copying "by reference and "by value" in this lecture!

Understanding Reference vs Value Copying
07:07

We used the "range" selector to copy our list. Let's have a closer look at some additional application areas of this selector!

Working with the Range Selector
05:42

One more thing about "by reference" vs "by value": What happens if we have a complex data structure which includes other complex data structures? Then we need to understand the difference between shallow and deep copies!

Understanding Shallow vs Deep Copies
02:42

Do you remember the "is" & "==" boolean operators from the last module? How do these behave in relation to "by reference" and "by value"? Let me show you an example to make sure we understand this!

Comparing "is" & "=="
01:36

Let's go back to the official docs: There we can find a lot of methods that we can use to call a list and manipulate it. Let's apply some of these methods and see how we can use them in practice.

Diving Deeper Into Iterable Methods
07:27

Two more important functions before we are almost done with this module: "all" & "any". Let me show you how these work and what we can use them for in this lecture!

Understanding the "all" & "any" Functions
07:35

We learned a lot about iterables/ data structures. Let me summarize what we learned about these and what we can use them for!

Comparing Iterables
06:46
We added a lot of logic to our Blockchain in this module, so let's ensure that we understood all the concepts applied!
Time to Practice - Complex Datastructures
1 question

Let me wrap this module up and summarize what you learned thus far.

Wrap Up
03:17

Attached to this lecture, you find the module source code. Inside of the lecture, you can find some helpful links.

Useful Resources & Links
00:01
+ Working with Functions & Strings
13 lectures 44:00

Let me introduce you to this module and to what you'll learn inside of it.

Module Introduction
01:30

Before we dive deeper, let's have a look at the differences between strings and lists. Both might seem equal in some cases, but actually both are totally different data structures.

Comparing Strings & Lists
03:57

With the differences between strings and lists understood, it's time to have a look at a very important string method: "format". As the name indicates, this method helps us to output nicely formatted text, definitely something very useful for our Blockchain!

Understanding the "format" Method
08:11

What if we have two equal characters in our string with two different meanings, a single quotation mark (') for example? How can we tell Python when the single quotation mark is supposed to open/ close the string and when it should behave like a normal single quotation mark does, for example when writing 'I'm Max'?

Escaping Characters
01:47

You're probably using Python 3.6 and thankfully this version comes with a very convenient way to format strings. Let me show you which way this is in that lecture!

Formatting Strings Conveniently with "f"
01:27

With the basics of string formatting being set, it's time to also apply it to our Blockchain. The balance output for example is not formatted nicely at the moment, so let's work on that!

Adding String Formatting to our Project
02:00

Do you remember List Comprehensions, which for example allowed us to apply a specific operation to all items in a list? In this lecture we'll have a look at the "map" function, an alternative to these List Comprehensions.

Understanding the "map" Function
02:53

You might have heard about Lambda functions in other programming languages. We can also use Lambda functions in Python so let me show you how these work in this lecture!

Working with Lambda Functions
02:13

With the Lamba function in mind, we can also have a look at a very useful built-in function in Python: The "reduce" function, which allows us to reduce lists, for example by summing up the values of a list. Let's dive deeper into that!

Reducing Lists
07:40

We already used the "format" function, but isn't it strange that we can pass as many arguments as we want to that method? Let's see how we can write such a method on our own!

Unpacking Function Arguments
06:32
Let's practice what we learned about Functions & Strings in this (challenging) assignment!
Time to Practice - Functions & Strings
1 question

Before we conclude this module, we have to fix a little bug: Currently our block holds more than one value in case multiple transactions occur. Using the "sum" function will easily fix this for us!

Fixing a Bug
04:13

Let me wrap this module up and summarize what you learned thus far.

Wrap Up
01:30

Attached to this lecture, you find the module source code. Inside of the lecture, you can find some helpful links.

Useful Resources & Links
00:07
+ Working with the Python Standard Library
14 lectures 54:14

Let me introduce you to this module and to what you'll learn inside of it.

Module Introduction
01:43

Let's start this module by having a look at the Python Standard Library, where we will see that Python ships with a ton of default built-in packages & features. Time to understand how we can use these packages in our project!

Exploring the Python Standard Library
02:12

We imported one package, but what happened behind the scenes when we imported it? Time to have a closer look at that!

Importing Packages - Theory
04:18

We are already creating a pseudo-hash, but at the moment this hash is readable, so we should work on that. Let's learn how we can use "hashlib" (another standard library package) to create a more secure hash now!

Importing "hashlib" to Create a Unique Hash
07:14

What's a Hash? Let's take a closer look.

Blockchain Theory: Understanding Hashes
01:03

We already learned that we have different ways to import packages. So far we always import the package names and then we're calling the functions we want to use from these packages. Time to have a look at other methods!

Using Other Import Syntaxes
01:47

The Proof of Work is a very important Blockchain concept as it makes mining new blocks more challenging. Let's dive deeper into the Proof of Work, how it works and how it makes our Blockchain more secure!

The "Proof of Work"
06:53

Here's a written summary of the "Proof of Work" concept.

Blockchain Theory: Understanding the "Proof of Work"
02:29

We understood the theory behind the Proof of Work, let me now show you how we can add it to our Blockchain!

Adding the Proof of Work to our Blockchain
05:48

With the Proof of Work being added, we now should use it whenever we mine a new block. Let's do that!

Including the Proof of Work in our Mining Function
07:49

We improved the way our hash is generated, but the mechanism we apply has one important flaw. Time to fix that in this lecture!

Fixing a Hash Order Fault
06:22

We learned a lot about importing packages throughout this module, but exporting is of course also possible. Let's improve the structure of our code and split it up into separate ".py" files!

Splitting Up our Code
04:33
We learned a lot about the Standard Library in this module, time to practice our knowledge!
Time to Practice - The Standard Library
1 question

Let me wrap this module up and summarize what you learned thus far.

Wrap Up
02:02

Attached to this lecture, you find the module source code. Inside of the lecture, you can find some helpful links.

Useful Resources & Links
00:01
+ Working with Files
13 lectures 55:18

Let me introduce you to this module and to what you'll learn inside of it.

Module Introduction
01:44

Accessing files in Python thankfully is really simple. Let's learn how we can open files with the "open" method and also how we can write data to a file in this lecture!

Handling File Access
05:44

Opening files and writing data to a file works now, but of course we also want to be able to read data. Time to learn how to do this by changing the "mode"!

Reading Data From a File
02:33

So far we only added single line content to our file, but you also might want to add multi-line content. Let's understand how we can easily do that by adding a special escape character!

Reading Multi-Line Content
05:52

In case our program continues after accessing the file, we have to make sure to call the "close" method. Turns out that there is a more convenient helper keyword which manages the file opening and closing for us - "with". Time to add that! 

Using the "with" Block Statement
02:57

We learned all about the basics regarding file access. Time to use this knowledge in our Blockchain!

Adding File Access to our Blockchain
08:39

Up to now, we are only storing string data in our file and converting it back to Python data unfortunately is an issue. Thankfully we already know a library which can help us here - the .json library!

Converting Strings Into Python Objects
16:01

Besides .json we have an alternative approach to write and load data to and from a text file: Pickle converts Python data to binary data which is stored in a file and vice versa. Let's also see how this works!

Storing Data with Pickle
06:05

We have the .json library and we have Pickle but which one should we use? Let's compare both in this lecture!

Comparing Pickle & JSON
01:05

We will use the .json library in our Blockchain, so let's change our code back to this library!

Changing the Project Back to JSON
02:30

In the next module we'll dive into debugging and error handling. Let me show you one flaw which already indicates why proper error handling definitely is an important topic!

Why we need Proper Error Handling
00:46
We learned different ways to work with files in Python - let's take the chance and test our knowledge now!
Time to Practice - Working with Files
1 question

Let me wrap this module up and summarize what you learned thus far.

Wrap Up
01:17

Attached to this lecture, you find the module source code. Inside of the lecture, you can find some helpful links.

Useful Resources & Links
00:05
+ Handling Errors & Debugging
9 lectures 20:44

Let me introduce you to this module and to what you'll learn inside of it.

Module Introduction
00:57

Official debugging solutions are very helpful when it comes to finding logical errors in our code. Let's see how we can use these at the example of Visual Studio Code!

Finding Logical Errors with the Debugger
05:53

Using the debugger is great for finding logical errors, but we might also have syntax errors. Let's see how we can find these!

Finding Syntax Errors
01:40

Another error type that can occur are runtime errors. Let's see how we can work on these by adding the "try" block statement offered by Python! 

Using "try" to Find Runtime Errors
04:33

We learned how we can handle errors, but which errors should we actually handle? Because handling any type of error is probably not the best idea. Let me show you why!

Which Errors Should you Handle?
03:01

We learned a lot about errors, so now it's time to also add error handlers to our project!

Adding Error Handlers to our Blockchain
02:32

There's one type of error we're not handling yet ...

Handling Empty File Errors
00:15

Let me wrap this module up and summarize what you learned thus far.

Wrap Up
01:49

Attached to this lecture, you find the module source code. Inside of the lecture, you can find some helpful links.

Useful Resources & Links
00:03
+ Object Oriented Programming
26 lectures 02:13:58

Let me introduce you to this module and to what you'll learn inside of it.

Module Introduction
01:13

Before we dive deeper: What is Object Oriented Programming (OOP) actually? Let me introduce you to the topic to understand our current code implementation and why OOP will help us to improve the current status.

What is Object Oriented Programming?
02:12

We learned that classes are very important in OOP. Therefore it's time to dive deeper into classes in this lecture!

Understanding Classes
01:24

Let's dive into the basics of classes in a practical example!

Creating a Class
05:09

What's the difference between a class, an instance and a dictionary? At first sight these might look quite similar, so let's take a closer look to understand the differences between these concepts!

Comparing Classes, Instances & Dictionaries
02:44

We learned that we can create multiple instances of a class. Time to dive deeper into class attributes in this lecture!

Understanding Class Attributes
03:37

We learned that classes have a lot of advantages and that we are also able to create multiple instances of a class. Let me now explain why it is also important to understand what constructor & instance attributes are!

Constructor & Instance Attributes
04:21

Let me introduce some special methods which allow us to look into the content of our objects and to print information to the console according to our needs!

Printing Classes with Special Methods
06:04

Time to dive into a more advanced concept which is related to private and public attributes in a class. Let me introduce "encapsulation" in this lecture!

Private & Public Attributes
04:39

Let's have a look at another core concept of OOP - "inheritance" - in this lecture!

Understanding Inheritance
08:46

We understood the theory, but wouldn't it be better to apply these concepts to our Blockchain? I think it would, so let's plan our Blockchain classes in this lecture!

Planning Blockchain Classes
01:32

We have to add a lot of classes to our project so time to start with the first one in this lecture: The "Block" class!

Adding a "Block" Class to the Blockchain
11:07

There is an issue with our current "Block" class implementation.

An Issue with Default Arguments
00:34

We cannot hash our block as we cannot turn objects into .json. Let's fix this issue by converting the block into a supported data type!

Saving Custom Class Objects via .json
04:49

With the "Block" class being added, it's time to do the same for the "Transaction" class. This class is strongly connected to the blocks and actually the core part of the data we are using. So let's continue!

Adding a "Transaction" Class
17:46

Before we continue adding other classes, let's see what we can improve in our Blockchain. In connection with that, we'll also see why the previously learned concept of "inheritance" can be very helpful...

Inheritance in Action
05:43

Let's move onwards and create a "Verification" class. This should become a helper class bundling some verification/ utility related methods used in the Blockchain which can be outsourced!

Adding a "Verification" Helper Class
10:03

"Node" is the next class to be added to our code. This class should include the entire "interactions" in our Blockchain, so our "while" loop and all functions related to fetching user input. Let's do it!

Initialising the "Node" Class
04:51

Until now, the Blockchain is one file within a couple of functions and variables. Time to change that by turning the entire Blockchain into a class!

Turning the Blockchain Into a Class
07:30

We already initialised the "Node" class, but we have to make some adjustments to it. Let's do that in this video!

Adding a "Node" Class
11:11

Working with classes means we have different choices regarding types but also regarding the methods and attributes of these classes. Let's have a look at the difference between "Instance", "Class" and "Static Methods" & "Attributes" in this lecture!

Understanding "Instance" vs "Class" vs "Static Methods" & "Attributes"
03:39

With the theory out of the way, it's time to apply the previously learned methods to our project!

Using "Static" & "Class" Methods on the "Verification" Class
03:44

We already talked about private attributes. Let's see if we can also use these in our project!

Using Private Attributes in the Blockchain
03:43

We worked on private attributes in the last lecture, which brings us to another interesting class-related feature: Attributes vs properties. Let me show you the differences between these two in this lecture!

Properties vs Attributes
05:20
In this module we learned a lot about Object Oriented Programming. Let's practice our new knowledge in this assignment!
Time to Practice - Object Oriented Programming
1 question

Let me wrap this module up and summarize what you learned thus far.

Wrap Up
02:15

Attached to this lecture, you find the module source code. Inside of the lecture, you can find some helpful links.

Useful Resources & Links
00:02
+ Modules
20 lectures 01:17:36

Let me introduce you to this module and to what you'll learn inside of it.

Module Introduction
01:41

Before we dive deeper, let's have a look at our code and see if we can reorganize it. Because maybe we can put certain files into their own folder, which we can then actually treat like a module...

Creating Packages - Module Bundles
04:40

We already have a "__pycache__" folder, which was generated automatically by Python. Let me explain why we have this folder and why it's important for Python to work correctly!

The "pycache" Folder
00:43

When working with multiple files or modules and when creating helper packages you might want to comment your modules. Let me show you how you can do this!

Module Docstrings
00:51

How can we control what is exported by a module? In Python this is a bit difficult, so let me lighten things up in this lecture!

Controlling Exports
05:36

Let's dive into another very important variable offered by Python: The "__name__" variable!

Understanding Execution Context & "__name__"
04:11

Enough about our own modules, let's have a look at third party modules and what we could use these for. For example, we are currently not checking whether our added or mined transactions are valid. Maybe a private and a public key might fix this issue... 

Why we Need a Private & Public Key Transaction Protection
04:25

We want to add a new package, giving us the cryptography features we need to verify our transactions. Let's learn how we can use the official Python package manager ("pip") to install a new package on our system!

Using Anaconda to Install Third Party Packages
06:23

More on virtual environments and how to use them.

Using Virtual Environments
00:48
Use Pycryptodome instead of PyCrypto
00:11

With "pycrypto" being installed, it's time to use it in our project. This also means that we basically add a wallet to our project, so let's dive into it!

Generating Keys with a Third Party Package
06:21

Generating keys is working fine, but we should also present our keys to the user who runs/ owns the node. Let's add that feature!

Connecting the Node & the Wallet
06:15

The wallet basically works, but at the moment we are passing our wallet with both a private and a public key of "none" to the Blockchain if we don't want to create a key. This behaviour should be prevented!

Generating Keys on the Node
04:06

At the moment we are creating keys, but once we shut our application down they are gone as the keys are only created in memory. Let's store the keys in files and add the code needed for that in this lecture!

Saving & Loading Keys to Files
08:24

We got our public key, but we are not signing anything yet. Let's add two methods in our wallet, one for creating a signature to sign the transaction and one for verifying these!

Creating Transaction Signatures
06:24

We are receiving a signature, now it's time to also use it in our transactions!

Adding a Signature to our Transactions
02:42

We are almost done with this module, now it's time to ensure that we can also verify our transaction. Let's do that in this lecture!

Verifying Signatures
06:49

Let's add two more improvements to ensure our verification logic works correctly!

Improving the Verification Logic
05:41

Let me wrap this module up and summarize what you learned thus far.

Wrap Up
01:21

Attached to this lecture, you find the module source code. Inside of the lecture, you can find some helpful links.

Useful Resources & Links
00:03
Requirements
  • NO prior programming language is required
  • You can use whatever operating system you want - macOS, Linux or Windows: It's all covered
Description

Want to learn Python "on the job" whilst building an exciting course project? This course is for you!

Python is probably THE most trending programming language you can learn these days!

It's very popular because it's easy to learn and use, runs on all operating systems and allows you to build a broad variety of programs: Be that web applications, desktop applications, utility scripts or using it for data science and machine learning.

In this course, you'll learn Python from scratch - and you'll do so whilst building your own Blockchain and Cryptocurrency. These are of course also highly trending topics and not a lot of people understand what a Blockchain really is. As a nice side-effect, you will know how a Blockchain works once you completed this course. It's an exciting course project that allows you to learn and apply Python to something you know and you can use.

Why Python?

As written above, Python is both easy-to-use and extremely versatile and powerful at the same time. Certainly not the worst combination. If you check it on Google trends (and compare it to other programming languages), you'll see that it's very popular these days.

It's being used by almost any important company - be that Google, Amazon or Facebook. It's used to run web applications, scripts, desktop programs and machine learning algorithms. This course sets the basics for all these use-cases!

Why Blockchain?

I believe that you learn something best if you directly apply it to a real-world project. And the Blockchain technology is an exciting trend which is there to stay. In this course, you'll learn a lot about the core concepts of the Blockchain and you'll see how Python can be used for the many aspects that make up a Blockchain and Cryptocurrency.

In my opinion, a perfect course project is challenging, interesting, something you know from real-life but also not overly complex. And that's all the case for the Blockchain! It poses some nice challenges where a lot of different Python features can be used to overcome them. It also is something we hear about all the time and yet no one knows how it works. And we can dive into the core Blockchain concepts without spending 100+ hours working on it. 

Who's teaching you?

My name is Maximilian Schwarzmüller and I'm a freelance developer. My focus is on web development but I've been working with Python for many years. It's actually one of the first languages I started with when I was 13. I'm the creator of many 5 star bestseller courses here on Udemy and I love diving into new technologies. That's why I had to dive into this whole Blockchain thing when it became more popular and why I chose it as a project for this course.

I can't wait to welcome you on board of this course and I hope you'll enjoy it just as much as I did creating it! :-)

What's in the course?

Great question! Here's a brief summary:

  • A summary of Python and the Blockchain technology
  • All the base Python syntax you need to know (variables, operators, functions, ...)
  • Loops and conditional statements
  • More complex data structures like tuples or dictionaries
  • A closer look at built-in functions and the standard library Python ships with
  • String manipulation
  • How to work with files
  • Error handling
  • Debugging
  • Object-oriented programming with classes and inheritance
  • Internal & external modules (packages)
  • How to spin up an Http server with the Flask package
  • Handling Http requests (sending & receiving)
  • And more!

What are the course prerequisites?

  • NO prior programming knowledge is required
  • Very basic knowledge about how a computer works will help you though (but can also be built up whilst you're going through the course)

Is this course for you?

It's for you if ...

  • You want to get into programming => Python is a great "first language" since it's easy to learn and very versatile
  • You want to broaden your horizon => Are you a web developer? Want to learn something new? Here you go!
  • You're interested in Python for web development => This course will teach you Python in general but there are two modules where we'll also dive into web development a bit
  • You're interested in the Blockchain technology => You'll learn the core concepts of it as a side-effect of this course!
  • You know Python but want to practice it => The course project is challenging and taken from real-life - there probably is no better practice

Does that sound good to you? I'd be honoured to welcome you in this course! :-)

Who this course is for:
  • Anyone interested in learning Python and building a real project with it
  • Anyone who's interested in learning about the core internals of a blockchain
  • Beginner developers who want to dive into one of the most trending and popular programming languages