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

in SteemitCryptoAcademy3 years ago (edited)

IMG-20210805-WA0072.jpg

Hello Professor @stream4u, I'm happy to once again partake in your homework. I really enjoyed your lecture and learnt a lot about Blockchain technology. Here's my homework post.

image.png


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


Blockchain

image.png

blockchain-3277335.png

Source

Blockchain is simply a chain of connected blocks carrying stored or recorded data and information that is distributed across a network. The blocks are in such a way that the data stored in them cannot be altered or changed. This is because it operates with several nodes connected sharing the same information. To hack the system, one would have to hack the nodes simultaneously which makes it impossible to hack since there are many nodes.

No one person controls the Blockchain system thus, it is decentralized. Anyone at all can add the next block also and It uses a consensus mechanism to verify and accept information across the network. Aside from being impossible to hack, it also uses hashing to encrypt data to prevent tampering of blocks mined.


What are the components of a Blockchain?

A Blockchain has 4 main components for operation. They include the following:

Block

A block is a container for recorded and encrypted data. After validation and addition of the Block, the information is distributed across all the nodes of the network. It cannot be altered also. Once it is filled with data and validated, it is added to the other blocks already mined and gives way for a new block to be mined. It also has traits and a common history from the block that preceded it in a way such that all blocks have a cryptographic has of the block that preceded them.

Each block created has three important features. These are:

  • Data recorded within the block.
  • Nonce, which is a 32-bit number generated upon the creation of a block.
  • Hash, which is a 256-bit format used to indicate whether a block is valid or not.

Links (Chain)

All the Blocks in a Blockchain are linked to each other. This link is called a chain. This is how come we have the name Blockchain. This chain is the hash. This hash connects all the blocks and encrypts data inputs within the block.

Nodes

Nodes are devices or computers around the world connected to the Blockchain network. For a blockchain to function effectively, the majority of nodes have to be in agreement and be able to recognize and validate blocks. The nodes act as sources of data and information about the blockchain. This is because every node has a copy of the Blockchain and is updated every time a new block is added.

Miners

Miners are those that create new blocks on the Blockchain network. They compute complex calculations using very powerful devices and software to validate blocks and earn rewards for mining a block.


Types of Blockchain

image.png

There are main 4 types of blockchains. Each of them has some characteristics and features that make them different. They are:

Public Blockchain

This is a type of blockchain that gives access to anyone. There's no restriction to anyone on this Blockchain. Users are free to mine and access data from the network without permission. It also gives access to modifications of the source code of the blockchain for personal uses.

A public blockchain is decentralized. No one person or organization has control over the network. For agreement between the nodes on the state of the network, there are two common consensus algorithms used. These are Proof of Work(PoW) and Proof of Stake(PoS).

They are suitable for organizations that offer transparency and accessibility to anyone. The disadvantages are, restrictions are impossible and the networks becomes slower as more nodes join the network. Also in the case where 51% of the nodes are hacked the blockchain can be tempered with.


Private Blockchain

A private blockchain functions like a public blockchain but on a smaller scale. The participants of the mining on the network are restricted and permission is required by users. That is to say that only a select few nodes controlled by the organization create and validate blocks on the blockchain network. It also prevents modifications of the blockchain by anyone at all since the source code is closed.

Private Blockchains are considered to be centralized. This is because it is controlled by a company or organization although it operates in a decentralized way. The organization can set permission, authorization, security and accessibility levels. Its operation on small scale or the small number of nodes makes the blockchain very fast as compared to the public blockchain.

The disadvantages of this blockchain are that the consensus mechanism can be compromised when there are attacks on a few nodes. Having more nodes provides tighter security. In this case, where the nodes are limited, there is less security. Also, the anonymous nature of blockchains is lost in private blockchains. The identities of participants are known to those in control of the blockchain.


Hybrid Blockchain

A hybrid blockchain is a combination of public and private blockchain features. It consists of a private blockchain merged with a public blockchain. Organizations use the private blockchain to set up permissions and access levels and allow the public blockchain nodes to access the information they want them to have. This is to say that, all the data on the blockchain isn't made public on the hybrid blockchain.

