Crypto Academy / Season 3 / Week 6 - Homework Post for [@stream4u]

Hi everyone and Assalam u Alaikum,

Welcome to my homework post for Respected Professor @stream4u who has delivered an outstanding lecture about Blockchain and I have learned many new things from this lecture. Thanks for such a detailed lecture.

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


Blockchain.


blockch.jpg


Image source

Blockchain is a term used for a sequence of blocks which are connected with each other like a chain. These Blocks are digital records created and stored on blockchain network. Once a block is saved it cannot be altered or changed. Blockchain technology is decentralized and it is can be accessed by anyone but no one can alter the data on any block which is once saved. Every block saved is connected with the previous block and hence these are connected to each other to establish a chain and called Blockchain.

Blockchain consists on 3 components that are given below in detail.

Blocks.

Block is a digital file where saved data is available on the network and this data is recorded permanently. Once data is stored it cannot be changed or removed afterwards and a copy of the block is distributed among all the nodes on the network which will then be used to connect it to the new block and make a chain of blocks.

Every block consists of 3 essential elements that are called the properties of a Block. These are a Data on the Block that has been saved on a block, Nonce, a 32-bit number that is generated on creation of new block and Hash, which is a 256-bit set of alphanumeric characters. Each block has a unique Nonce and Hash but contains hash of previous black to maintain a Blockchain.

Nodes.

Node term is used for computers that are connected to the network that are responsible to create, mine and validate blocks. A blockchain is maintained and run smoothly through nodes. When a new block is created, every node is sent the copy of this newly added block and data on it thus making it a decentralized network in nature.

Miners.

Mining is a process where new blocks are created and added to the network. For this purpose, some special softwares are used by the miners to solve the complicated mathematical computations. Miners are used to validate transactions and solve complex mathematical problems.


Types of Blockchain.

There are mainly 4 types of blockchain available and these are Public Blockchain, Private Blockchain, Consortium Blockchain and Hybrid Blockchain. These are discussed in detail below.

Public Blockchain.

This is the very first type of Blockchain where Bitcoin was originated. As the name suggests, it is non-restrictive and permission-less and anyone can access the network through the use of internet. Public Blockchain technology uses Distributed Ledger Technology (DLT) through which maintenance of data distribution to nodes is carried out.

In Public Blockchain, a node can access any block on the network and the data available on it at any time. All the data is available for everyone. Public Blockchain uses Consensus algorithm where all the participants reach to an agreement about the data on a block to verify the transaction data. These Consensus Algorithms are Proof of Work (Pow) and Proof of Stake (PoS).

Advantages of Blockchain.

Following are some of the advantages of Blockchain given below.

1. Transparency.

Transparency is the main advantage of Public Blockchain that is on offer. Any one can access the data stored on a block but it cannot be altered or changed. Thus making it transparent in nature.

2. Security.

Once data is stored on the block through the use of Public Blockchain, it cannot be changed afterwards. In this way, this system provides the best security to the data saved on a block using Public Blockchain. Hash cryptographic function of this system ensures utmost security. Hence it can be said, that it is a very secure system.

3. Easy Access.

Any one can access the public blockchain, hence it is freely accessible. Only internet connection is required to access a public blockchain. So it is open to everyone and easily accessible. This feature makes it Public Blockchain and open to everyone. Any one can adopt it and benefit from it.

Disadvantages of Public Blockchain.

Slow network.

As the number of users is increasing day by day and blockchain technology is being adopted by the masses, transactionprocessing speed is slower in public blockchain as compared to other types of networks.

Maintenance Cost.

Miners to be used in Public Blockchain technology are very costly and their maintenance is very expensive. High voltage of electricity is also required to run these miners. Moreover, some cooling devices like Air conditioners are also required to maintain the temperature at a reasonable level. It adds into the cost of mining, thus making it very expensive to mine.

Private Blockchain.

Private Blockchain is another type of network where it is restricted to a limited number of users or connected nodes. This is not open to everyone like Public Blockchain and not everyone can access it. In Private Blockchain Network, data is stored on connected nodes to the network to maintain the accuracy of the data on blocks.

