CRYPTO ACADEMY SEASON3 WEEK6 ASSIGNMENT POST FOR @stream4u BY @jimah1k

in SteemitCryptoAcademy3 years ago (edited)

4EBA3CF2-F6B7-4A84-B67B-034C550E2F3B.png
DESIGNED THIS MYSELF

Hello professor

It’s another week of this season CryptoAcademy. Last weeks lecture was about CeFi, DeFi and Yield a lecture I enjoyed very well this week’s lecture we discussed Blockchain. A very intriguing topic after reading the lecture notes and doing my own research I present my assignment for this weeks task. I hope you enjoy it.

8C22A2D7-FC7C-494D-B4D3-C644174833B4.png

Q1

What is Blockchain and What are the types of Blockchains / Explain in detail the types of Blockchain?


Blockchain
We all have been hearing Blockchain’ day in day out in the world of crypto currency’s but do we really know what it is?? to understand this term very well I am going to break it into two ‘Block-chain’, generally a block is solid stone or wood, this stone or wood is made up of certain smaller materials(DATA). So now if this block is linked to another block which is also linked to another block it can be referred to as blockchain.

In other terms blockchain is a series of blocks containing
Records of data which are stored and linked to each other or connected to each other. The data stored in blockchain are encrypted which makes the data very safe free from hackers and also can not be changed once it has been initiated.

How does the blockchain work??

The blockchain is made up three important parts without these parts the blockchain would fail to function. These parts are Block, miners, and nodes, I will be explaining each term so that we get to know what they are.

Block

In my definition of a blockchain I made mention of a block. Let’s think of a block as a big box where data files are stored in it also contains recently transacted transactions which can not be changed from the lecture notes given we got to know that each block contains three important factors that is Nonce, data, and Hash

  • the data that is stored into the block ( the information or transaction)

  • Hash which refers to a number usually in a 256 format which determines whether a block is invalid or valid.

  • Nonce is generated anytime a new block is created.

Miners

Whenever a new block is generated it is the responsibility of the miner to validate and check the block to be able to do this the miners solve difficult mathematical problems using super computers. In my above explanation of a block I mentioned that every block has its own unique hash any slight change that happens to the data of the block, it changes the hash of it so it has to be re-mined so that it will be able to fit in the blockchain(so that a new valid hash will be produced)

Nodes

Nodes are essential parts of the blockchain because whenever a block is re-mined as a result of some changes it is the responsibility of the nodes to check and update the current hash and also transfers information from one block to the other they are able to do this because they are connected to the blocks

8C22A2D7-FC7C-494D-B4D3-C644174833B4.png


What are the types of Blockchains


Blockchain is a very broad subject and can be grouped into four types namely; private blockchain, public blockchain, Consortium Blockchain and Hybrid blockchain I will go ahead to explain these types of Blockchains.

Private Blockchain

This type of blockchain is usually small in size which is run or controlled by an authority or an organization. Before you access the blockchain you will need permission from the central authority. Private blockchain is sometimes termed as a ‘permissioned’ blockchain just like every blockchain the blocks containing the data and information are validated by nodes, similarly miners can also solve complex mathematical problems to create new blocks.

Some examples of private Blockchains are Ripple (XRP) and Hyperledger. Why should you choose a private blockchain??, below are some importance of selecting a private blockchain.

8C22A2D7-FC7C-494D-B4D3-C644174833B4.png

IMPORTANCE OF PRIVATE BLOCKCHAIN


  • Faster Transactions

The main feature of a private blockchain is its small size, since it has limited number of blocks the validation of every block will be faster than the public blockchain which has plenty blocks

  • Total Control

Since this blockchain is controlled by an authority, they can decided on which nodes should do the verification of the blocks and also which nodes should grant users access to the network.

  • Less Energy Consumed

Private blockchain doesn’t consume a lot of energy this is also due to their small size organization unlike the public blockchain which is larger, so it consumes a lot of energy in mining.

  • Zero Chance of minor collision

In the private blockchain before a block can be validated it must fit certain standards so in a case it doesn’t fit the central authority doesn’t grant permission to validate. But in public blockchain the validators are not known so we can’t tell if they are qualified to validate a block or not so there is a chance of minor collision in the public blockchain

8C22A2D7-FC7C-494D-B4D3-C644174833B4.png

DISADVANTAGES OF PRIVATE BLOCKCHAIN


Surely every organization that has its importance also has its negative aspects, after talking about the importance I will also talk about the disadvantages.

  • Central Authority