Users have full access upon joining the blockchain. Although all data isn't made public, it can be verified by the use of smart contracts. Information can be secured by the organisation but it is still verifiable. Also, the identity of users is revealed to other users when they engage in transactions with them. Aside from that, the identities of users are protected, unlike the private blockchain.

Hybrid blockchains are suitable for storing medical records and uses in real estate. They are fast and low cost with transactions and have better scalability as compared to public blockchains. Having centralized governance, the ecosystem is closed and so it is impossible to perform a 51% attack on the network which makes it very safe. The disadvantages are, it is still not completely decentralized. Upgrading the system can also be challenging.


Consortium blockchain

A consortium blockchain is also known as a federated blockchain. This type of blockchain is a private blockchain that limits access to a particular group of people. Although it is a private blockchain, it has hybrid blockchain features but differs concerning the participants of the blockchain. It consists of members from multiple organizations coming together to govern the blockchain. This forms a decentralized network and solves risk problems associated with one entity managing the private blockchain network.

The multiple organizations keep each other in check and prevent centralization on the blockchain network. The consortium blockchain with its limited access also has faster speed as compared to the public blockchain. There are no scalability problems, it is efficient and also offers low-cost transactions. The disadvantage is that it is still not completely decentralized because of its limited access.

image.png


2.What are the benefits of blockchain?


Benefits of Blockchain Technology

image.png

Blockchain has been very beneficial since its invention by Satoshi Nakamoto in 2008 creating Bitcoin to provide a public transaction ledger. After this revolution, many organizations started to adopt its usage because of its benefits. Some benefits of blockchain technology are:

Decentralized structure

Blockchains are purposed to eliminate a central authority preventing one person or group from controlling the activities of the network. Activities are peer to peer without any facilitator. Its decentralized nature also creates trust where it is non-existent. This is because of the anonymous identities of participants. Although they are anonymous, they are willing to engage in activities and sharing of data without any intermediates. There is also transparency of information. The block data and transaction details are distributed and updated to all the nodes connected to the blockchain.

Immutability

The data recorded on the blocks on the blockchain cannot be altered or deleted. The time-stamp for all transactions is recorded permanently. Before changes can be made to a blockchain, it has to be forked. This is done when there's a breach in security to reverse transactions. Before this is done, the participants of the blockchain come into agreement and fork the blockchain.

Availability of data

Anyone at all can access data stored on the blockchain network. It doesn't restrict or limit access to any participant. Participants are free to access data anytime. It also gives access to the source code of the blockchain for modifications and personal usage.

Speed

The absence of humans as intermediaries and the use of smart contracts such as AMM allow transactions to be done at a fast pace. There is no need to wait for an intermediate to be available before you perform an activity, you can perform an activity anytime and any day.

Security

Blockchain technology offers very tight security. It is very difficult and nearly impossible to hack. Its immutability feature also prevents alteration of data and theft. It also uses hash functions to encrypt data within the blocks for tighter security.

image.png


3.Explain Blockchain Distributed ledger.


Blockchain Distributed Ledger

image.png

Blockchain is a type of distributed ledger. A distributed ledger (DLT) is an organized collection of data that is stored, accessed, and shared by multiple participants. Each participant receives a synchronised copy of the data across the network every time there's an update. Any update is reflected and distributed to all participants within a short period. A distributed ledger eliminates the need for a central authority and allows participants to verify, execute and record transactions on their own.

Blockchain distributed ledger basically enables participants to access recorded data shared across the network, verify, execute and record transactions permanently on their own without any centralized authority or intermediate. The permanent recordings make the network very secure and prevent alterations. The blockchain distributed ledger ensures that every participant has access to the same information and sends a copy of newly validated transactions within a newly mined block to all participants. Thus, all participants are updated on the current state of the network.


Properties of Blockchain Distributed Ledger

A Blockchain distributed ledger has the following properties:

Decentralization

A blockchain distributed ledger is decentralized. It doesn't require any intermediate or centralized authority. Participants record, access, execute and verify transactions on their own. It also protects the identity of participants on the network.

Distribution

This property ensures that all participants have a copy of the ledger and updates them on additions or changes within a short period of time.

Immutability

