πŸ…ΌπŸ…°πŸ…ΊπŸ…ΈπŸ…½πŸ…Ά πŸ…ΌπŸ…ΎπŸ…½πŸ…΄πŸ†ˆ From Your Phone 2020 | πŸ€‘ 5 BEST MONEY MAKING APPS WITHOUT INVESTMENT


Click heir

hey what up guys welcome back to my
block chain channel and today we're going
to discuss the contents of a block in
the Bitcoin blockchain I think that the
block is very interesting is a very
interesting concept because the block
gives the blockchain its properties it's
the basic element of a blockchain and
therefore I think is important to
understand what a block game it consists
of
and also guys you have been requesting
ripple for a couple of days now and the
video about ripple is coming so stay
tuned we will talk about ripple in a
couple of days I promise you that but
today we'll discuss the contents of a
block so let's get into it
these are the basic parts of a block
first of all we have the magic number
the magic number is 4 bytes long and
it's an arbitrary number that signals
that this is a Bitcoin block so in
social development we have this notion
of magic numbers and different system
and different softwares use this number
to identify themselves and so Bitcoin a
Bitcoin client identifies itself as a
Bitcoin client by using this magic
number so that other systems and other
software software programs know that
this is a a Bitcoin block and that is
why we have the magic number and it's
just an arbitrary number and it is the
same for all blocks because all the
blocks identify themselves as a Bitcoin
block it's it's kind of like gender I I
identify myself as a man and all other
men on the majority of all other men
identify themselves as men not to get
political or controversial here so magic
number is is a number that identifies
what kind of software is is this and so
it's the same for all for all Bitcoin
blocks next we have the
block size which is also four bytes and
the block size tells us how how long
this block is with all of the
transactions next we have the block
header which is 80 bytes and the block
header is the most interesting part in
my opinion and we will talk about the
contents of the block header on the next
page that is why we have this arrow next
one is transaction counter which is an
integer that tells us how many
transactions this block has and next we
have a list of transactions which simply
contains all of the transactions that
are in this block and we have so if
transaction counter is 10 then we'll
have 10 transactions if the transaction
counter is 5 we'll have 5 transactions
and checks if the transaction counter is
from 1 to 9 bytes and locator is 8 bytes
blocks at is 4 bytes and magic number is
4 bytes as well so these are the basic
parts guys now we'll talk more about the
header so let's go ahead and look at
what the header consists of here we have
the header the header has a version
which simply tells us what version we
are on currently so for example the
current version of Bitcoin blocks is 2
and so if for some reason if a block
with version 1 comes it will be ignored
because the current version is 2 and if
in the future we would add more fields
and more data to this Bitcoin block
structure we would need to update this
version to a new version because now the
format of a block would look different
so this really identifies the format of
blocks because in the future we might
have blocks that look completely
different maybe we have will find some
new way of of building a blockchain
where the blocks look very different
from from this structure we have today
and then we'll have to change this
version
number two something else and the
version is four bytes
next we have 32 bytes of hash of the
previous block header so this is the
header and we can hash all of this
information at once and we get some hash
and so this hash previous block is the
hash of the header from the previous
block so we take everything here we hash
it and we have it as a filled hash
prayer block in the next block
so hash previous block is a hash of the
header from the previous block it's 32
bytes next we have hash of the merkel
root which is also 32 bytes and we
discussed miracle trees in my video
about blockchain so I link it in the
description you can go ahead and watch
it
and so in blockchain technology we have
this concept of Merkel trees and the
Merkel tree is a data structure where
each where each level of the tree is a
hash of the previous level you can go
ahead and take a look at Merkel trees on
Google or you can watch my video on on
blockchain and so hash miracle root is
the root hash of such a miracle tree
consisting guys consisting of the
transactions in in this block so we take
these transactions we put them in a
miracle tree in Merkel tree and we take
the root value and so we put it in the
header as hash merkel root next we have
the time which is the current times
timestamp it is 4 bytes next four bytes
is the target and I think this is a very
interesting variable because this tells
us the difficulty of this current block
and to understand how this works how the
target works when you turn this
understand how nonce word so when we
mine a block when the miner mines a
block what does the miner action
do what the miner does is he takes or
she
so they take this hash miracle route
they append a nonce which they guess
they start from zero and so they say
okay nodes is equal to zero
I'll guess that nonce is equal to zero
I'll append it to hash marker route like
this I'll take the hash I'll get a
number from that hash and I compare it
to target if yes if my my hash that I
received here from appending nonce to
hash maraca root if this hash is less
than target I am done and I have solved
the puzzle and I get the mining reward
however if it's more if it's higher than
the target I have to increase the nonce
so I increase it from zero to one i
append one here two hash mark merkel
root and and i append one I'll calculate
the hash once again this hash will be
completely different from the last one
I'll compare it to out and then I'll I
compare it to target and I see is my new
hash less than target if it's less than
target I'm done congratulations
and I'll get my reward however if it's a
higher than target I'll need to increase
this to two and do the same thing so
guys as you understand the lower the
target the more difficult is it to find
a hash that is lower than this target
one second guys so the Bitcoin network
automatically adjusts this target so
that each each ten minutes we get a new
block so if the Bitcoin network notices
that it takes five minutes for the
blockchain to mine a new block it will
decrease the target until it takes ten
minutes and if for some reason it takes
one hour to produce a new block it will
decrease this target so now we've talked
about version hash previous block hash
map merkel root time target and non
so nones it is basically the solution to
this puzzle so when a miner has solved
this cryptographic puzzle or which is
just guessing the gnomes up appending it
to the Merkel the hash of the Merkel
root hash mark root which is basically
like the element on top of the miracle
tree and if this hash is lower than bit
the target then the miner is done and
he'll get the reward however if it's
higher the miner needs to increment this
do the appended calculate the hash
compared to target if it's lower he p1
if it's not lower you need to increment
this so this is what we mean when we say
cryptographic puzzle it's not really a
puzzle it's it's a guessing game where
you just start from zero here you append
it hash compare if it's less you you're
done if it's not you take plus one and
do the same thing so as you can see it's
not a puzzle it's a very dumb puzzle
you basically just guess and so the
first the first miner that gets the
correct knowledge and calculates at a
hash that is less than the target will
win will win the game and he'll get the
reward so these are the parts of a block
guys we have magic number block size
block header
transaction counter and transactions and
now I want to I want to highlight the
beauty of of the blockchain and how its
visible in in the header because we have
hash previous block here which is the
hash of the previous previous block
header and guys if I wanted to mess with
the with history
if I changed something in them maybe in
the transaction from years ago as you
can see this this hash would be
completely different because the
previous block header contains the hash
that the hash mark Mercury
which is the top value in its in its
Merkel tree of transactions and so if I
change a transaction in the previous
block this hash mark the route would be
completely different in the previous
block meaning that hash previous block
in this block would be completely
different so let's repeat that if I
change a transaction in the previous
block previous block would have a
completely different hash mark merkel
root which in turns would give me in the
new block completely different hash
previous block and other other nodes
will notice that very quickly that the
hashes are wrong and so these two
variables really really give the
blockchain the property that you cannot
alter old values and you cannot mess
with the history and that is why I think
this is so fascinating you have hash
previous block and hash merkel root this
represents the contents of the preview
of the current block because this is the
hash of all transactions basically and
this represents the hash of the previous
block and so if you would change a
single bit in any of the transactions in
the current block or in any of the
transactions in the previous block this
this would be completely different and
if you change something in the current
block this would be completely different
and in turn the next block when we hash
this the next block would have a totally
completely different hash previous block
and so this is why we can't really mess
with the history when it comes to block
Chevy ice so that's it guys I am really
curious about your opinion this this
video was a bit technical I mean we had
bytes and we had different fields did
you like this or was it too technical
leave your comments in the comment
section below and and yeah please give
me feedback on my presentation did you
understand this it would
really interesting to hear and if you
are a new viewer and you like technology
you like blockchain you like Bitcoin
aetherium you should definitely guys you
should definitely subscribe because I
myself am a software developer and I
post videos every single day and you
will find them interesting so that is
why you should subscribe guys so today
we discussed the contents of a block and
I'll see tomarow.

Comments

Popular posts from this blog

7 Days in Sri Lanka

About Squid Game

Paypal gift card