Learner's Guide 101: Blockchain and Crypto - How Does Blockchain Work? || 21-02-2022
Image source
Hi guys!
Good morning to you all. It's a new day in a new week, I believe we're all ready to Steem? Today, we continue our second lesson on Blockchain and Crypto. I hope the first lesson on cryptocurrency was helpful in somewhere? Today we will mainly focus on Blockchain, continuing from where we stopped in the previous lesson.
A central element of every Blockchain is the mining algorithm. Let's take the Bitcoin algorithm as an example. It is called SHA - 256 short form for Secure Hash Algorithm 256 Bits. It takes an input which can be anything: text, number, or even a computer file of any length. The output produce is call a Hash and it's the same length all the time - 256 bits in machine codes.
An input of 100% will give the same output of 100% every time. It is not random, but if you make a small change to the input of let's say 5%, the output will completely change.
It's also what's called a one way function. This means that if you only have the output you can not calculate what the input was. You can only guess what the input was, and the odds of guessing it correctly are 1 in 2256 which is quite impossible, in other words, it's secure.
Now that we know what the algorithm does, let me show how a blockchain works with a simple transaction example between Bildad and Jane.
We have Bildad and Jane along with their bitcoin balance. Bildad owes Jane 2 bitcoin.
In other to refund Jane's 2 bitcoin, Bildad transmits a message with the transaction that he wants to make to all the miners in the network.
In that message transmitted, Bildad gives the miners Jane's public address, the amount of bitcoin that he would like to transmitted, along with a digital signature and his public key. The signature is made with Bildad's private key and the miners can validate that Bildad, in fact, is the owner of the bitcoin and that he wants to make the transaction.
As soon as the miners are certain that the transaction is valid they can put it in a block along with many other transactions and then try to mine the block. To do this, they pass the block through the SHA-256 algorithm. The output must start with a certain amount of 0's in order to be considered valid. The number of 0's is determined by the "difficulty" which changes according to computing power available on the network.
In order to produce an output hash with the desired amount of 0's in the start, miners add what's called a nonce number into the block before passing it through the algorithm. Since a small change to the input completely changes the output, miners try random nonces until they find a valid output hash.
Once the miners are sure that the transaction is valid they can put it in a block with many other transactions and attempt to mine the block. This is done by subjecting the block to the SHA-256 algorithm. The output must start with a number of 0's to be considered valid. The number of 0's needed depends on what is called the "difficulty" which changes depending on the computing power available on the network.
Each miner has their own copy of the blockchain on their computer, and everyone trusts the blockchain that has the most computational work, the longest blockchain. If a miner modifies a transaction in a previous block, the output hash for that block will change, which will also cause all hashes after it is modified due to blocks being liked with hashes. The miner would have to redo all of the work in order to make everyone accept his blockchain as the right one. This, if a miner wanted to cheat, he would need more than 50% of the networks computing power, which is very unlikely. Network attacks like this are so called 51% attacks.
The model of running computers to produce blocks is called Proof-of-Work (PoW). There are also other models like Proof-of-Stake (PoS) which do not require as much computing power and are said to require less electricity, while being able to scale to more users.
And this is the basics of how a blockchain works!
Wow I like the fact that you use common examples which is understandable by everyone
Crypto is forever an interesting topic
Great post !
Thank you
My desire is to usually to ease understanding in what ever domain I write in
Over sabi girl
You just love me too much
It's so amazing how you bring out some basics to help steemians know little by little what a blockchain is all about. More grace!
Thank you my brother
You have been missing. I hope all is well
Lost my best friend at the start of the year. After the burial, my phone got bad and the whole of January was wasted. February was challenging as i tried to organize and assist newbies, but i finally got to my feet again with the academy. So i'm trying to joggle with steemit tasks.
I'll be fully engaged ones more before the start of next month
Sorry about that bro
It can imagine how challenging it can be losing a friend. My reputation could not allowed me to participate in the academy this time around
Your post has been successfully curated by our team through @shemul21. Thank you for your committed efforts, we invite you to do more and continue to post high-quality posts for a chance to win a valuable upvote from our curating team and why not be selected for an additional upvote later this week in our Top Seven.
Note: Always use the tag #fbcrypto to quickly access your post.
Thank youuuuu
I love you guys. I will take all the advice into consideration.