Crypto Academy / Season 3 / Week 6 - Homework Post for professor @stream4u by @salma78

in SteemitCryptoAcademy3 years ago

str.jpg


Introduction

Hello everyone, I welcome you all once again to this week's steemit crypto Academy courses. I am here to write and submit my homework task posts assigned by professor @stream4u. It's been a privilege to join his class once again another week. I have read and understood the lecture about Let's Open The Blockchain and I would like to submit my response to the assignment below.

salma.jpg


What is a Blockchain?


salma.jpg

image.png

source


A Blockchain is an interconnection of Blocks with each other that saves or records information such that it becomes impossible for hackers or fraudsters to have access to the information. In other words, it is a digital ledger of transactions where transactions are shared within an entire network of computers on the blockchain by duplicating the transaction executed. Blockchain is a decentralized database in which different participants are engaged and every participant receives a duplicated of the transaction made anytime a transaction is executed.


image.png
source


This system works with a technology known as the Distributed Ledger Technology (DLT). The DLT database technology functions with the use of hash in recording or saving the transactions. These hash codes make each transaction unique and secured to the extent that if a hacker trie to hack the system it won't be possible unless the hacker alters all the blocks in the chain across the distributed ledger networks and this is impossible to do. Blockchain is comprised of four kinds of components namely; Block, Nodes, Miners, and Chain.

  • Block: Blocks refer to files in which data are stored permanently. It mostly contains some parts or all of the previous information (transactions) recorded earlier. Blocks are hackable and information or data stored on a block cannot be changed or deleted. Blocks usually give the chance of a new block in the blockchain when the previous block get complete. Blocks generate a 32-bit number known as a nonce when it is being created and also possess the unique 256-bit characters comprising of alphanumeric and this is termed as the Hash. The Hash is what makes the block to be more secured and safe from hackers.

  • Nodes: The set of computers connected together within a blockchain and works together in mining, creating, and validating blocks are termed as the Nodes. A copy of the distributed ledger is sent to each node and they can all save a copy down. They usually work together in a consensus via communication, confirming transactions, storing copies of transactions, and also creating a new block within the blockchain.

  • Miners: Mining of blocks in cryptocurrency refers to the use of high-computational tools in solving complex mathematical computations in order to validate hashes of blocks within a blockchain. The individuals involved in this process within the blockchain network are termed, miners.

  • Chain: The Chain is also referred to as the link and this includes the nonce number and the 256-bit Hash of a block within the blockchain network. The new blocks usually contain some part or all information of the previous block as I already stated earlier.


The Types of Blockchain

There are four different types of Blockchain and I would explain each type below here in my article.


image.png

source


Public Blockchain: Public blockchain refers to the type of blockchain that enables every individual to have access to its network via an internet connection without any hindrance. the Public blockchain is widely used in the crypto world as compared to the other types of blockchain. Public blockchains are decentralized in such a way that the blocks or transactions executed cannot be changed within the network. Examples of public blockchain include Ethereum, Litecoin, and Bitcoin.

The Advantages (Pros) of Public Blockchain
  • Free to Access: The Public blockchain does not have any restriction and as such grants everyone free access to utilize the network.

  • High-Security level: Public blockchain provides strong security on its network through the use of the cryptographic hash function. Public blockchain does not permit the altering of transactions within its network and as such making it impossible for hackers to hack any data or information of the transaction.

  • The True Decentralized Structure:The nodes within the public blockchain system would all have a copy of the distributed ledger because of the fully decentralized nature of the system.

  • Greater Transparency: There is a greater or higher transparency level in public blockchain whereby no one possesses the power or control over anything within the network. Public blockchain publicizes every information about a transaction to all users connected to the network.

The Disadvantages (Cons) of Public Blockchain
  • There is a high cost involved in maintenance: The Public blockchain is costly in its maintenance especially as the number of users increases within the network. There is a high cost of electricity of transaction fees because of the highly-powered computational tools used in mining blocks in the public blockchain.

  • The Public blockchain system begins to operate slowly especially when the number of users available on the blockchain network increases. This reduces the scalability rate of the blockchain network.

Private Blockchain: Unlike in the case of the public blockchain where there was no restriction regarding the number of connecting nodes on its network, the private blockchain is highly restricted with a preferred number of connecting nodes within its network. Also in the private blockchain system, a user is allowed to be connected only when the administrator permits the user to join the network by accepting the invitation of the individual. Over here the administrator is in charge of everything and can even alter the information provided within the network.