We are made to believe that this system is a decentralized organization which is not true because the system runs or is been controlled by a central authority. Only certain nodes can be reached because the authorities restrict the users from certain nodes.

  • Less Secured

The security of the private blockchain is less secured and is prone to hackers I say this because in the private blockchain the codes of the organization are hidden from the users to see and to confirm its durability and also since the entire system is managed by central authority it can easily be manipulated.

8C22A2D7-FC7C-494D-B4D3-C644174833B4.png

Public Blockchain

This type of blockchain is the exact opposite of the private blockchain, this blockchain does not require any permission since it’s not controlled by any central authority hence earned the name ‘Permissionless’. The user are free to participate in the blockchain network the data stored in the blocks are very well secured they cannot be changed the nodes in the public blockchain also verify and validate the blocks. examples of a public blockchain system are; Bitcoin, Ethereum, and Litecoin and many more

Let’s look at some advantages or importance of this system but before that public blockchain is mainly used in for larger system unlike the private blockchain.

  • No restrictions

Since public Blockchains are purely decentralized, the are no restrictions on how many people who can join. But it’s free to everyone also you can assess every part of the system including the source code unlike the private blockchain system where the users are restricted from certain parts of the blockchain system

  • Decentralized

The public blockchain system is purely decentralized which is not controlled by any central authority but is run by the people. Because of that the users are free to do what they want without worrying about any central authority.

  • Transparency

This system is such that users from all over will be able to see the transaction details at anytime with this no one can lie about anything this helps improve transparency among the users.

  • Security

In terms of security the public blockchain system is very secured as compared to the private blockchain because in the public blockchain there are a lot of nodes responsible for checking the security of the system but in the private blockchain the nodes are limited.

8C22A2D7-FC7C-494D-B4D3-C644174833B4.png

DISADVANTAGES OF PUBLIC BLOCKCHAIN


  • Consumes a lot of energy

This type of blockchain consumes a lot of energy in terms of mining, super computers are required to solve complex problems so in doing so they consume lots of energy.

  • Minor Collision

In the public blockchain system there is a chance of minor collision because there isn’t any central authority to check the validators to see if they meet certain standards before they can validate. In this system no one knows they validators so there is a chance for a minor collision.

  • Slow network

Since the size of the system is large there are many nodes connected to the blocks, thereby making the rate at which transaction are validated very slow as compared to the private blockchain.

8C22A2D7-FC7C-494D-B4D3-C644174833B4.png

Consortium Blockchain


This type of blockchain system has some characteristics of a private blockchain and a public blockchain, these characteristics are this system is not controlled by any central authority, only users in the blockchain can assess the system like the source code.

In this blockchain system three sets of nodes run the system it has nodes that starts transactions, it also has another sets of nodes that will receive the transaction and the last set of nodes that will check and validate the transactions made. Below are some advantages and disadvantages of this system.

ADVANTAGES OF CONSORTIUM BLOCKCHAIN


  • Consumes Less energy

This type of blockchain system also consumes less energy just like the private blockchain, mainly because of its small size.

  • Faster Network

The way the nodes are structured in the network it makes validations of the transaction very fast and also this type of blockchain can handle higher number of transactions at a given time.

8C22A2D7-FC7C-494D-B4D3-C644174833B4.png

DISADVANTAGES OF CONSORTIUM BLOCKCHAIN


  • Not Decentralized

This is because not everyone can access the systems unless you are a user so let’s say I want to check the source code of the platform I can not check because I am not a user of that platform.

  • Restrictions

Since it is not decentralized and controlled by central authority certain nodes restrict the user from accessing certain aspects of the network.

Hybrid Blockchain


Just like the name ‘Hybrid’ means two or the combination of two, hybrid blockchain also has some characteristics of a private blockchain and a public blockchain. This blockchain will allow the user to establish his private blockchain and also a public blockchain system and given them the power to choose which part of the system they want to show to people. The node in this system are not known to anyone unless a transaction is carried out a certain node that’s only when the identity is revealed.

Let’s look at some advantages and disadvantages of this type of blockchain system.

ADVANTAGES OF HYBRID BLOCKCHAIN


  • Consumes less energy

Same as the private blockchain, consortium blockchain Hybrid blockchain also consumes less energy and also the cost of each transaction is very low.

  • Faster Transactions

The smaller size of this platform makes it perform faster transactions because the nodes are not many so when it receives the transaction it just quickly moves to the next node and to the next.

  • Scale-lability

