What the Heck is Blockchain & Bitcoin ?
Tags: django, react, bitcoin, cryptocurrency
Published: 2021-03-19 17:41:18

A few days ago, my brother was talking to me about his plans of selling a lot of his assets and investing in bitcoin; I did not look too happy when I heard that, he said!
What is Bitcoin?

It's a peer-to-peer electronic cash system created in 2008 by a group of people / or one person in an odd mysterious way under the name of "Satoshi Nakamoto" .
    
The contemporary global financial system relies on "Centralization" or centralized banks for the exchange transactions between different parties; but what Bitcoin does is that it allows parties to make reliable transactions based on cryptographic proof eliminating the need for an intermediary [banks and financial institutions].

Opinions are widely divided between those who believe it's the future's money and who owns it owns gold itself, and between those who think it's just air bubble that doesn't have any real weight in the economy and will disappear soon [I am in that team, and that explains why I wasn't happy when George told me about his plans of investing in bitcoin].

Actually, Bitcoin is a software written in C++ and its sole purpose if to arrange binary digits in a meaningful way, and the protocol that makes it meaningful is blockchain - "currently I am working on a tutorial for my YouTube channel: https://www.youtube.com/channel/UC7EVSn5inapL20oPSwAwEUg to create a cryptocurrency application in Django and React" - and Blockchain allows 2 parties to engage in bitcoin transactions or any other crypto coin, and just like any other currency in the world that has value, Bitcoin has value 

As I'm writing these lines now [ Friday 19th March , 2021 ] 1 Bitcoin is almost = 59K 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgbaz7sw0wjakm95mmc7.PNG)
    
The Blockchain is like a real accounting ledger, but shared publicly in a decentralized or uncontrolled manner, that contains all bitcoin transactions of all the users around the globe, and is distributed and synchronized around the world and that in itself is a great and horrible thing in the same time.

Horrible because the central authority is not needed anymore for controlling and monitoring the financial transactions, and great because it delegates that role to technology! 

   
Technically, a blockchain is a just a database structured as a linked list where each record or block represents a group of transactions that have been permanently committed to the database.
The most important thing to understand in blockchain is that each block is linked to the previous one in the chain, and its creation goes through a very strict set of cryptographic rules, each user or wallet has a unique public key for receiving money [more like a login/username] and a unique private key for spending money [like a password], but before you spend bitcoin, you will need to prove that you are the owner of the public key (of that login/username).

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/erbsjjej46hqk0knkslp.png)

Each transaction contains a hash and the new owner's public key, the hash is then signed with the previous owner's private key and that validates the chain of ownership without the need to expose the private key.

 
What about mining ? George asked me
Well, mining is when someone is trying to pay two different people with bitcoin in the same time, double spending in other words.
So mining is a system which allows multiple computers around the world to agree on the entire ledger.

Each new transaction is broadcast to all nodes in the network, the transactions are packaged into a block, then miners will utilize computing power ( and I've seen such farms in China and the US, INSANE! ) to validate proof of work, so they compute a proof for a random problem that is very difficult to solve; the first miner to solve the proof gets a portion of the bitcoin as a remuneration. 

Then, the block is then broadcast back to other nodes in the network where it gets confirmed on the blockchain.