Private Blockchain is often used by institutions like banks and companies and where only authorized users or nodes can access this network. This is a restricted network and only connected or authorized nodes can have access to this network.

Advantages of Private Blockchain.

Restricted Access.

Private Blockchain is restricted network and only authorized users are allowed to access the network. Thus making it a small network and congestion is removed by this feature.

Fast network.

As number of users is limited, thus enabling this network to work fast and transaction speed is faster than Public Blockchain. Transaction is completed within very short time.

Security.

Private Blockchain Network is very secure as a limited number of users can access the network. So data stored on Private Blockchain is not accessible to everyone and it is more secure and safe.

Disadvantages of Private Blockchain.

Not fullyDecentralized.

Private Blockchain Network is not open to everyone and its control is under some authority, thus making it a bit Centralized in nature. Blockchain Network is decentralized and non-restrictive, but in case of Private Blockchain, it is restricted to number of users thus making it kind of centralized.

Security.

As discussed, there are very few nodes connected to this network, it is very easy to hack these few nodes and it can easily be done by an unauthorized person.


Hybrid Blockchain.

This Blockchain has properties of both Private and Public Blockchain. In such system, Private Blockchain is used for data storing on blocks where Unauthorized users and non-connected nodes have no access. While Public Blockchain is used to connect nodes on the network. It means data is publically available on Hybrid Blockchain but its maintenance is carried out using Private Blockchain.

Advantages of Hybrid Blockchain

Fast Transaction.

Hybrid Blockchain is not congested and number of nodes is limited, so its transaction speed is much faster than Public Blockchain.

Security.

Blockchain technology is deemed very secure due to its property that once data is stored on a block cannot be altered or changed. Same is with Hybrid Blockchain and it is very secure.

Less maintenance cost.

Hybrid Blockchain consumes very less computation power as network is limited and restricted access is allowed. So, Hybrid Blockchain is easy to maintain as compared to Public Blockchain.

Disadvantages of Hybrid Blockchain

Not fully Decentralized.

The only disadvantage of Hybrid Blockchain that I have figured out is it is not fully Decentralized. Transactions can only be processed and verified through Private Blockchain. So, it is not fully decentralized.


Consortium Blockchain.

Consortium Blockchain is similar to Hybrid Blockchain but what is the difference.It is also known as federated Blockchain Network. In consortium Blockchain, platform is governed by different organisations instead of one organization. Some nodes from other networks are also connected with the network nodes to verify transactions on the network.

By connecting nodes from different networks, decentralized nature of the blockchain is maintained. These outside nodes can also send, receive, verify and validate transactions.

Advantages of Consortium Blockchain.

Fast and secure nnetwork.

Transaction speed is faster than Public Blockchain and data on Blockchain is deemed to be secure in Consortium Blockchain. Although different organisations are connected to the platform, still it is not very congested and transactions are processed fastly.

Less cost.

Usually, low energy consuming consensus protocols are used by Consortium Blockchain that makes this blockchain cost effective. Low complexity algorithms are used and less power is required to solve these algorithms.

Multiple Blockchain.

In Consortium Blockchain, selected nodes are connected with the nodes of other Blockchain, hence multiple chains are connected in it.

Disadvantages of Consortium Blockchain.

Not fully Decentralized.

Although multiple nodes from different blockchains are connected on this platform, still it is not fully decentralized. Only selected nodes are connected with other nodes to verify data.


Q. 2. What are the benefits of blockchain?


Blockchain has many benefits and few of these benefits of the Blockchain have been discussed below.

Trust.

Blockchain has developed trust between differententities where trust is lacking. Transactions are completed within very short time and once a transaction is processed, it cannot be altered afterwards. It creates trust between the parties to the transaction because every detail is available at any time.

Decentralized in nature.

Blockchain is decentralized in nature and no central authority is involved whose permission is required for accessing any transaction data. Blockchain is permission-less and anyone can access these networks and check the details of the transaction.