The Hybrid blockchain can handle relatively high number of transactions within a short period of time at a fast rate.

DISADVANTAGES OF HYBRID BLOCKCHAIN


  • Central authority

Hybrid blockchain is not decentralized as they have made us to believe because the central authority can restrict the users from certain parts of that blockchain.

  • Manipulation

Since the platform is controlled by a central authority it can be easily manipulated to suite their personal desires

8C22A2D7-FC7C-494D-B4D3-C644174833B4.png

Q2

What are the benefits of blockchain

E3F5734A-D15F-421A-8965-65181B7D721D.webp
source


Blockchain has provided a lot of benefits in the world of crypto currency’s here I will be taking you through the benefits or importance of Blockchain.

  • Immutability

When we say something is immutable what we mean is something that can not be changed, one of the benefits we gain from blockchains is that when data is stored in a block it can not be changed by anyone. This feature helps prevent scammers from falsifying any data.

  • Transparency

The next benefits we gain from blockchain is transparency, this means every transaction that has been carried out in the blockchain is made available to very user of that blockchain you can verify it by your self and also other users can also verify it.

  • Security

This is the most important feature of the blockchain because without security our funds will be lost. The blockchain uses special cryptographic algorithms that encrypt the data which comes with a key called the decryption key which will be given to the receiver so that he alone can decrypt it. This Also prevents hackers from getting the data in the blockchain.

  • Traceability

This feature of blockchain helps the users to be able to trace a transaction which has been carried out sometime ago this includes the amount a user sent the date and other important details will be stored in the blockchain incase any user wants to verify it for himself.

  • Efficiency

The blockchain has improved greatly on the speed our transaction takes before they can executed someone can send 1BTC to the another user somewhere around the world in a matter of seconds. This has improved lives.

8C22A2D7-FC7C-494D-B4D3-C644174833B4.png

Q3

Explain Blockchain Distributed ledger


From the lecture we have got to know that in a blockchain the blocks contains the data, this data isn’t supposed to stay in the blocks for ever but rather it is meant to be shared or distributed across the entire network. This is done by the nodes they transfer the information from one node to the other. With the help of distribution ledger, in a case where the block is re-mined the hash of that block is changed so it has to be validated, when it is validated the new block is sent to the nodes. There are certain characteristics of a distributed ledger or certain aspects that make it very important in blockchain, let’s look at some of them.

Distributed ledger makes it impossible for the users to change the data it is carrying. This feature prevents hackers from falsifying any information in the blockchain.

A distributed ledger is very secured because the data is encrypted using cryptographic algorithms, data can be encrypted in to a alphanumeric characters called hash.

A distributed ledger is very transparent because all the transactions can be verified by anyone at anytime all you have to do is use the blockchain explorer and you will get details like the date, time, amount and many more.

5EB55283-1B91-4ADE-A5A7-7636FD756BD7.png

Q4

What Is Blockchain Double Spending and how Bitcoin handles this problem?


Any time a system is developed people always want to find means of cheating the system just like this steemit ecosystem people try to cheat the system by using double accounts just to get more votes which is not good in the blockchain too people spend more than they have in their balance or lets say you have only $10 in your balance but you spend $20, that’s double spending. How do hackers perform double spending?? According to my findings double spending was common to BTC before they implemented the cryptographic algorithm, what they do is to send the $10 worth BTC to an address and wait whiles the network is verifying his transaction another $10 worth BTC is initiated again this type of double spending is termed as Race attack.

There are various forms of double spending some of them include; Vector 76 this type of double spending involves the hacker creating his own assets which are not in the market and sending it to people

Finney attack this type of double spending is when a miner mines the block and makes a duplicate of the transaction and sends them to people

how Bitcoin handles this problem?

From my above explanation of how double spending works we found out that the hacker will send multiple transactions to the blockchain (Attack double spending).

what Bitcoin did to stop this illegal activity is to introduce distribution ledger feature what this feature does is before a transaction can be confirmed it has to be validated and verified. So let’s say a hacker tried to cheat the system may having a balance of $10 and sends it to a certain recipient address 4 times. Technically what happens is that before it can be added to the block the validators has to first check whether the amount he is spending can be afforded by the spender(does he have that amount?). If it is validated the transaction will go through and it will be recorded in the block.

After confirming that transaction it moves to the next $10 and will check the account balance of the sender if he has less than that amount it will be rejected. And tell the user insufficient balance