This property makes it impossible to make changes or delete recorded data within a validated block. Date and time stamps are recorded for the transactions that are permanently recorded for transparency and easy referencing.

Security

Blockchain distributed ledger has features like a hash that encrypts data to strengthen security and make it easy to keep track of transactions.

Unanimity

This property ensures that all the nodes are in agreement and accept the validated blocks within the blockchain.

Programmable

A blockchain distributed ledger uses a programmable function known as smart contracts to serve as an intermediate in the automated management of transactions between participants.

image.png


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


Blockchain Double Spending

image.png

Blockchain networks have issues with double-spending because digital information can be reproduced easily. Double spending in the blockchain is where the same amount of a cryptocurrency is used in multiple transactions. This is done through the manipulation of the blockchain network by producing copies of a digital token and making transactions with another party while retaining the original token.

Double spending on blockchain networks is difficult but not impossible. The immutability nature of blockchain prevents transaction records from being edited thereby preventing double-spending. But in the case where there is a 51% attack, it is highly possible to manipulate the blockchain network and double spend. The time taken for the block validation process also creates an opportunity for hackers to manipulate the system to double spend.

There are different types of double-spending in blockchain networks. Examples include:

Vector Attack 76

This is a type of blockchain double spending where hackers use software programs to send fake bitcoins. It takes advantage of a bug in the consensus mechanism to steal funds from other participants on the blockchain network.

Race Attack

A race attack occurs when an attacker sends multiple transactions of the same amount of an asset to purchase multiple products with just one transaction. This occurs when recipients fail to confirm transitions before taking action.

Finney Attack

A Finney attack is when a miner pre mines a block to contain a transaction and also performs an identical transaction before the pre-mined block is released. This duplicates the transaction details and causes the Finney attack to be successful when users accept transactions without confirming from the network.


How Bitcoin handles double spending

Bitcoin handles issues with double-spending by maintaining a common universal ledger system and implementing a confirmation mechanism to approve and discard transactions. In the case where an attacker tries to manipulate the system using double transactions, both transactions go into the pool of unconfirmed transactions. The confirmation mechanism approves the first transaction and discards the second one as it sees it as invalid. In the case where both transactions are taken out from the confirmation pool simultaneously, the transaction with the highest number of confirmations is validated and added to the block while the other transaction is discarded.

This process helps to prevent double-spending but can be used to steal funds from other participants. This occurs in the case where a merchant receives a failed transaction and fails to check whether it is valid or not and sends a product. The immutability feature of blocks also prevents alteration of transaction details and helps to prevent double-spending.

image.png


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

image.png

To understand block hash in blockchain and how it works, I'm going to make illustrations Blockchain Demo. When you visit Blockchain Demo, there are options like Hash, Block, and Blockchain at the top of the page. Let's first look at Hash illustrations and gradually head to the Blockchain.


Hash

Blockchain Demo upon navigating to the Hash would provide you with a SHA256 Hash generator. Now, let's take a look at what happens when you input data.

PicsArt_08-05-09.18.15.jpg

As can see a hash is generated. The input data was: Steemit Crypto Acadamey and the hash was: 45a445061c91a142adec1ea9be2b677832813e6d3b8c93e8bb1c6b12b8c4f492. You'll notice it's impossible to trace the input data by looking at the hash. Hashes are in such a way that the output data cannot be decrypted to provide the input data.

I'm going to enter similar input data to see what happens.

PicsArt_08-05-09.20.51.jpg

The input data was: SteemitCryptoAcademy and the hash: 7e16586ddacd59b3ac67fd3b932f2a810f7d6dc7118971fedccc39ea3fb3f0c7. As you can see no matter how similar inputs may appear they do have the same or similar output. To learn more about Hash you can visit my Homework post on Hash and Cryptography.


Block

In the block section, there's Block, Nonce, Data and Hash.

PicsArt_08-05-09.23.38.jpg

Block hashes start with 0000 and continue with other alphanumeric characters. The block hashes for each block are of the same length but never the same. The nonce is to make each request unique to prevent attacks on the block.

Let's see what happens when we input data.

PicsArt_08-05-09.28.02.jpg

