Python Blockchain - Introduction



In the tutorial on Blockchain, we have learnt in detail about the theory behind blockchain. The blockchain is the fundamental building block behind the world’s most popular digital currency Bitcoin. The tutorial deeply dealt with the intricacies of Bitcoin explaining fully the blockchain architecture. The next step is to build our own blockchain.

Satoshi Nakamoto created the first virtual currency in the world called Bitcoin. Looking at the success of Bitcoin, many others created their own virtual currencies. To name a few − Litecoin, Zcash, and so on.

Now, you may also like to launch your own currency. Let us call this as TPCoin (TutorialsPoint Coin). You will write a blockchain to record all transactions that deal with TPCoin. The TPCoin can be used for buying Pizzas, Burgers, Salads, etc. There may be other service providers who would join your network and start accepting TPCoin as the currency for giving out their services. The possibilities are endless.

In this tutorial, let us understand how to construct such a system and launch your own digital currency in the market.

Components Involved in Blockchain Project Development

The entire blockchain project development consists of three major components −

  • Client
  • Miners
  • Blockchain

Client

The Client is the one who will buy goods from other vendors. The client himself may become a vendor and will accept money from others against the goods he supplies. We assume here that the client can both be a supplier and a recipient of TPCoins. Thus, we will create a client class in our code that has the ability to send and receive money.

Miner

The Miner is the one who picks up the transactions from a transaction pool and assembles them in a block. The miner has to provide a valid proof-of-work to get the mining reward. All the money that miner collects as a fee will be for him to keep. He may spend that money on buying goods or services from other registered vendors on the network, just the way a Client described above does.

Blockchain

Finally, a Blockchain is a data structure that chains all the mined blocks in a chronological order. This chain is immutable and thus temper-proof.

You may follow this tutorial by typing out the code presented in each step in a new Jupyter notebook. Alternatively, you may download the entire Jupyter notebook from www.anaconda.com.

In the next chapter, we will develop a client that uses our blockchain system.

Advertisements