And that is how BTC, was able to stop double spending in the blockchain network.

5EB55283-1B91-4ADE-A5A7-7636FD756BD7.png

Q5

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.


Block hashes in a blockchain helps secure and protect data through encrypting them using hash functions. Which brings me to the question what is a hash? A hash is a cryptographic function that receives data from the users and converts the data received into codes and the output of this codes are alphanumeric characters of fixed length. Which are very likely impossible to Memorize. An example of a hash generator is SHA-256 which I will be using as an example. To illustrate a hash

First of all you can visit the SHA-256 by click on it.

01F9FC5C-5491-4E20-AE16-42569AE021C0.jpeg

when I opened the website I typed ‘Jimah1k’ and it produced this hash as can be seen in the screenshot above

f125547095257bdd324a8c1a36810be45c73d6728ad051e35e2f42be52ae1cd7

According to my search the smallest change in the data will result in a different hash so to prove this statement I went ahead to alter the ‘Jimah1k’ to ‘jimah1k’

96FCC5B5-5187-4DAE-89D0-56AAC77290E1.jpeg

So when I pasted ‘jimah1k’ to the SHA-256 website i had this hash

31f3e52b45569d81ad08b9775b6c5000000408a8b6f8b93e4047aa89c4e56bb9 Which is completely different from the first one I had which proves that changing the capital ‘J’ to ‘j’ changed the entire hash.

Now let’s go to the Blockchain Demo to explore and see for ourselves.

When you click on the website you will notice or see a box like dialogue(this is represents a block in the blockchain) they are four in number

D29950CD-A067-47D3-A421-6AD471193888.jpeg

first Block labeled Block :1, Nonce: 11316, Data(which is empty), Prev: 0000000000000000000000000000000000000000000000000000000000000000 , Hash: 000015783b764259d382017d91a36d206d0600e2cbb3567748f46a33fe9297cf

The next Block you will see it Block 2, look closely here from the previous hash block of 2 you will see the hash block of 1 just below the hash block you will see the original hash of block 2 which is 000012fa9b916eb9078f8d98a7864e697ae83ed54f5146bd84452cdafd043c19 The same thing happens to all the blocks if you look at the previous hash block of block 3 you will see the hash of block 2 in that order.

5EB55283-1B91-4ADE-A5A7-7636FD756BD7.png

Adding data into the blocks

Adding data or information into the blocks changes the hash of that particular block as it can be seen above when I changed the capital J to small j the hash changed completely so here to it will also change so we will have to mine and get the correct nonce value.

80EF1462-0A2F-4754-95BA-91965C9680B4.jpeg

In this case I will be adding ‘steem on buddy’ to the first block and see what happens I also added the best, steem and ghana to the other blocks respectively. When I added the first word in the first block it changed the entire block chain color from green to red and also I observed that the Nonce value changed not for only the first blocks but for all the blocks as can be seen above

21FA9805-FFCA-4318-A35A-E5DD1E98A778.jpeg

Another important thing I noticed was the hash didn’t start from 000, I learnt that for a valid hash in a blockchain it has to start with the 0000. As can be seen in the above screenshot. But the hash of the first block is 1866d3e741a7c2c8ba5f93d650a58f1cf64bc49eebb48b83061ad1f039d93e9e Which means it’s an invalid Hash this also means the Nonce is wrong so what I have to do is to edit the Nonce value until the hash starts with 000 so first I will edit the Nonce value of block 1 from 104659 to 113456 and also edit the Nonce value of block 2 from 35230 to 37130.

81A7FB47-31FC-4F4A-BEAA-63862122B55F.jpeg

When I did that the hash of block 1 didn’t start with zero same as the block 2 but rather the new hash of block 1 was aa743e62e6fb564ee7903a6966c14c0f4674db9290c5b94f58a84c9f1a8a9545

And also block 2 also produced an invalid hash of 7bf279068edb8ff31a3545bdc4ca84fe94066db3e11814d436badabde5c1ba5b Since they are both invalid hashes I have to try again and again until I achieve the right hash to prevent wasting of so much time I will just click on the mine technical what happens is that when I click on the mine the computer solves that complex mathematics to produce the right nonce value

E3E00B3B-2D1F-4718-AB60-E3F3E720B625.jpeg

When I clicked on the mine it solved the Nonce value for block 1, and 2 so the right Nonce value for block 1 is 13849 with a valid hash of 0000e992c68da7e50542686dba51a68df7df08f26eb7fe2920ff804407a5ed66