The block changes colour to red indicating that the block is invalid. Take a look at the nonce and hash. As you can see from above, the nonce is still the same while the Hash has changed. For the block to become valid, the right value of the nonce has to be found for the data input. To do that, we click Mine which uses computational power to find the right value of the nonce.

PicsArt_08-05-09.31.09.jpg

The new Nonce is: 99641 and the hash is:
00000b9bd1eb4bba815ddb93c82e2932dd7dcc43aa8e0409e79d47b22bccff77


Blockchain

We're finally on the Blockchain to see how the Block hashes work in Blockchain. In the Blockchain section, the details for the Block section are maintained while the previous block hash is added. Every block has the hash preceding it recorded. For block 1, the previous block is the genesis block. Its hash is 0000000000... The blocks after it also start with 0000 and continue with alphanumeric characters. All the block hashes are of the same length but not the same.

PicsArt_08-05-09.41.43.jpg

Let's see what happens when you input data for any of the blocks. Would be using Block one for this illustration.

PicsArt_08-05-09.51.08.jpg

As you can see from above all the blocks have become invalid as a result of an edit to the data input. The block hashes for all the blocks also change but the Nonce remains the same and also, all the blocks are red indicating they are invalid.

Let's mine the block with the edited data to see what happens.

PicsArt_08-05-10.01.44.jpg

As you can see, the Nonce and Block hash is changed for the mined block. The hash of the block mined begins with 0000 which shows it's valid. For the remaining blocks, the Nonce remains the same and they are still invalid. To make them valid you have to mine to get the right nonce and hash values.

This illustration shows that when a block input is altered for any block, all the other blocks have to be reminded to become valid. This shows how secured and impossible it is to alter a block detail in a Blockchain.

image.png


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

image.png

As I mentioned earlier, a Race attack is a type of double spending on the blockchain. The way I see it, a race attack doesn't really double-spend the same unit amount of a currency, instead, it frauds merchants into accepting transactions without confirmations.

A race attack occurs when an attacker sends multiple transactions with the purpose of making multiple purchases with a single transaction. This is how this happens. The confirmation mechanism of blockchain prevents double spending on a single unit of a currency by approving and discarding transactions after confirmations. In the case of a race attack, a transaction is approved while the others are discarded as they are seen as invalid.

The problem here is that the recipient of the transaction believes the transaction is successful and sends a product in return without confirmation of the success of the transaction. As you can see, the unit amount of the currency isn't spent twice. Instead, the merchants are tricked into believing a transaction is successful when it could have been failed and that leads to double-spending. To avoid a Race attack a recipient must confirm a transaction is valid before sending a product or taking any action.

image.png


7.Limitations/disadvantages of Blockchain.


Blockchain Limitations

image.png

Blockchain technology since its revolution has brought about many benefits. Despite its benefits, it has some limitations. Below are some limitations of Blockchain.

Scalability

Blockchains have lower scalability as more nodes connect to the network. This slows down operations and increases the cost of mining and transactions.

Immutability

Immutability is a double-edged sword. It prevents alterations and makes the blockchain secure but in a case where a mistake is made with a transaction, nothing can be done about it.

Cost of mining

Blockchain mining requires very high computational power. To achieve that, the uses of specialised computers such as ASICs are used. These devices consume a lot of energy to perform mining activities.

Adaptability

Blockchain technology isn't adapted everywhere. Some governments see it as a threat and so it has issues with legalities and usages in certain countries especially in the field of cryptocurrencies.

image.png


Conclusion

image.png

Blockchain technology has shaped up the world with its benefits. Its decentralized nature prevents one entity from controlling a system. It is accessible to anyone anywhere at any time and solves problems without intermediaries delaying processes or activities. It offers a secured network free from fraudulent actives associated with centralised systems and ensures transparency to everyone on the network.

Although it has some limitations, solutions are being created by developers to make it more suitable. Some countries have also accepted and adopted the uses of blockchain technology and have also created their own cryptocurrency.

Blockchain technology is the future. I would like to thank @stream4u for this great lecture. I really learnt a lot from your lecture and researching for this homework task.

image.png

Unless specified, all images are screenshots from Blockchain Demo

Sort:  

Hi @danielo109

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