Improved Security andPrivacy.

Blockchain technology claims to be more secure than any other network. Once data is saved on Blockchain, it is unalterable thus making it more secure. Data of transaction is publically visible but it is unalterable, and parties to the transactions are also not revealed. So it maintains the privacy in tact.

Reduced Costs.

As there is no third party involved in any transaction, thus transaction fee is low as compared to any other network or system. Blockchain eliminates the evolvement of third party that helps in reducing the cost of business.

Speed.

Transaction speed is very fast in Blockchain. Transaction is completed within very short time and it can be carried out in any part of the world. Blockchain transaction speed is much faster than conventional system. In some cases, transaction is completed within seconds.

Immutability.

It means once data is saved on a block, it cannot be altered or changed afterwards. All the transactions are recorded time-stamped and date-stamped and it is saved permanently.


Q. 3. Explain Blockchain Distributed ledger.


Blockchain Distributed Ledger.


distributed-ledger-technology.webp


Image Source

Distributed ledger is the basis of this Blockchain technology and makes it decentralized in nature. When data is saved on a block, it is distributed to all the connected nodes to update the blockchain network. It is the main point of difference between traditional centralized system and Decentralized system.

Blockchain Distributed Ledger ensures the distribution of updated details of the network, transactions performed and data stored on blocks. This function of updated details distribution to all the nodes on the network is the main function of Distributed Ledger. It simply means that it is a ledger and it is in distributed form built on Blockchain network.

Properties of the Blockchain Distributed Ledger.

Followings are some of the essential properties of Blockchain Distributed Ledger.

Shared record-keeping.

Distributed Ledger should have the property of shared record-keeping. Every node on the network should have the updated detail of the network.

Security.

Use of Hash cryptographic functions ensures the security of Distributed Ledger. Hash algorithm is used to maintain, encrypt and validate blocks on the network.

Immutability.

This means that once a data is stored on a block, it cannot be changed by any user. Distributed Ledger should have this property and data stored after validation on a block cannot be altered.

Multi-party consensus.

This means that all the nodes should come to an agreement about a transaction. So once a transaction is unanimously agreed by all the nodes, then data is permanently stored on the block.

Automated Programmed.

Blockchain Distributed Ledger uses smart contracts that function automatically. Transactions on the network between buyers and sellers are managed by smart contracts automatically.

Anonymous.

Blockchain Distributed Ledger ensures that the validating nodes and identification of the parties to the transaction are kept anonymous. This feature improves the privacy function and creates trust between the parties.


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


Double Spending is a term that is used for a risk that a digital currency can be used twice. This problem of Double Spending is unique to digital currencies that is relatively easy to reproduce digital information. This can be done a savvy person who understands the blockchain network and the computing power needed to manipulate it. This often happens when an attack on the network is initiated by the user who initiate transaction of same amount which looks like the original transaction. The user uses the digital record of a transaction in such a way that it looks like legitimate transaction. This term of Double Spending is unique to digital currencies world as it cannot happen in real world.


double spending.jpg


Image Source

“Double-spending occurs when a blockchain network is disrupted and cryptocurrency is essentially stolen. The thief would send a copy of the currency transaction to make it look legitimate, or might erase the transaction altogether.” Reference

Types of Double Spending.

Race Attack is the type of Double Spending where a copy of real transaction is broadcasted on the networkay the same time and a race is started. Hoping that the second transaction is completed first before the first transaction is recorded on a block. In this way, the currency may be returned through Race Attack to the wallet of the user. This happens when an unconfirmed transaction is accepted by the recipient.

Finny attack is somewhat technical and it can only be initiated by the miners. In this type of Double Spending, a miner uses the duplicate details of a transaction on different blocks. This can happen only when the recipient accepts the unconfirmed transaction and transaction is completed.

Vector 76 Attack is another type of Double-Spending and it happens when hackers send fake crypto using codes and commands generated by some software to the users in the network.

How Bitcoin handles Double-Spending problem.