For block 2 we have a correct Nonce value of 13253 and a valid hash of

0000588724519c21553e68c54dceac9d9b9523f9f81c245c6edfc2b6ff29f114

The same thing implies to the rest of the blocks.

3B086B0B-D0CE-4242-AF14-9EE84D6F1FF3.jpeg

5EB55283-1B91-4ADE-A5A7-7636FD756BD7.png

Q6

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


I will be talking about the race attack I think I an example of a race attack earlier but here I will explain further. Race attack is a type of double spending where by the initiator of the hack sends an assets let’s say Btc worth $100 to another user who is paying $100 for the BTC this same hacker also sends the same amount worth BTC to different users. If the second user confirms the deal without waiting for the miners to confirm the transaction the hacker would have spent twice of his BTC.

Also if the user who is going to pay the $100 confirms the payment the order transactions the hacker placed on the blockchain would return a wrong hash hence would not be validated.

Someone has ever tried to do that to me before it was in a paxful account he wanted to buy my BTC so we opened trade he marked his trade paid i didn’t wait for confirmation and released the BTC when it happened I couldn’t get my assets back so Customer care on the paxful advised me to be careful and wait for confirmation before I release my coins.

Limitations/disadvantages of Blockchain.

Like I said before every system has its positive sides and negative side lets see some of the bad aspects of the blockchain.

  • Prone to Hacks

The blockchain being decentralized there are a lot of bad people who the systems since they are no restrictions on those who can join also no verification are needed so a lot hackers come into the system to steal peoples funds.

  • Consumes Energy

This is due to the powerful super computers that are used to solve for the nonce value, those super computers consume lots of energy and also the cost that comes in repairing them is very large and not everyone can afford them.

  • Slow Network

This is because in a blockchain network there are a lot of nodes that are linked to each other this negatively affects the speed of the system and also transaction come at a very high cost due to maintenance of the network.

  • One path transaction

When I say one path transaction I mean the feature of the blockchain to move in one direction hence can not be changed once it has been initiated. Assuming the user makes a mistake and moves the funds to a wrong address the assets are lost forever because it can’t be reversed an example is steemit here once you send your steem to a wrong user name your steem is gone forever. It is advised you check well before you send.

5EB55283-1B91-4ADE-A5A7-7636FD756BD7.png

Conclusion


I must commend the professor @stream4u for this wonderful lecture I have really learnt a lot, I never knew the blockchain was very broad but with this lecture I found out that the blockchain is further broken into four types namely the private blockchain, public blockchain, hybrid blockchain and the consortium blockchain I learnt some of the advantages and disadvantages of blockchain like transparency, security and many more for the disadvantages consumes a lot of energy due to the super computers used in mining.

Double spending in Bitcoin and how it is stopped by distributing ledger feature. Which is very good because I feel to victim of the double spending.

I also learnt how hash functions and block hashes work, what was more intriguing was how the smallest change in data can affect the hash output of any data it is also very good to note that a valid hash in a blockchain starts with 0000 whiles an invalid hash starts with a letter.

Thank you professor for this wonderful lecture. Hope to see you in the next lecture.

Please note all images that are not sited are screenshots from my phone and laptop

5EB55283-1B91-4ADE-A5A7-7636FD756BD7.png

Sort:  

Hi @jimah1k

Thank you for joining The Steemit Crypto Academy Courses and participated in the Homework Task.

Review Visit Level
Task Remark
Comment
Guidance, Feedback, Suggestions
Verification (Done, Hold)
Total Grade
First
Completed
The Presentation of the Task is Good. Mentioned information has some good Content. All topics were explained very well.
In Blockchain Practical + Theory, you explain Blockchain well and screenshots are provided also good. However, the information is not cleared for how Block Hash works, and also the explanation is not cleared for what if any middle of the block gets changed? Practically you tried well but what did we understand from this Practical, that theory information need to be more clear with the correct explanation. The rest of the task is good.
Done
7/10

Total | 7/10

‘J’ to ‘j’

Yes, it will give a different hash but still, the hash length is the same which you just mentioned above.

Your Homework Task verification has been done by @Stream4u, hope you have enjoyed and learned something new.

Thank You.
@stream4u
Crypto Professors : Steemit Crypto Academy

#affable

Coin Marketplace

STEEM 0.28
TRX 0.12
JST 0.032
BTC 62302.26
ETH 2994.60
USDT 1.00
SBD 3.96