I'm going to explain bitcoin in a very simple language
such that even a high school student can understand easily.
bitcoin is a digital currency and in order to understand that we need to go
back to history and think about how the paper
currency started. Let's say there is a small village where
different people live in a farmer teacher
doctor and carpenter etc and there is no currency yet and when they
want to perform a trade what they would do
is they would use something that they are
good at producing for example when carpenter wants
let's say 10 kg rice he will go to farmer. Farmer
knows how to produce rice so he will buy that rice
and in exchange farmer can take a table and a chair from a carpenter
because carpenter is good at those things this is called a barter
system there is no currency involved people exchange the goods that they
produce there are some issues with barter system
such as what if farmer doesn't want table and
chair right now maybe he wants it after one year. One
possible way of solving this problem is to get more parties involved
for example farmer's son is sick and he wants to go to a doctor for his
treatment and let's say doctor needs table and a
chair so now we can involve doctor in a trade such
that carpenter will give table and chair to
doctor doctor will provide services to farmer's
son and then farmer will give rice to
carpenter. While this system works this is still
complicated there is no store of value anywhere.
We as humans came up with some medium by which
we can exchange the store of value and that medium was gold you might have
heard that in ancient time in when there were kings
etc they used to use gold coins because
gold is a very precious matter and it is very
scarce resource as well and for that reason gold is a perfect store for value
so now when farmer sells rice to carpenter he will ask for gold
coins now those gold coins have a store of
value so that after one year let's say he
wants to buy table and chair from carpenter
he needs to simply give those gold coins. While this system works really well and
it did work for so many years there were some issues
with gold as well for example it's not very easy to carry gold around.
There are issues with safety as well let's say you are
visiting a very remote town and you need a lot of
gold coins for performing trade. Gold is a heavy metal
and carrying it is risky as well. So then we came up with a paper currency
system where government can issue
these currencies which are just a piece of paper.
If you think about it there is no real value but
people have trust that the value of this piece of paper
is let's say one dollar and government is issuing it.
So it's not like everyone is printing their own currency
now paper currency is very convenient you can carry it
in your pocket it is not heavy. So many benefits.
But until some point paper currency was backed by gold but then
they removed the gold standard we live in a world of fiat currency nowadays
What fiat currency means is governments can
print the paper currency out of thin air you look at 2008 recession, COVID
recession united states government for example
printed more than 4 trillion dollar out of thin air
governments have this control over currency printing and
they can just do whatever they want which is actually not good for the
economy and there is a central control over this whole thing. So let's say if
the government is not good they can misuse this currency printing
facility. The other issue with currency is there
are organization like terrorist organization
and some unsocial elements who print fake counterfeit currency so now
in our village all these people farmer carpenter etcetera were going
through some trouble they are they were like we don't like this paper
currency system we need a better solution and at that
time a wise old man called Gandalf
walks into the village and he offers a miracle solution for all your problems
he calls it Bitcoin or a virtual money you all know
how smart Gandalf is you might must have watched a Lord of the Rings movie
and people trust on his wisdom and then they say yeah okay enough that
sounds like a good idea why don't you explain how exactly
bitcoin works. and gandalf says you all need to give me
500 in exchange I will give you 100 bitcoin
which means five dollar per bitcoin and then I will explain you how bitcoin
works. everyone else was so happy they issued
500 dollars to Gandlf and now Gandalf starts
explaining how bitcoin works. Now he takes out
notebook and a pen out of his magic bag and he starts writing transaction
just as shown in the screen and he says okay
old man or Gandalf gave farmer 100 bitcoin he gave carpenter
100 bitcoin and he said the bitcoin is nothing but this ledger
of all the transactions. Now you might have heard about ledger
if you look at a bank statement it is nothing but a ledger
in that there will be let's say two thousand dollar salary deposit
then there is fifteen hundred dollar let's say rent transaction
twenty dollar mobile phone transaction and in the end
whatever money is left is your account balance so that is a ledger
so here on note and pen gandalf writes all the transaction
and he says the bitcoin is nothing but the transactions written on this
notebook or simply a ledger and everyone gets furious
they're like what the heck you're talking Gandalf
how can this be just a notebook and some lines written on it anyone can
get their own notebook and write the lines what does it mean it doesn't have
any ground. Gandalf says well fair point how about I
add my fingerprint in front of each of these
transactions so now these transactions are
trustworthy because they have my fingerprint which no one else can
make a copy of and then everyone knows that this is Gandalf's fingerprint
so it proves that Gandalf gave farmer carpenter and so on 100 bitcoin each
then people starts wondering hmm maybe this makes sense so let's start
using it at least and we'll see if there are any
further problems so then people enroll into this digital
currency system each of these people have 100 bitcoin
each and now when farmer buys a table and a chair
from a carpenter which is worth let's say 20 bitcoin and they can decide how
much how many bitcoin the transaction is worth
all they need to do is go to Gandalf and ask him to write this transaction in
his notebook and when gandalf writes the
transaction he make sure he takes farmer's
fingerprint because farmer is giving the money
that's why we need his fingerprint on this transaction
now see since there is a fingerprint no one including Gandalf can
make any fraud they cannot write any wrong transaction
because all transactions require fingerprint
similarly when teacher buys rice worth 15 bitcoin from farmer
they both will again go to Gandalf's home
and ask Gandalf to write this transaction
on his magic notebook teacher will put his signature as well.
Now the question is what is the balance with each of these parties you know how
many bitcoins farmers own well he owns 95
because he had 100 initially then he spent
20 now he got 15 again which makes it 95 similarly teacher has 85 because he had
100 and he spent 15. So the account balance is nothing but
you just sum up all your transaction and whatever is
left is your bitcoin so the system works nicely now let's say
doctor wants to build a furniture of his entire home he wants to build sofa
table, chair, everything and he goes to carpenter
and says hey friend why don't you build all this furniture for me
the carpenter will say i will charge 130 bitcoin
and doctor will be like yeah sure but carpenter is not trusting doctor he
will go to gandalf and says all right how much money doctor has and
they find out he has only 100 bitcoin so this transaction will not happen it
will result into insufficient funds error the system that
we looked at so far with Gandalf having this book and
transaction solves couple of important issues with
currency first the money is virtual so it's not
like you have to carry around your gold or your
paper currency each transaction needs to have a
fingerprint so no fraud can be committed and no one can overspend
but the system is not perfect what if Gandalf's
home is burnt or let's say Gandalf runs away with his book all transactions
and money is lost. So this system cannot be trusted because
it is a centralized system everyone now gets together and they
decide to make this decentralized. The way you do that is you make a copy
of this notebook and everyone keeps this
notebook and by the way if there are 10 more
people in the village who wants to keep the notebook
they are free to do so so there are multiple copies of
same notebook and we have to ensure that these notebooks
stay in sync the transactions are same in all the notebooks
and there are no fraud transaction now farmer has this notebook and farmer
cannot write any fraudulent transaction because
a signature is required when doctor buys vegetables worth let's say seven bitcoin
from a farmer what they will do is they will each
update their own notebook and doctor's fingerprint is required in
all the transactions now they know that there are 10 other
notebooks in the village so doctor will broadcast this message
and say hey everyone I want to record a new
transaction so he will go to each of these people
add the transaction and most importantly add his own
fingerprint so now the system works beautifully
there is no problem of centralization everyone has a same copy of notebook
and there are no frauds there is digital there is signature
and system works nicely looking at this beautiful system
one more person who is a plumber he wants to become
part of this crypto economy and he goes to these people and
hey can I buy some bitcoin from you guys because
i want to be part of this system and farmer is like sure
I can sell some of my bitcoins to you the plumber would say how much money you
will charge farmer is like I will charge eight
dollar per bitcoin plumber is fine with it and he will he
decides to buy 10 bitcoins from farmer so now he
pays 80 dollars and gets 10 bitcoin into his account
and the way it works is simple again it's a ledger
you add one more record in the notebook with farmer's fingerprint so now
initially when Gandalf sold this bitcoins to each
of these individual people he sold it at a price of five dollar per
bitcoin and now when farmer sold it he sold it
at eight dollar per bitcoin so if you plot
this in a graph you will get a graph like this and now
if you you're wondering in today's crazy market let's say bitcoin's price is 28
thousand dollar what does that mean that means people
are ready to pay 28 000 dollar to buy one bitcoin so this chart is very
similar to our own simplistic chart but this is
a real chart so there are many transaction many volatility
now total bitcoins in the system is still 400.
as the economy expands we need to add more bitcoins because the economy cannot
sustain let's say the whole village starts using this
bitcoin 400 bitcoin is too less so we need a way
to add new bitcoin to the system now we cannot
randomly add bitcoins because then it becomes more like paper currency
so everyone decides that we want a system where bitcoin becomes
more like gold which is hard to produce so they come up
with this challenge where there is a mountain near
to our beautiful village and every day let's say two times in a
day the challenge starts let's say seven
o'clock in the morning the challenge start where
people who wants to participate in the challenge they need to climb the
mountain and whoever reaches the mountain first
will get 10 bitcoins similarly at 2 o'clock again
they do a new challenge so in a day they produce
20 new bitcoins so the challenge starts and everyone starts climbing the
mountain and farmer is super strong so he reaches
the mountain first and he gets 10 bitcoin rewards
now in our ledger there is one more entry where he says farmer got 10 new
bitcoins so total number of bitcoins in the
system are 410 yeah new money now
to make it similar to gold every year we need to increase the difficulty which
means after one year when you do the same challenge instead
of 10 now you get only five new bitcoin
after two years if you climb a mountain you get only 2.5 new bitcoin this way
as your passes by number of bitcoins generated
are getting less and less and will reach a point where
you can no longer produce new bitcoin Because let's say if you get
point zero zero zero five new bitcoin for climbing in the mountain
no one will really climb the mountain so this way
it becomes more like gold so I hope this analogy based explanation gives you
some idea now analogy is analogy it it will be
little bit disconnected from the reality so let me try to connect this analogy
with the reality now. Our old wise man mr gandalf is no one but Satoshi
Nakamoto a person who invented a bitcoin if you
google bitcoin paper by Satoshi you will find
his pdf paper which explains the whole bitcoin
protocol the fingerprint is actually a digital
signature using public private keys so you need to
study cryptography for this so if you google
cryptography and public private key you will find some explanation some
internet pages and i have a link of a nice youtube
video as well so you can watch that but I try to give you a simple idea on
what public private key is let's say you have your post office box
now everyone knows the public key which is
the address of that mailbox basically but only the
person who is the owner let's say this is a
mailbox he will have a key which can open that
box so that key is a private key so the public key is the address of the
box private key is the actual key which only owner has whereas the public
key is something that everyone can see and maybe if they want
to put a mail in that box they can even put
but in order to retrieve it back you need
the private key you you will watch that video which I
have linked in the video description below and you'll get some good idea
but basically if you want to think about real life
it is as good as our fingerprint a fingerprint which
no one else can copy by the way the notebook that we talked about in our
village example in real life it's a digital ledger
and digital ledger is not basically not an pen
it is a record in a computer system which has all the transactions and if
you look at these transactions you don't have people's name like farmer
and carpenter instead you have the public keys of
their digital wallets so now farmers selling seven bitcoin
worth of vegetables to a doctor here doctor will have his digital wallet
which has a public key which is visible to everyone
but it has a private key that is only accessible to a doctor
and using this private key he can transfer his bitcoin to someone else
let's say he has 50 bitcoin now as part of this trade he
wants to transfer seven of them to farmers digital account and
farmer's digital wallet also has a public key which is visible to a doctor
but it has a private key which is only known to a farmer
so using farmers public key doctor will transfer
seven bitcoin to him and that transaction will be recorded
on our digital ledger and when the transaction is confirmed
our now doctor has 43 and farmer has 82 bitcoins again there will be a
digital signature now the little disconnect between
analogy and real life is that your fingerprint usually doesn't change
but in this case digital fingerprints will change but
they will remain unique and only doctor can put that
fingerprint if he's transferring the money
the notebook that we talked about that notebook will be filled with more and
more transaction and at some point you need more than one
notebooks so let's say in our system we have three notebooks
similarly in digital ledger there will be many transactions
and you need blocks so here one block is around 2000 transaction
and then you will have blocks linked with each other if you know computer
programming this looks more like a linked list and since these
blocks are kind of chained together it is called a blockchain let's talk
about mountain climbing so mountain climbing in real life is
called bitcoin mining you might have heard this
bitcoin mining word so often and bitcoin mining is a process of
producing new bitcoins and the way you do that is you have to
solve a mathematical puzzle. It is more like a guessing work and once
you solve it you get rewarded with the bitcoin so
let's talk about math a little bit let's say that is a simple function
square of x is equal to 16. if i ask you to guess number x you would
be able to guess it easily well x is 4 very easy to guess
let's look at other function sum of a and b is nine
this one is little hard to guess because a and b
could be four and five three and six zero and nine
[Music] but there is a function called sha256
it is a hash function which takes an input string and
produces a 256 bit number. But it is close to impossible to make a
guess on what x is based on the
output hash and if you pass let's say sha 256 abc it will produce
this string but if you change a character from c to
d it will produce a totally different random string that's why you cannot
infer anything the only way you can make a guess on x
is you have to repetitively guess x and
then only you can find the answer but it's very difficult to find
that answer it requires a lot of guesswork.
I have given a simple python code here for
computing sha 256 here and i made a video on how to do bitcoin mining with
just 15 lines of python code. So I want you to check out that video I
have given my the code as well so you kind of
understand what the miners are doing exactly now I
of course made it very simple python code in reality they are using GPU
accelerator hardware sometimes they use assembly code so they
try to optimize it but this code will give you an
idea on underlying algorithm so sha 256 is a cryptographic hash
function it is called cryptographic because the
hash is cryptic it's hard to make a guess on it
so let's talk about the real bitcoin blocks
so the real bitcoin blocks has couple of elements
first is transaction so it will have couple of transaction.
It will have block number it will have a link to a previous block
it will also have a number called nonce. so using nonce people try to make a
guess work okay so let's say you take the shar256 of
all the text which is in this green box and you get this kind of hash
now the puzzle that you need to solve is the first four digit of this hash needs
to be zero so the difficulty here is first for zero
which means the bitcoin miners what they will do is
they will keep on changing this nonce number so see you have one here now when
you change it to two you get a different hash they run the
for loop they keep on changing non like two three
four five six whatever million trillion and they try to come up with a hash
which has first four zeros so let's say with this
particular nonce value you came up with this hash
now this block is considered valid and as a bitcoin miner you get a reward and
that reward is nothing but a bitcoin you earn bitcoin because of your hard
work and how much is this reward by the way
well it changes in 2009 the bitcoin reward was 50
bitcoin per block every four years the reward
gets half so right now in 2020
it is 6.25 in 2024 it will be half than that i'm going to link couple
of videos the video by three blue one brown is
amazing you can watch it it will give you a
visual explanation of bitcoin and blockchain and so on there
is another video by Anders Brownworth he has built
a nice website which you can play with and that will give you a good
understanding on how blockchain works. Now what are the
use cases of bitcoin well bitcoin is being used by many
retailers and they accept it as a method of payment so you can pay it in
dollars you can pay it using paypal or bitcoin. Overstock.com was one
of the early website who started accepting bitcoin there are many
other retailers Starbucks Microsoft Newegg whole foods home depot
they all accept bitcoin i hope you like that simple explanation of bitcoin
if you have any question please post in a video comment below I will try my best
to answer all the questions I am Dhaval Patel. I
teach python programming technology machine learning artificial
intelligence on my channel my whole objective is to make complex
topics easy to understand using storytelling
and analogy so do check my videos if you
like this particular video share it with your friends so that they can also
understand how bitcoin weight works and is it
really worth getting into this thank you very much
for watching. Bye