Let’s start with what is currency, it is a medium of exchange of goods and services. In similar terms, cryptocurrency happens to be a form of currency that can be exchanged online for goods and services and is present in digital form only.

In a technical manner, it can be stated as “Cryptocurrency is a decentralized digital currency that uses encryption techniques to regulate the generation of currency units and to verify the transfer of funds. Anonymity, decentralization, and security are among their main features. Cryptocurrency is not regulated or tracked by any centralized authority, government, or bank.”

Photo by André François McKenzie on Unsplash

DEVELOPING YOUR OWN CRYPTO-CURRENCY

To develop our own crypto-currency we have to first understand how does it work.

Blockchain, a decentralized peer-to-peer (P2P) network, which is comprised of data blocks, is an integral part of cryptocurrency.
Now, A blockchain is a type of database that works as a decentralized peer-to-peer (P2P) network, which is comprised of the data blocks.
These data blocks store information about transactions and also validate new blocks. All these blocks are connected to form a chain. The data recorded in blocks cannot be altered without the alteration of all subsequent blocks.

Now let's get into the coding stuff, we have used Python to develop this project.

First of all building the basic structure for blockchain

Here we create two classes BLOCKCHAIN and BLOCK with various functions that are required.
A BLOCK consists of data, previous_hash, hash.
Data will contain transaction details of a particular transaction.
Previous Hash will be the Hash of the previous block connected.
Hash will return the calculated hash of the current block based on the details provided.

BLOCKCHAIN will consist of various blocks connected to each other it consists of functions like *isValid* to check if the current chain is valid or not.
The function *mine* calculates the hash in such a way that the first four digits always remain 1, this is done to implement the proof of work algorithm.

https://en.wikipedia.org/wiki/Proof_of_work#:~:text=Proof%20of%20work%20(PoW)%20is,minimal%20effort%20on%20their%20part.

We have implemented this project using FLASK and MYSQL.

Github link to the project: https://github.com/koushal2001/CommonCoin

Comment below about your experience and any suggestion for the project!

And do clap if you like the content. Peace!

Competive Coder | CS undergrad | Linkedin : https://www.linkedin.com/in/koushalbhat/