Bitcoin handles Double-Spending problem through the use of Blockchain Distributed Ledger technology. Moreover miners are used to validate the authenticity of the transaction. These miners use hash algorithm to validate the transaction initiated on the network. Once the transaction is confirmed then it is completed and the recipient receives the asset in his wallet or account and data is stored on a block permanently.

In case of any attack by the hacker using Double-Spending problem is avoided by use of DLT and validation by miners while the unconfirmed transaction will be removed from the Blockchain automatically. This is how a Double-Spending attack is handled by Bitcoin.


Q. 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.


Block Hash in Blockchain.

Block hash is used to encrypt data of a transaction through the use of cryptographic hashing algorithm, and then data is stored on the block permanently. To further explain it, I will use Blockchain Demo and do some practical work.


Screenshot_1.png


Screenshot_2.png

I have opened the website and then click on Blockchain. There are 5 blocks there and you can see they have their numbers 1, 2, 3, 4, 5. Each block has Nonce, Prev, and Hash. These blocks are linked to each other by adding hash number of Previous block in Prev and hence they are linked to each other.


Screenshot_3.png

In the above screenshot, you can see that Hash number of Block 1 is added in Prev of Block 2 and these blocks are linked. Similarly hash of Block 2 will be added to Prev of Block 3 and so on. I have mentioned the Hash of Block 1 and Prev of Block 2 that is same.

Prev of Block 1 consists of all zero because there is no previous block on network and it is the very first block, it is also called Genesis Block.


Screenshot_4.png

In this screenshot, Block 3 and Block 4 can be seen and Hash of Block 3 is added in Prev of Block 4 and it continues in this way.

How to add data on Block.

Now I will enter data on a block in the below screenshot. As soon as I entered data on a Block, its hash has changed and a new hash has been created. Green color of Blocks have turned into another color that shows that the entire blockchain needs to be re-mined.


Screenshot_5.png

In the above screenshot, I have added some data "Crypto Academy" on Block 1, and the hash of the Block has changed automatically and hashes of all the blocks have changes which is asking for re-mining of blocks.

Mining of Blocks.

Mining is the process of validating blocks in a blockchain and high-powered computers are used as miners for this purpose. Miners consumes lot of energy to validate and it is done by calculating the correct Nonce value of the block. Once the correct Nonce value is calculated and determined, the block is validated and added to the Blockchain permanently. When correct Nonce value is determined, the hash value will start with 0000 which is correct hash.


Screenshot_6.png

In the above screenshot, Nonce value is 11316 and its hash is 75c0b4c494ca1e2e3d767fdec6fb560d7bc033ad165a5ab70dae9f2cfa03135d that is showing block as Invalid block.


Screenshot_7.png

Now I have changed the Nonce value and Hash has changed again.
c642f13b968d2cda269c4b7980668ed7888b1535b0058a80636e52c41e2480d6
This hash value is again showing that block is Invalid Block. I will try to change Nonce value again.


Screenshot_8.png

I have changed the Nonce value to 11800 and new hash has been created which is,

dafa41a2732da6290b50150908e06678f2299e09ae2faa05e96258763b32addb

This hash is not starting with 0000 showing Invalid Block. New hash has been added to Prev of Block 2 automatically, as mentioned in the screenshot above.

The block will not be a Valid block until the correct Nonce value is not determined, and to find out Correct Nonce, Click on Mine Button.


Screenshot_9.png

As soon as I clicked Mince the correct Nonce value has been determined which is 9819 and Hash has changes to
0000dcb88fb8ece4c9c81a8c37f649b134b069fdce863e525ee085120c4e699b
and it is correct hash, starting with 0000 and block color has also changed to Green. This new hash has been added to the Prev of Block 2 automatically to link these blocks.

Now I will write some data on Block 2 and try to Mine it to get correct Nonce value and hash.


Screenshot_10.png

In this screenshot, you can see Nonce 35230 and hash (ccf3a023c6fa6ce00a78babc36e5babdd0ad5748a953b5fcf649d757bef5e197) that is not correct, thus an Invalid Block. Now I will click on Mine Button.


