Welcome to the series “From Zero to Blockchain in Python” where we will build an implementation of a blockchain application, specifically a cryptocurrency from scratch. Throughout the series, we will build and improve the functionalities until we have a fully functional demo.

Disclaimer: Please note that this is by no means intended to be used in a real scenario, the code used here is for educational purposes only.

In this part we will build the following basic blockchain functionality:

  • Possibility to add blocks to the
  • Simple Proof of Work (PoW) algorithm
  • Possibility to add transactions
  • Possibility to mine new blocks
  • Possibility to replace the chain with a new one

And we will keep the following for future posts:

  • Wallet management
  • Sign transactions
  • Peer to Peer communication

How does a blockchain work?

Before we jump right into the code you would need to have some basic understanding on what a blockchain is, how a distributed ledger works and basic ideas of cryptographic functions like sha256, if you are quite not there yet or you simply want to reinforce your knowledge please take a look into my article But how does bitcoin actually work?

Let the fun begin

We are now ready to start developing our blockchain module by module, In this article I’ll guide you step by step with code samples and explanations, going through my thought process and the code implementation. To stay focus on the main concepts, I’ll not cover here how I implemented swagger documentation or tests for code, but a copy of the full working example can be found here:

https://github.com/bajcmartinez/blockchainpy/tree/part_1

#blockchain #python #cryptocurrency #bitcoin

From Zero to Blockchain in Python - Part 1
9.75 GEEK