The advantages (Pros) of private Blockchain
  • Increase Scalability: Due to the small nature of the private blockchain network, this provides faster transactions per second and is also energy efficient as well.

  • Improved Privacy: There is high privacy within the private blockchain where only permissioned parties can have access to the transactions on the blockchain. The private blockchain is a permissioned blockchain in which the administrator is only the one who can access transactions on the blockchain.

The disadvantages (Cons) of Private blockchain
  • The Private blockchain network is not decentralized and this is because of the limited access of the number of nodes that can operate on the blockchain network.

Hybrid Blockchain:
The hybrid blockchain is the use of the combination of the public blockchain and the private blockchain together. The hybrid blockchain operates in a manner whereby a private blockchain is executed to refrain users (non-connecting nodes) to have access to the authorized data and a public blockchain is also connected to it to permit the connected nodes in storing the data that is accessible to the connected nodes. The hybrid blockchain is transparent and highly secured although they are not accessible to all. The hybrid blockchain is customizable in a way that the connected nodes decide the kinds of transactions to make know to all or who can have access to the blockchain.

Advantages (Pros) of Hybrid blockchain
  • Protection from 51% attack: Hybrid blockchains do not permit the access of hackers to the network due to high-security levels and as result, they are immune to the 51% attack.

  • Low cost of Transaction: Transactions performed on hybrid blockchains are very less costly as compared to the other types of blockchain. This is so because of the low number of nodes required in verifying transactions within the network.

  • Improved Privacy: Hybrid blockchain provides a closed ecosystem network whereby information about transactions executed by organizations does not get exposed to the public. They work in privacy so as to prevent the leakage of any information.

Disadvantages (Cons) of the Hybrid blockchain
  • Because of the restriction involved in the network, this denies the decentralized nature of the blockchain network.

Consortium Blockchain: The consortium blockchain is just the same as that of the hybrid blockchain but the difference is that the verification of blocks and transactions are executed by different consortium blockchains connected together. The Consortium blockchain also operates with the combination of both the public and the private blockchain just in the case of hybrid blockchains but with the difference stated above. The consortium blockchain is harnessed by multiple organizations in its governance and also it is a permissioned network. This means that in consortium blockchain, multiple organizations or individuals decide on the governance of the blockchain network and not a single entity as we saw in the case of private blockchain. Consortium blockchain permits users or organizations to work together and achieve equal rewards.

Advantages (Pros) of Consortium blockchain
  • Transaction Cost is Low: The consortium blockchain platform always grants fewer transaction fees to transactions executed on their network.

  • Free from 51% attack: Due to the high-security level provided by the consortium blockchain network, the risk of 51% attack is denied or protected.

  • The Use of Regulations: Consortium blockchain network provides regulations in its operation. All connected nodes must comply with the rules of the network before they can be allowed or permitted to work on the platform. Consortium blockchain enables companies to work together as a team and therefore yield higher efficiency.

  • The consortium blockchain provides a higher and faster speed of transactions output as compared to that of the public blockchain. This helps to provide a better experience in consortium blockchain.

Disadvantages of Consortium Blockchain
  • The addition of private blockchain in consortium blockchain makes it to be decentralized. The private blockchain makes some data accessing to be restricted.

salma.jpg

The benefits of blockchain


salma.jpg

The following points enumerate some of the benefits of blockchain;

  • First of all, blockchain provides low-cost transactions. The decentralized feature of blockchain helps to reduce the cost involved in transactions because there are no third parties engaged as in the case of the centralized system where third parties involved in transactions are also paid (commission). The removal of the third parties involved helps to reduce the cost of the transaction fees.

  • Secondly, blockchain provides greater transparency. There is high transparency in the blockchain network due to the decentralized system of the network which permits nodes to have full access to all blocks generated in the blockchain network.

  • Again, blockchain provides a higher security level on transactions. Blockchain employs the use of alphanumeric codes called Hash and also 32-bit numbers termed Nonce in providing a high level of security to transactions and blocks within the network. Blockchain records data or transactions that are not changeable with end-to-end encryption which aids to protects the transactions from hackers and frauds.

  • Furthermore, blockchain provides high speed of transaction processes. Blockchain processes transactions in seconds or less than that due to the decentralized nature where middlemen are eliminated from the transaction process to enable a smooth run of the transmission of transactions. Blockchain is testified to have the highest speed rate of transaction process than any other technology.

  • In addition, blockchain provides the gateway for individuals to have full control of their data. Blockchain allows an individual or a group of individuals to fully have control over their own data by making decisions on the kind of information to share with the public and so forth.

  • Lastly, blockchain provides immutability. This means that the recorded transactions are not changeable or deletable. Blockchain networks record transactions and keep them permanently with the date-stamped and timestamped attached to them. This helps users to trace and track previous information when needed.


