Build a Blockchain and Cryptocurrency from Scratch [1/2]

David Katz, Software Engineer - Coding Instructor

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
31 Lessons (3h 6m)
    • 1. Course Overview and Roadmap

    • 2. What is the Blockchain and Why Use it?

    • 3. The Blockchain in Practice: Cryptocurrencies and Cryptography

    • 4. The Blockchain in Practice: Mining and Bitcoin

    • 5. Roadmap to Building the Blockchain: Guided by the Bitcoin Whitepaper

    • 6. Set Up the Blockchain Application

    • 7. Create the Block

    • 8. Genesis Block

    • 9. Mine Blocks

    • 10. SHA256 Hash Function

    • 11. Test the Block

    • 12. Build the Blockchain Class

    • 13. Test the Blockchain

    • 14. Multiple Chain Validation

    • 15. Chain Validation

    • 16. Test Chain Validation

    • 17. Replace the Chain

    • 18. Test Chain Replacement

    • 19. Organize the Project

    • 20. Blockchain API - Get Blocks

    • 21. Mine Blocks Post Request

    • 22. Peer to Peer Server

    • 23. Create the WebSocket Server

    • 24. Connect to Blockchain Peers

    • 25. Handle Messages from Peers

    • 26. Synchronize the Blockchain across Peers

    • 27. Proof of Work and the 51% Attack

    • 28. Proof of Work and the Nonce

    • 29. Test the Nonce Functionality

    • 30. Dynamic Block Difficulty

    • 31. Test Difficulty Adjustment

13 students are watching this class

About This Class

This class will get you to build a blockchain and cryptocurrency from scratch.

The blockchain is a revolutionary technology that allows for the secure, distributed, decentralized storage of information. Over the past few years, the blockchain has taken the engineering landscape by storm. Many people in the industry predict that the blockchain will disrupt the ways we interact with technology on the same way the Internet did in the early 2000s.

The blockchain is the main technology behind Bitcoin, Ethereum, and the other prominent cryptocurrencies that we read about in the news today. By leveraging the blockchain, cryptocurrencies create a system of “trustless”ness. This cuts the need for middle men like banks and traders in economic systems.

Do you want to enter this young market, and become a highly sought-after blockchain engineer? The industry is starving for people who understand, and even better, can build blockchains. The supply is low, but the demand is high. So having a blockchain project under your belt will open doors and jobs for you.

For engineers, coders, and software developers, the best way to truly understand the revolutionary technologies of blockchain and cryptocurrencies, is to build a blockchain and cryptocurrency yourself. Therefore, this class will take you through implementing a blockchain and cryptocurrency - discovering the underlying techniques and concepts.

The class is designed into sections that introduce the main concepts of the blockchain one-by-one. By the end of the class, you will have a respectable blockchain project in your repertoire.

Some of the main class highlights:

  • Build a Blockchain in the object-oriented programming style.
  • Generate hashes for blocks in the chain.
  • Unit Test Components of the Blockchain.
  • Create an API around the Blockchain.
  • Create a real-time connected peer-to-peer server.
  • Implement a proof-of-work algorithm.
  • Sign Transactions with cryptography and digital signature.
  • Create a Transaction Pool for a real-time list of incoming data.
  • Include transactions in core blocks of the chain.

We’ll use NodeJS to implement this project. Don’t worry if you’re not familiar with JavaScript. This class explains the purpose behind every line and keyword. So, while JS experience will help, it’s not an absolute requirement.

Written summaries supplement each tutorial. That way, you can move along at your own pace, either watching the more thorough filmed tutorial, or reading the summary.

Ultimately, knowledge of the Blockchain will set you up for success in the future, as an engineer in a blockchain-dominated world. So what are you waiting for? Let’s get started building a blockchain!



In-Course information


Course Repository:

The completed code for this course can be found here:

Use this repository as a reference to help you find bugs in your code.

Software Requirements:

  1. You will need a command line application. For MacOS and Linux, I recommend the native Terminal application. Iterm2 is also a good option on MacOS. For Windows, I recommend using the Git Bash shell application.
  2. You will need a code editor. Use whatever you're already comfortable with. But if you're looking for one, I recommend Visual Studio Code (it's the code editor used in the course). I also suggest configuring the editor to be launchable from the command line. Do so by pressing "CMD-Shift-P", and typing in "Shell." An option for "Shell Command: Install 'code' command in PATH" should appear. Select it, and re-start your command line and Visual Studio Code.

Course Requirements:

We will use NodeJS as the engine to run our JavaScript-based project. Make sure you have Node installed on your system. Here is the installation link: You’ll need to download the appropriate installer for your system, and go through the installation process.

With Node installed, you should get responses similar to this on the command line:

$ node -v

v8.8.1 (or newer)

$ npm -v

5.4.2 (or newer)

We’ll also use a tool called Postman. This app will allow us to send custom HTTP Requests to our running blockchain servers. Here is the link to install Postman: