Crypto Academy Season 3 | Advanced course : Let's Open The Blockchain.



This Thumbnail Created From snappa.com


Hello All,

Welcome to Steemit Crypto Academy Season 3, My self @stream4u, I am from India, and one of your crypto professors. I welcome you all to my class.

Previously we learned CeFi, DeFi, Yield and understood why they need and their uses.

Now let's see and understand the Blockchain.

What Is The Blockchain?

The Blockchain ⬛️🔗⬛️🔗⬛️, in simple terms we can say that the one Block ⬛️ connected 🔗 with the next Block ⬛️ and continue the same in a sequence is a Blockchain, so what's the Blockchain Technology?

A simple demonstration of Blockchain Technology is Google Docs, instead of copying or transfer process the sharing a google doc file 📄with multiple people at the same time create decentralize distribution in which everyone gets access to the file at the same time. whoever modifies the file will be recorded in real-time and changes will be transparent to everyone.

Similar to it the Blockchain Technology is a Database 🗄 which stores the multiple Blocks in an encrypted format then creates a chain by connecting them to the next Block each other.


How Blockchain Works?

The Blockchain is processed in three parts Blocks, Nodes, and Mine.

Block.

The Block.

The Blocks are files where data is available on the network and it is permanently recorded. The Block contains all recent transactions and once Block is completed it allows the next Block on the Blockchain.

There are multiple blocks that can be found in the Blockchain but each Block has below three important things.

  • Data which is available into the block.
  • 32-bit number which calls as a nonce, it is randomly generated when a new block is created. Then it generates the Hash.
  • The hash is a number in the 256-bit format and starts with some zeros, these zeros indicate whether the Block is valid or not.

Each Block has a unique Hash and Nonce, but it also contain a previous Block Hash to maintain the Blockchain.

Nodes.

As we know that the most important thing in Blockchain is Decentralized in which anyone can take a participate in this Blockchain. No any computer can own the chain, it is distributed via the node which are connected to the chain. Nodes are actually computers that maintain Blockchain and keep it function smoothly.

Each Node has its own copy of the Blockchain and the network approves the newly mined block to make sure the chain is verified, trusted, and updated.

Miners.

Mining is a process through which Miners create new blocks into the Blockchain. Miners use some special software to solve the maths.

If any changes are made into the Block then it requires to be re-mined because any micro changes into the Block will change its Hash so it requiress to re-mine to set the acceptable Hash. Also, as we know that each Block has a previous Block Hash, then at the time of Re-mine any Block then all next blocks are needed to be Re-mine.

All Nodes will accept the changes after a successfully mined and then the miner gets some amount of coin as a reward.


Blockchain Vs Database.

Blockchain and Database are the same?

Just like a Database, the Blockchain works on a distributed ledger but it is not controlled by the central authority. The Leder stores information in a data format called a Block.

The Ledger spread to multiple computers and across the world and anyone can run it with the help of a computer and internet connection. The data into the Ledger is updated in real-time, and once data is added it cannot be changed like a database.

The Blockchain keeps information permanently in a Block and each block is labeled with hash value with previous hash to provide security.

The database is the central Ledger where only the administrator, owner, Authorised group of people can access to the database and these are given rights to read, write, delete or update. The database is a centralized server where all data is stored and here is the problem with a centralized database when the system is compromised the entire data will be at risk and can change the ownership.

In Blockchain, any node is getting problem the operation still function smoothly by the other Nodes in a network.


What is encryption in Blockchain?

The basic information about encryption converts the plain text into the system language which can not be read easily and also can not be changed.

The encryption in Blockchain is math that is done through the mining process, let's understand how it works.

Hash Function in Blockchain.

A hash function takes any input it could be like text, number, media file, and depending on the hash which using it gives an output in the fixed length.

In the above diagram, we can see the basic how the hash function works, the output which comes in a fixed length is called a Hash.

The input can be small or big but Hash output will remain in the same fixed length. To understand this in more will see the SHA-256 which is used by the Bitcoin blockchain.

Hash SHA-256.

SHA means Secure Hash Algorithm. Anders Brownworth is a developer who created a very nice simulator to understand the Hash, Block, Blockchain we will be going to use the same. You can find this simulator on SHA256 Hash

We have given input Steemit Crypto Academy and we receive below output in SHA-256.

45a445061c91a142adec1ea9be2b677832813e6d3b8c93e8bb1c6b12b8c4f492

Now I have just change the letter type for the first word steemit Crypto Academy, here I change the letter S to s and the output changed, now we received the below output.

a3826579ef4aaff84cc7df02cbbff6912b7489f1e040f26832d6bc3ed6343566

As mentioned earlier even there is a small change into the Block the Hash will get changed.

As I said the input can be small or big but Hash output will always remain in the same length, below is the example.

Even for the big message, we received the same length of SHA output.

3a5261d3bbf1d18006a2d9c43aa746ce4876173e905223d08726b8823fb7ebc4

Hashing is the one-side functioning process hence there is no way to get a text from the generated Hash.

Block Hashing in Blockchain.

Now here we will understand how hashing gets applied to one Block in Blockchain, also see where miners role comes as we know that Miners are performing the process to build Block into the blockchain.

Hash - 0000f727854b50bb95c054b39c1fe5c92e5ebcfa4bcb5dc279f56aa96a365e5a

The above is an example of how a block looks like, it has a number, data section, Hash output which is connected to the Nonce.

Now please concentrate on the output hash, you can see there are some zeros at the starting point, as I mentioned above the output always come with zeros at the starting point and these zeros show whether the block is valid or not. Now we can say this is a valid Block because it has zeros at the starting point.

I will try to add some data and will see what happens.

Hash - 5100ccbad9ce7a40f505e4f0111126d1751f42cfad899c8fbb646c34e345cec5

Now we got a completely different Hash value but the length is the same however this Block is not valid because it does not have zero at the start.

To make this Block valid we will focus on the section called Nonce, which means Number Only Used Once.

Nonce provides you the number basis on data which will give you the valid hash start with zeros then the Block becomes valid. So, here we need a valid Nonce number which gives us a valid Hash for the same input data, what happens if I try to change the Nonce number manually to get the valid Hash, see below.

Hash - b14f2004b1f821a117c3a561c3436d3a512979b47c8e99cba2769ab35fa00c74

Hash - d71b1c6b65f361535596e552cb0211774d75fd3b1ae34d65d51ab3a098fc0e58

Hash - 5162bb44c9416e9286b2c6f1567aa0bbce87a5e13628ffed04501d63db1eb76f

You see I tried to give multiple numbers in Nonce but I did not get a valid Hash with zeros at starting and still the Block is invalid. As we know that the Block time in Bitcoin is expected 10 minutes.

Once the Miners successfully solved this then they add this block into the blockchain and marked it as the last Block.

Now, let's click on the button Mine to see what we get here.

Hash - 00007b617cdf283b2c0b34a4d88259bc2e59ff6ee5e8b399761bccb8865f9631

Wow, I did it. I have mined this Block and make it a Valid Block. The Input data is the same, after clicked on Mine button it has generated a new Nonce as per the Data and accordingly gives a correct Hash starting with zeros.

If I start manually from 1 how much time it will take me to reach 45855. In the Mining process, it generally starts from 1 and keeps increase numbers until it gives a valid Hash but since it using the computing power so the Block gets Mined in the expected time.

These are all important parts of Block Hashing.


51% Attack On Blockchain.

Have you seen something like below,


Source

So, what is a 51% Attack?

As we know that all miners work in a sequence and each transaction is broadcast to all Nodes. But when a single person or a group of people put 51% hashing power or we can say computing power which means they trying to take control on the total network mining power.

As per the process when a miner builds a block then it broadcast that block to all miners in the network. According to the data which is available in the Blockchain if Blocks are valid then the only transactions are accepted.

But in 51% attract when corrupt miner takes majority control on mining power, they did not broadcast the Blocks hence two chain gets created, then with the help of 51% hashing power, they keep adding new block faster, the Blockchain design in such way that longer chain will survive and seen as legitimate.

In 51% of attacks, the attackers block other miners to validate and confirm the transaction, they block other miners from mine coins within the network, the attacker only builds his block as after all he is 51% mining power which means more than 50% chances he got in mining.

In 51% of attacks, the attackers can also do a reverse transaction for Double Spend which means if A has paid 1 BTC for XYZ then the transaction will reverse, and result in A gets 1 BTC back with the purchased item XYZ. Another example like if A sends 1 BTC to B then reverses the transaction and again A got 1 BTC which he sends further to C.

Performing a 51% attack is not so easy as you can think what the cost it will require to set up the hardware and generate more than 50% Hash power.

(All images in this post are created by me From snappa.com to give you a graphical view, screenshots are taken from Blockchain Demo which is made by Anders Brownworth.)

Homework Task.

Hope you liked this course as we see the inside view of Blockchain, here we learned how Blocks work in a blockchain, how Blocks are identified, how Hash generates.

While making a Homework Task kindly make sure that this is the Advance Level course hence before start to work on this Homework Task, I will request first to understand the questions and accordingly work on it, research more, study and understand it first then prepare a task with the details and own words.

You also need to focus on a presentation while working on a Homework Task, make sure you submit the homework task with a good presentation, try to use markdowns to highlight the important note in your task.

The title for the Homework Task will be in the format, Crypto Academy / Season 3 / Week 6 - Homework Post for [@stream4u] …....

Below are the questions which you need to explain through your Homework Task.

  1. What is Blockchain and What are the types of Blockchains / Explain in detail the types of Blockchain?
  2. What are the benefits of blockchain?
  3. Explain Blockchain Distributed ledger.
  4. What Is Blockchain Double Spending and how Bitcoin handles this problem?
  5. Practical + Theory, Visit Blockchain Demo and check section Blockchain, then explain in detail how Blocks Hashes Work in Blockchain, what will happen when any middle of the block gets changed, try to give screenshot for each possible details.
  6. What Is Race Attack in blockchain? OR What Is Finney Attack in blockchain? OR What Is Vector76 Attack in blockchain?
  7. Limitations/disadvantages of Blockchain.
  8. Conclusion(Overall understanding of Blockchain.).

Homework Guidelines.

  • Make sure you submit your Homework Task in the Steemit Crypto Academy community.

  • Users having a reputation of 60 or above, and having a minimum SP of 500(excluding any delegated-in SP) are eligible to partake in this Task.

  • All information contained in a Homework Task should be your own as plagiarism will not be tolerated.

  • Use images from copyright-free sources.

  • Add tag #stream4u-s3week6 & #cryptoacademy in your Homework Task and should be in the first two tags. Tag correctly otherwise the Task will not get visited in a sequence.

  • Add me as @stream4u somewhere in your Homework Task.

  • This homework task will run from 02 August 2021 To 07 August 2021 Till Time- 11:59 PM UTC, make sure to submit before the time ends.

For any concerns, doubts, questions on homework tasks, you can ask me in the comment section below before making Task.

Thank You.
@stream4u
Crypto Professors : Steemit Crypto Academy



Sort:  

Excelente cátedra profesor la volveré a leer para comenzar con la investigación..

Thank you professor @stream4u for the interesting lecture, I want to start this week with your assignment. However, in Question 6, are my to explain all the three or just one out of them?

just one out of them.

Khatarnaaak explained.....

Professor, in the question number 6,

What Is Race Attack in blockchain? OR What Is Finney Attack in blockchain? OR What Is Vector76 Attack in blockchain?

Does it mean that we only have to answer one?

Thanks for the wonderful lecture professor @stream4u. I have made my entry and I present below the link to it. Thank you

https://steemit.com/hive-108451/@fredquantum/crypto-academy-season-3-week-6-homework-submitted-to-stream4u-or-let-s-open-the-blockchain

muy interesante toda la información que compartes en esta publicación amigo... gracias.

 3 years ago (edited)

Hi professor @stream4u here is my assignment entry https://steemit.com/hive-108451/@mccoy02/crypto-academy-season-3-week-6-homework-post-for-stream4u-open-blockchain

Hi professor @stream4u i've made the necessary correction