salma.jpg

The Blockchain Distributed Ledger


salma.jpg

image.png

source


Blockchain Distributed Ledger (BDL) refers to the technology in a blockchain network that helps in maintaining block databases available at any location around the globe simultaneously to enable every individual to actively participate within the blockchain network. There is high transparency in distributed ledger between the users. Also, blockchain distributed ledger provides users with a highly secured environment. Information stored in the ledger is immutable. Distributed is decentralized and as such don not require any central authority to confirm the transaction before it's executed.
Blockchain distributed ledger stores blocks and transactions permanently on the blockchain network and also provides updated information of blocks and transactions for each and every node.

Features of the Blockchain distributed ledger

  • High transparency: Blockchain distributed ledger provides greater transparency for transactions performed on the network. This transparency includes the provision of time and date of the transaction with a sequence nonce. This allows previous transactions to be easily identified when needed.

  • The use of the cryptographic codes in blockchain distributed ledger secures users from the 51% attack. This provides full security to users without the need for the use of the KYC system.

  • The distributed ledger can be re-created via editing the codes and commands because of the smart contracts they form under.

  • Blockchain distributed ledger is available to all at any time and to all users on the blockchain.

  • The blockchain distributed ledger is decentralized in that transactions are performed without the intervene of any third party.

Advantages of the Distributed ledger

  • Distributed ledgers are highly scalable. This means that they operate or speed up the transactions process time.

  • The blockchain distributed ledger is prone to attacks by hackers due to the use of cryptographic codes (Hash).

  • Distributed ledger makes the flow of information within a blockchain network easier and faster.


salma.jpg

The blockchain double-spending and How Bitcoin handles this problem.


salma.jpg

The double-spending in blockchain refers to a great threat in the blockchain network whereby the same amount of cryptocurrency is used in multiple transactions. Double spending cannot happen in the case of physical cash or payment but it happens with the use of digital currencies in making transactions. Doule spending mostly occurs when an individual does a mistake and does double-spending in making payment or when an individual wants to hack or attack the blockchain system.
For instance, consider a situation where an individual is to buy a vehicle at a price of $10,000. The buyer is free from double-spending if he/she pays the asset price with physical cash. But in the case where the buyer pays with a digital currency, then a chance of manipulation of the blockchain can occur which can lead to double-spending.

There are three main types of double-spending which include; Finney Attack, Vector 76, and Race Attack.

Finney Attack

The Finney attack occurs when the same transaction information is duplicated in the blockchain network by the miner and this is as a result of an unconfirmed transaction performed by the miner. This calls for the attention of users to make sure transactions are confirmed completely between the traders so as to avoid double-spending within the blockchain network.

Vector 76

This is a type of double spending in which users are being attacked through the use of software in sending fake cryptocurrencies to users so as to attack them within the blockchain network.

Race Attack

This is the type of double spending in which the user transfers multiple transactions of the same amount on a blockchain network without confirming the transaction. This means that when the recipient accepts the unconfirmed transaction then the attack takes place.


salma.jpg

How Bitcoin Handles Blockchain Double Spending


salma.jpg

The issue of double-spending in the Bitcoin blockchain network is harnessed by the use of distributed ledger technology in confirming and validating transactions on the blockchain network. What happens here is that transactions initiated on the Bitcoin blockchain network are unconfirmed transactions and are not added to the block until verification and validation of the transaction takes place. After this occurs, the cryptocurrency is sent to the recipient's address, and it's now included in the distributed ledger of the bitcoin blockchain.

When a double-spending attack is initiated on a Bitcoin blockchain network, transactions that are able to be confirmed will be verified and sent to the recipient address of the receiver and the transactions that are not confirmed are removed or deleted from the blockchain network. Immediately the transaction is included in the ledger then the transaction becomes immutable.


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.

salma.jpg

The Block Hash in Blockchain


