Many people have attempted to explain bitcoin, I will try in my own way here, using a simple example to explain the fundamentals of bitcoin.
Imagine a town on planet Mars.
In this town everyone’s possessions are listed next to their name in a records book at the town hall.
If Bob wants to pay Alice a Martian Apple tells the town hall as evidence he has paid Alice an Apple.
He goes to the hall and tells them he has given a Martian Apple to Alice and they make the change in the records book. This is a good system, as if anyone wants to trade they just agree the trade and inform the town hall who make the change in the records book. If anyone wants to check this they just go to the town hall and can see what is listed by their name, and check that everything is in order.
This is the system that is common now on earth across most of the world, only instead of a single records book at the town hall there are banks and they keep track of your money for you.
They can accept a $10 note and put it in their vault and then add $10 to your balance.
If you want to transfer that $10 to someone else at the same bank then you just inform them (by making a bank transfer) and they deduct $10 from your balance and add $10 to their balance.
This seems like a great system, however this bank has costs, like a physical bank, and a vault, and guards for the vault, and accountants to keep track of the balances and so on.
This means that there are fees for using the bank services.
For example there are fees for transferring your $10 to someone in another country. These wire transfer fees are at least $15 to send and $15 to receive. This is not ideal, especially as the world becomes more globally connected and person to person payments increase further.
So how about we go back to the idea of having a big list of everyone and their balance (the records book), only now we make that list publicly available for all! Thousands of copies are digitally distributed around the world and kept up to date.
Problem 1 : Privacy
The first problem is privacy. We don’t want anyone to be able to look at our balance, so instead of listing our names we list a kind of account number. No one can tell it’s us from looking at this kind of account number. We will call this number our Public Key. Public because anyone can see it. We are now pseudo-anonymous that is, the Public key does not reveal the identity of the user.
Problem 2: Accuracy
The next problem is keeping the list up to date and accurate! This is what cost all the money for the banks which is precisely what we are trying to avoid.
We can start by splitting up all the effort of this task between as many people as we can get to help. This is done by making the software opensource and distributed. This way anyone who wants to support the new system can help! By using a standard method/format to record each transaction (a transfer from one person’s private key to another’s) the amount of storage needed is reduced too.
Something like person A transfers $2 to person B would be condensed down to A:2:B (really small!)
Explanation continued …
Importantly this is then sent to everyone on the network who is running this software.
Every 10 minutes or so we will gather all of these messages and use them to adjust the balance of everyone’s account. Then we do use something called hashing to store which group of transactions were included. To do this we take a hash of the transactions that we used to update balances and this forms a single hash of the group of transactions. We combine this with the hash of the last lot of transactions. This is to make sure that every 10 minute group gets combined with every group before it!
Hashing is considered practically impossible to invert. It takes an input for example abc and outputs a string of numbers and/or letters.
Hashing in Bitcoin
Bitcoin uses a SHA-256 Hash where
abc -> ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad (think ba78....15ad)
SHA-256 is actually quite quick to calculate, so there is a real danger that someone could calculate billions and billions of hashes. This could be bad if we were hashing short things like abc, but as it turns out we are hashing long strings of numbers and letters (like the one that was generated from abc) and the longer the number of letters/numbers the more combinations so we are pretty secure.
But pretty secure is not good enough, we want to be practically possible to invert. So often in bitcoin we take the SHA256 Hash of the output of a Sha256 hash. That is
abc -> ba78....15ad -> dfe7a23fefeea519e9bbfdd1a6be94c4b2e4529dd6b7cbea83f9959c2621b13c
By hashing each lot of transactions with all those gone before we create a Merkle Tree
(It also uses something called salting, but that doesn’t need to be covered now)
Explanation continued …
This system of people running free software on many computers to allow people to transact tokens and every 10 minutes updating the balances of everyone’s account in a verifiable way by hashing with SHA-256 is the fundamental explination of how bitcoin works
- The tokens are bitcoins
- The lots of transactions are block
- The list of all transactions (blocks) ever made is called the blockchain
- The people running the software to keep track of everyones balance are called miners
As Always Donations accepted graciously at 1H69CQT5YEHYFCdzN3UMeGfgwn2pKanPre