Screenshot_11.png

By clicking on Mine button, Correct Nonce value 6051 has been calculated and correct Hash (000069b09cab9e331076caf960393684ea7e8ca39a55bce066b50f7ce8c48938) has been calculated that shows block as Valid block.

This new Hash of Block 2 has been added in Prev of Block 3 automatically and these blocks have been linked now. This process of mining will continue until the last block is validated and stored on blockchain.


Q. 6. What Is Race Attack in blockchain? OR What Is Finney Attack in blockchain? OR What Is Vector76 Attack in blockchain?


Race Attack in Blockchain.

Race attack is a type of Double-Spending in which a hacker sends transactions of similar amount of tokens in the network to different users using different nodes. The purpose of this attack is to buy multiple assets using single token. The transaction details looks like legitimate transaction.

When a user receives the transaction and confirm it before the validation of the transaction is completed by the miners. In this way, the transaction will be completed and it will be recorded on the Blockchain, while other transactions will not be validated by the miners and these transactions will be removed from the Blockchain.

These transactions are made at the same time with the same amount of tokens and the hacker tries to get the fake transaction validated before the validation of the original transaction. Such hacker is well aware of Blockchain technology and knows exactly how much computation power is required to validate the transaction early.

This attack is successful when the recipient accepts the transaction before it is validated by the miners on the network. To avoid such attacks, it is recommended that do not release the item to the purchaser before validation of the transaction by the miners. Once a transaction is validated, then recipient should release the item and complete the transaction.


Q. 7. Explain the limitations or disadvantages of blockchain.


Limitations or Disadvantages of Blockchain.

Although Blockchain is very useful technology but it has some disadvantages associated with it. These are given below.

Irreversible.

Once a transaction is completed and stored on the block, it cannot be changed or altered afterwards. Although it is an advantage, but in some case like if a participant has entered wrong address by mistake and the transaction is completed, it cannot be reversed.

Scalability.

As blockchain is gaining popularity, number of users is increasing and nodes on the network are also increasing. This congestion is causing a reduction in speed. It means transaction process speed is slower.

High Transaction fess.

In some cases, transaction processing fess are very high. Ethereum blockchain gas fees are very high thus not affordable for small traders.

Expensive Mining process.

Blockchain network requires high processing hardware for mining purpose and CPU and GPU with great efficiency are required for this purpose. These CPU's and GPU's are very expensive and not everyone can afford to purchase them. So it is very expensive to mine on Blockchain network.

Illegal use of Blockchain.

In blockchain technology, the identity of the parties to the transaction is not revealed. So it can be used for illegal transfer of money by drug dealers and other such like activities.

Adoption of Blockchain.

Blockchain technology is still in its early age and it is still to be adopted by the masses and other Government and private organizations. It needs more adoption by the masses to be used everywhere in the world.


Conclusion.

In this lecture, we discussed about the components of Blockchain that are blocks, links, nodes and miners. These are the essential components of a Blockchain. We also discussed about different types of blockchain.

Blockchain Distributed Ledger has also been discussed in detail and how it works. Distributed Ledger technology is used where all the data is shared with the nodes connected to the network and all the updates on the network are also shared with these nodes to keep it linked.

Practically, we showed how data is stored on a block by calculating the correct Nonce value and hash of the block, and then Hash of previous block is added to the next block to link all the blocks on the network.

Double-Sending problem has also been discussed where different types of attacks like Finney attack, Race Attack and Vector 76 attack can be faced by the users on the network. Blockchain Distributed Ledger and validation by the Miners is the way how these attacks are handled by the blockchain.

In the end, it can be said that Blockchain technology is not old enough and it is in its early age. Thus it needs more improvement to attract more users and organizations to adopt it.

Thanks in anticipation.

Regards,

@mawattoo8

Sort:  

Hi @mawattoo8

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 average. 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. Still, you could try to explore more information on How block hash work, 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

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