salma.jpg

  • First of all, visit the blockchain demo website blockhaindemo and click on the Blockchain from the menu toolbar.

  • Now from the screenshot below it is shown that the first block (Block 1) also called the genesis block has zero's as the previous Hash and the next generated Hash is = 000015783b764259d382017d91a36d206d0600e2cbb3567748f46a33fe9297cf

  • It can be seen also that Block 2 has a previous hash = 000015783b764259d382017d91a36d206d0600e2cbb3567748f46a33fe9297cf that is equl to the Hash of Block 1, and the generated Hash of Block 2 = 000012fa9b916eb9078f8d98a7864e697ae83ed54f5146bd84452cdafd043c19


image.png


  • Also, from the screenshot below, we can see the previous Hash of Block 3 = 000012fa9b916eb9078f8d98a7864e697ae83ed54f5146bd84452cdafd043c19 which is the same as the generated Hash of Block 2 whilst the generated Hash of Block 3 = 0000b9015ce2a08b61216ba5a0778545bf4ddd7ceb7bbd85dd8062b29a9140bf

  • Similarly, the Previous hash for Block is the same as that of Block 3 Hash = 0000b9015ce2a08b61216ba5a0778545bf4ddd7ceb7bbd85dd8062b29a9140bf and the generated hash for Block 4 = 0000ae8bbc96cf89c68be6e10a865cc47c6c48a9ebec3c6cad729646cefaef83


image.png


Note that each Block has its own Nonce and space provided to write Data.
This explains how the blocks are interconnected with each other on the blockchain network.


How to Add Data a Block in a Blockchain


salma.jpg

The previous Hash we saw was just Hashe with no Data and I would like to illustrate on how to add data in a block and generate a Hash for the Data added. It should be noted that the Hashes are generated automatically.

  • Block 1
    Let's take SALMA78 as our first Data and add it to the firts block. The newly generated Hash is = 6f43e8f02d434e034d23a055dad312791c1d22432de63acf3eec9ad117323d3f

image.png


  • Block 2
    We would add CRYPTOACADEMY as the Data to the Second Block and the generated block is = aab84251ff7a0f163cbc69e8ced0a4b7d05340cba9fcca67ef86096c826af43e

image.png


We can notice that the generated Hash of Block one serves as the previous Hash of the second block and the second generated Hash of block two also serves as the previous hash of block three and so forth.


image.png


How to Mine block in a blockchain


salma.jpg

The nonce of the block within the blockchain is first calculated in order to mine a block. Once the correct nonce value is calculated, the block is then validated and it goes into the list of blocks for mining to begin. The mining of blocks requires high computational tools or hardware.

Invalid Nonce

Block 1
  • In Block 1, we used the Nonce value 11316 we generated a hash = 6f43e8f02d434e034d23a055dad312791c1d22432de63acf3eec9ad117323d3f
    and this block is taken as an invalid block.

image.png


  • Secondly, we would use a Nonce value of 11301 and this generated a hash = 59982649376df5d486511b98a70f09e839fa50f37c8186d0110d597eaf4cc845
    This new hash generated is updated as a previous Hash in the second Block.
    The block is considered invalid because a valid block starts from 0000.

image.png


  • Thirdly, a Nonce value of 11303 is used and this generates a Hash value of = 157b834017193e2bb83cf7f110d829f1babc55e9e47135409e477f9170b06a86
    This block is also considered invalid and the generated hash is used as a previous hash for the second block.

image.png


Note that this computational process would continue in this process until a correct Nonce value is used in the mining process.

Valid Block

Block 1

  • To calculate for the correct nonce value, click on Mine below the Hash value column.

The new correct nonce generated is =10173, and the new hash generated for block 1 = 000057f3815f4fea390e2e99401ccde245420ab33444405770fce5c4a9e2f1df. This is a valid block because the hash value starts with 0000 as indicated. Also, the hash generated in block one is used as the previous hash for the second block.


image.png


Block 2
Now we do the same for block 2 by clicking on Mine and this generates a correct Nonce value of 67013 and also a new hash value of 000017001d38c8542bdf004fc41e54d6cf9174bbc463bf735f9cd8761e217c69 This is also a valid block and the hash generated is used as the previous hash for the third block.


image.png


  • Block 3
    Similarly, the third correct nonce is generated by clicking on mine and the correct nonce value is 1644538 which generated a hash value of 00008bd9e88fb54250c31b849776ab4cdfb024863550e86d51f0cf16e106255f The generated hash is used as the previous hash for the fourth block. This process continues in this manner until the last block in the blockchain is validated.

image.png


  • Block 4
    The correct Nonce value generated for the fourth block is 34288 and a new generated hash value of 0000c1b2949e4ddc5ad55bc5a4c5994fedb8ae15e4afe25b15709eec1560fc96. This new generated hash is used as the previous hash for the fifth Block. The fifth nonce value calculated was 29628 with a hash value of 000065da7c546d816630af842c44acb8af2c0a8b9eef70da05b05560ebff5b64.

Note that the color of the block interface changed from Red to Green and this indicates a Valid Block.


image.png


The above indicates the process of mining for correct blocks by calculating for correct Nonce values.


salma.jpg

What is Race Attack in Blockchain


salma.jpg

Race attack as I briefly explained earlier in my article, refers to the type of double-spending attack in which an individual (intruder) transfers the same amount of a crypto asset to different users using different nodes within the blockchain network. Immediately when the buyer accepts the transaction without confirming it before then the attack is initiated and this intrudes on the user's blockchain. It is mostly done by using a single crypto asset in purchasing multiple assets within a blockchain network.

In this type of transaction, when the intruder puts the multiple transactions in the blockchain network, during the mining process only one of the transactions would be validated and the remaining ones would be invalidated and hence deleted or removed from the blockchain network. To avoid such attacks, one needs to patiently wait for confirmation of transactions before releasing assets sold. An example is a situation where an intruder transfers 0.005 BTC to 4 different users within a blockchain network by using different nodes. This attack would get users that do not wait for the confirmation of the validation of the transaction.


salma.jpg

The Limitations/ Disadvantages of Blockchain


salma.jpg

  • Prone to Attacks
    The decentralized nature of blockchain permits blockchains to be prone to attacks by hackers or fraudsters. Blockchain data accessibility is too open and this creates a way for intruders to infect the blockchain network with malicious attacks.

  • Decreased scalability
    The rate of the overall performance of the blockchain network is reduced as a result of the increase in the number of connected nodes within the blockchain network. This decreases the speed and the rate at which data or transactions are processed.

  • Not Reversible
    In blockchain networks, information or transactions stored within the network are immutable which can't be deleted, removed, or reversed. This implies that users have to be more vigilant when making transactions to another user within the blockchain network because any mistake committed can't be reversed or removed.

  • Lastly, there is a high cost involved in Mining, The high consumption of energy in mining leads to the high cost involved in mining. The use of the higher computational hardware in mining also adds to the high cost involved in mining within a blockchain network.


salma.jpg

Conclusion


salma.jpg

To conclude, I would like to briefly summarize what I have discussed in this article. First of all, we looked at the concept of Blockchain by defining what blockchain is and the main components of a blockchain. We also looked at the four main types of blockchain which include public blockchain, private blockchain, hybrid blockchain, and consortium blockchain. We looked at each's advantages and disadvantages. Also, we looked at some of the benefits of Blockchain and also we explained the concept of the Blockchain Distributed Ledger and how it works. We further went on to explain the concept behind blockchain double-spending is and how Bitcoin has managed to handle this issue.

In addition, we visited the blockchain demo website where we practically demonstrated in detail how Block hashes work in the blockchain. We also looked at what happens when any middle of the block gets changed. I also demonstrated how to add data to block and also how to mine blocks in the blockchain network. We again looked at the race attack in blockchain and how to avoid such attacks and the cause of the attack too. Finally, we looked at some of the disadvantages or limitations of Blockchain technology.

I would like to say thank you to professor @stream4u for such a wonderful lecture taught this week and I look forward to participating in your subsequent homework tasks.
Thank You.

Sort:  

Hi @salma78

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 good Content. All topics were explained very well.
All topics were covered very well and the presentation is very good, you did very god in this task. however, In Blockchain Practical + Theory, you explain Blockchain well and screenshots are provided also good. Still, you could try to explore more information on what if any middle of the block gets changed? Practically you tried well but what did we understand from this Practical, that key point theory information needs to be more clear with the correct explanation. The rest of the task is good.
Done
8/10

Total | 8/10

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.18
TRX 0.15
JST 0.029
BTC 62195.97
ETH 2415.56
USDT 1.00
SBD 2.64