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

in SteemitCryptoAcademy3 years ago

Greetings to everyone, it’s another week of the crypto academy and this week is my first advance level lesson. In this week, professor @stream4u made a lecture about Let's Open The Blockchain and it was a very informative lecture. After going through the lecture and doing some research, I have decided to write my solutions to the task given.

E39C010B-6C18-49B3-862A-0BE20AF94AE0.png Canva

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

Blockchain technology is a network that consists of a database system comprising of blocks of data that are stored, secured and are interconnected by nodes. These data cannot be be altered, removed of hacked in anyway. There is cryptographic feature that blockchain network uses to protect and secure the blocks of data and this feature is known as **Hash**. It employs the use of a one-way encryption of data make it impossible for data/information to be altered. The output value of data cannot be traced back to its corresponding input value and this is what happens in blockchain network.

Now there are four components that come together to form a blockchain network. These components of a blockchain are; Blocks, chains/links nodes and miners.

Blocks:
Blocks are digital ledgers or files that contain data of a particular transaction in a blockchain and the data contained in the blocks are encrypted. This makes it impossible for any alteration or changes to be made to the data of a block. After a block is formed, there is a 32-bit number generated called once and a Hash value generated that makes the block unique from other blocks. After the creation of a new block, there’s a duplicate made from it and it is transferred to other nodes that are interconnected to the blockchain network to bring about the decentralized nature of blockchain technology.

Nodes:
These are linked/interconnected computers in a blockchain network and they are responsible for creating, mining and validation of blocks in the blockchain. Each node connected in a blockchain receive updates of any newly created block in the blockchain and the transactions it holds.

Miners:
These are individuals in the blockchain who actively go through a process called mining to validate blocks and transactions in the network. They accomplish that with the use of powerful technology and equipment to solve complex mathematical algorithms to validate hash of blocks.

6F59CC46-0FDC-40A1-9E82-0E9402C8DDF1.png

Types of Blockchain

After understanding what blockchain is, I will now talk about the types of blockchain we have at the moment. There are about 4 different types of blockchains which comes with their various merits and demerits.

Public Blockchain:

In this type of blockchain, it allows anybody at all connected to an internet to be able to gain access to that blockchain. It empty the use of distributed ledger technology to ensure distribution of data in blocks to all connected nodes in the blockchain. This type of blockchain is commonly used by many cryptocurrencies and a clear example is Bitcoin. It makes it possible for all users to participate in validation of blocks and and transactions through connected nodes. In simple terms, the public blockchain puts no restrictions provided you have an internet connection and data is not stored at a particular node but rather scattered across the entire network bringing about the decentralized nature of this blockchain.

Advantages

There is transparency in this type of blockchain since anyone at all can access information in the blockchain provided they are connected to to the network.
Taking example of Bitcoin, connected nodes can access transactions that are found in the blockchain and this makes this type of blockchain more preferable than others.

Another advantage of the public blockchain is that, there is sense of high security in the blockchain. And this is because, it uses the cryptographic property of Hash. Due to this, it creates anonymity and privacy in the blockchain and this makes this type of blockchain very suitable for many users.

Lastly, it provides individuals across the world a free access to the network without any restrictions or interference. And this happens provided one has access to an internet connection. Because of this property of the blockchain, many organizations including governmental organizations can use this system carry out projects since it would enhance engagement of a wider community.

Disadvantages

One major disadvantage public blockchain has is that, it is usually prone to hacks and attacks. And this is because, it creates accessibility to everyone without any restrictions to connect to the network. As a result of this, hackers can maneuver their way into the blockchain and get away with user’s funds.

Secondly the cost and maintenance of this blockchain is very expensive. Because of large number of people engaged in this blockchain, there will be a need for highly powerful machines to cater for the needs of all the users in the network. And this will cause the huge amount of energy used by the equipments and machines and hence maintenance of the is needed to provide a fast going blockchain.

Lastly there’s usually too much people on the network that the blockchain can handle due to this, there is going to be stress or congestion in the network. And because of the vast number of nodes, it cause the blockchain network to be slow.

34F9722C-37A6-47DC-9E17-5439E7B382FA.png

Private Blockchain

This type of blockchain is similar to that of the public blockchain but with the private blockchain, there is only a selected number of nodes that have access to information of the blockchain. That is to say, in this type of blockchain a user would need to gain permission from the management of the blockchain before they can access the blockchain. The private blockchain is usually adopted by private related organizations such as schools and it is managed by a small group of individuals.
The validation and mining of blocks is done by the selected nodes in the blockchain network. Connected nodes can gain access to data and transactions of the blocks in the network.

Advantages

In this type of blockchain, there’s a faster rate of validating blocks and transactions hence making it fast. And this is due to the select number of nodes given access to the network.

Also, Since there’s limited number of nodes connected to the network, it makes it more secure due to less attacks happening to them. This comes in because of the small access it gives users and with this they are able to monitor very well the activities of the block. And also improve the blockchain easily in terms of maintenance.

Disadvantages

The blockchain is directly controlled by a group of people and they decide to give people access to the network to a selected number of nodes. This alters the nature of decentralization of a blockchain. Access to the blockchain is restricted to selected number of nodes.

Also, since the people managing the blockchain give access to selected number of users, they know the users behind each node and hence removing any sense of anonymity.

51C902A6-7793-48F8-BAFB-DC7FD6D70A49.png

Hybrid Blockchain

The word hybrid explains itself, meaning a combination of two separate things. Hybrid blockchain applies the use of both Public and Private blockchain at the same time. To explain further, a private blockchain is hosted on a public blockchain, that is there is private blockchain created in a public blockchain.

The private blockchain gives access to just a selected number of nodes to access data and transactions in the public blockchain. Transactions are being validated publicly with the use of smart contracts and there maintains anonymity of users until there is completion of a transaction where the identity of node is then revelation.

Advantages
In the hybrid blockchain, verification of transactions require low computational power and hence the costs of maintenance is low. Also it requires less energy to verify blocks and hence producing cheaper transactions fees.

Also the use of limited access of nodes makes it more secure and fast. This is because, there is a faster rate of verifying and distribution of data. Also there is small number of nodes, hence there is no stress or congestion on the network making activities run very fast.

Disadvantages

One disadvantage the hybrid blockchain has is that, it is restricted to a number of nodes and this makes it not a truly decentralized platform. Also it is managed by people and it may also create suspicions in the network making it less transparent also.

33CE5A83-1765-4613-8E0F-184F65F442DE.png

Consortium Blockchain

In this type of blockchain, it usually comprised of multiple organizations and and it is also similar to that of the hybrid blockchain. It s best described as a semi-private blockchain. The interconnected nodes of the blockchain can only initiate and receive transactions, after which validation of transactions are completed by different nodes from a secondary organization.

This type of blockchain is very fast as compared to the private blockchain and it also gives access to selected nodes. The nodes in the blockchain cannot create blocks of their own. There needs to be verification from other blocks and this makes it easy and fast to locate transactions.

Also, this type of blockchain connects specific nodes to multiple different nodes of a blockchain for easy access of data and then later shared to the connected node of the Consortium Blockchain.
Because of this, not every node can gain access to specific data and due to this restrictions, it makes this blockchain network not truly decentralized.

0B39FC07-7DC6-4A80-AFE9-A5BDCF3BBD53.jpeg

What are the benefits of blockchain?

The blockchain network has proven to very valuable to the world of cryptocurrency. It comes with several positive value to the crypto space and I will explain some of the benefits of Blockchain next.

Security
The one major benefit of blockchain technology is the sense of security on the various platforms. I would say that, blockchain networks are working continuously to improve security on the various platforms in order to make yours feel safe in making transactions and using network.
The security of blockchain network comes from the use of cryptographic property known as Hash which makes it impossible for data to be altered/changed or removed. With this, activities on are guaranteed to be secured since there is a one-way encryption to prevent the network from any hacks.

Decentralization
Data and transactions contained in blocks are scattered all over the blockchain network to connected nodes. This creates some transparency in the system since anybody connected to network can access data and transactions from the blockchain. As result of this, the data found on blockchain are decentralized and this feature makes it one of the major benefits of blockchain technology.

Inexpensive
It takes small charges/fees to perform transactions and it doesn’t matter the distance involved. Users can pay significantly low fees to perform transactions and in a much faster way. But in the traditional system m, one would need to pay higher fees for single transaction and the distance for a transaction usually brings higher transactions fees. This makes blockchain more preferable than the local system.

Immutability
The immutability of blockchain is another outstanding feature that makes it more preferable, in the sense that, any data once stored in block cannot be changed or altered. This removes the factor of suspicion of being cheated in the system. Data are always accurate and cannot be changed or altered to create any confusion or error and also prevents falsified data.

Traceability and Efficiency
In this system, uses can get access to long ago transaction history/details or data in the blockchain. This may include dates, time and amount involved in a transactions and this may help to settle disputes and disagreements. It is made possible because, data on the blockchain are store on nodes connected to the network unlike the traditional system in which data are usually store on sheets and can me lost anytime. Also it very easy to perform transactions on blockchain and at a faster rate too.

5FD63C90-040C-4453-B018-543D8B1ADC86.jpeg

Explain Blockchain Distributed ledger.

This refers to the distribution of blocks that store data and transactions in a blockchain to all connected nodes within network. It is regarded as the basis of decentralized nature of blockchain networks and this makes it completely different to the traditional system such as banks. This ledger provides a copy of the data to all participants within the blockchain network and hence enabling transparency and security of the data.

When a new block is mined, it is then validated to give way for the creation of a new block. After the creation of a new block, the data is duplicated and distributed to all connected nodes within the network through the distribution ledger. This is a measure to ensure that all nodes within the network are kept updated with the data and transactions of a block and permanently stored in the blockchain. This is also a way to improve its security.

Properties of Blockchain Distributed Ledger

Programmable: The distributed ledger uses smart contracts to enable its automated feature. With the use of smart contracts, the blockchain can maintain and distribution data and transactions of trades within the network without users being involved in the process.

Immutability: This property of distributed ledger ensures that once a block is created and validated, it’s details cannot be changed or removed. This makes the blockchain more reliable since the data cannot be falsified.

Distribution: The distributed ledger makes sure all connected nodes are updated with the details of a current data stored and validated. This improved transparency and security in the blockchain.

Security: Through the use of Hash function, it makes sure that data in the blockchain is encrypted and cannot be changed and this makes the network more secure.

Anonymity: The distributed ledger makes sure that the identity of nodes connected to the blockchain network remains hidden. This makes participants enjoy privacy in the blockchain since users cannot identify the person behind a particular node.

FBDF6622-49C2-492E-B6A0-794FFFD34E6E.jpeg

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

Blockchain double spending is a blockchain related problem whereby multiple transactions are carried out with the same amount of crypto asset. This is attack strategy that is used by hackers to target buyers and sellers of cryptocurrency. This type of act cannot happen in traditional system since there is involvement of physical cash to complete a payment of transaction.

For example, to buy an item in the store, you would have to provide physical cash in order to obtain the item. In this case there is no chance of paying double amount for the item since you’re paying with cash.
But with the digital currency, hackers can manipulate the system in such a way that the can copy the details of one single transaction and duplicate it to another users as a form of payment for another item. This case scenario is termed as Racing attack

In another situation, a miner( usually a hacker) can mine a single block and duplicate the details that block and send it to others. This attack only happens if there is a confirmation from the other side. This type of double spending attack is termed as Finney attack.

Also, there is another case in which the double spending occurs, and in this case the hacker use a software to create his own assets and distribute them to users in the blockchain. This type of double spending is called Vector 76 Attack

How Bitcoin handles Blockchain Double Spending
To prevent this type of illegal activity, Bitcoin has adopted a very effective way and that is the use of distributed ledger technology and transactions confirmation by miners. In this case, before a transaction is confirmed it has to be verified and validated by the miners in the blockchain and any unconfirmed transactions is removed from the blockchain.

So in any case a hacker tries to initiate a double spending with one amount, Bitcoin blockchain will first validate and verify the first transaction and after which will now confirm it before moving to the next transaction. With this it is able to detect the multiple transactions initiated by the hackers and remove them from the system.

For example if a hacker plans to initiate a multiple transaction of let’s say $100, the blockchain will take the first $100 transaction validated and verify the transaction. If the user has enough balance to complete the transaction, then it is confirmed and recorded. It then moves to the next $100, if there is not enough balance, that transaction will be removed from the system and hence preventing double spending on the blockchain.

159A2813-AD54-4A3C-B14E-AA9B8B91875E.jpeg

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 hashing is a cryptographic property that blockchain uses to encrypt the block data and transactions. This is the main security feature of a blockchain. I will use Blockchain Demo to further explain below.

Make sure you switch to the “Blockchain” window after opening the website.
Two dialogue boxes will appear.

AF1532CB-2EEA-4F32-89C5-A4F94599F754.jpeg

The image above shows the blockchain structure containing just 4 blocks. And it shows the hash,nounce and block number of each of the block.
By adding the previous hash of each block to the current block, you can identify the link of between each block.

3BE56BD1-497C-4D33-AA51-5B4E2F53E101.jpeg

Block 1
Previous has: 0 since it is the first block and it is also referred to as the genesis block

Hash: 000015783b764259d382017d91a36d206d0600e2cbb3567748f46a33fe9297cf

Block 2
Previous
block:
000015783b764259d382017d91a36d206d0600e2cbb3567748f46a33fe9297cf

Hash: 000012fa9b916eb9078f8d98a7864e697ae83ed54f5146bd84452cdafd043c19

What this simply means is that, the previous block hash value in block 2 is the link between block 2 and block 1. And this is the same thing occurs in the subsequent blocks.

Adding data to a Block in a Blockchain

In the below images, I have changed the nature of the block by entering in new data which is Steemit and Crypto. This automatically changed the Nounce and Hash values of both the 2 blocks I’ve inputed data and this cause a duplicate of the new block of data formed to be sent across the blockchain.

9A8DFCE3-D687-4618-A930-D20BFA306A52.jpeg

5A3754AE-700C-4943-B1A2-BD98942CC63B.jpeg

Also in the above image it can be observed that the color of background has changed to red and the Hash value of each of the blocks do not start with 0000 and this makes them an invalid block. For a block to be valid, it’s Hash value must start with 0000. In order to get a valid block, we’ll have to click on mine or edit the Nounce value which will become very difficult to get the correct value.

After changing the Nounce value I try mining for a valid block and it keeps generating invalid hash value.

To generate a valid Hash value, I clicked on “Mine” and it recalculated a correct Nounce value to produce a valid Hash. And it can be notice that the background of the block has changed to green again, indicating that the block is valid.

D42CFBD8-3B71-4A53-8450-C0FE417B8852.jpeg
Block 1
Hash: 0000e330f777d2b42f01f7ffd082bcbddc1c329ea3288940dab77de8e1f918db
Nounce: 73706

Block 2
Nounce: 87807
Hash: 00003b73681425bd98992e8632dfa47b167cd48e11d8ed741e1438a413ad2391

As it can be seen in the image above, the nounce values have changed and the new hashes start with 0000 indicating that the new blocks are valid.

After trying the same thing on the other blocks, the same valid blocks were created with valid Nounce and Hash values.

DCD8B595-3D3C-47A7-A206-D66190F1B2D9.jpeg

Block 3:
Nounce: 20611
Hash: 0000050dd064855fcbe1f95593c0294b0bff9fb1c695a0d404d06f39d676aa88
Nounce:

Block 4
Nounce: 29675
Hash: 00009158ca52f1b7faa6b988cd6dfd13cdd5c2cfa2d1506e831680d03158a50c

62EBB0A1-D7BA-4BD7-8F3D-59A00E21BA86.jpeg

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

Racing attack Is what I will talk about. This is a type of double spending whereby hackers send multiple transactions to different nodes with one single token with the aim of buying maybe an asset with one amount of the time. The hackers manipulate the system in such a way that they can copy the details of one single transaction and duplicate it to another users as a form of payment for another item.

This type of double spending only happens if the receiver accepts the transaction without confirmation from the miners. Meaning the receiver accepts the transaction to be processed without verification that he/she has acquired the token. And to avoid being a victim of this attack, it is advisable that the receiver has acquired the payment before releasing the item to be purchased.

With this type of attack, Bitcoin has come up with a solution and it makes sure that, one transaction is fully verified and confirmed before another transaction and this leaves the subsequent/duplicate transaction invalid. Hence the multiple transactions are removed from the blockchain.

For example, if a hacker tries to send $100 of BTC to multiple users it takes the first $100 transaction, verifies and confirms it before moving to the next one. Immediately the first transaction is completed, it makes it possible to detect the multiple transactions that the hacker is trying to perform with one single $100. Hence the rest of the transaction are rendered invalid and removed from the blockchain.

6623F7BC-3B2E-4835-A308-8DE05DAED1EA.jpeg

Limitations/disadvantages of Blockchain

Even though there are multiple benefits blockchain comes with, there also some limitations of the system and below are some of them.

Prone to hacks/attacks
Firstly, because blockchain network is opened to wide range of people connected to the internet, it leaves it prone to hack attacks since hackers can also decide to set up a node in the network and launch attacks. With this, hackers are sometimes able to get away with people’s investment.

High Cost of Mining/Maintenance
Mining in the blockchain requires high technology equipment and machines for mining to be done in the blockchain. Also mining consumes a lot of power and energy which makes blockchain mining very costly and expensive.
Also, when the number of nodes increase it will now consume too much energy and hence the cost of maintenance will increase too.

Scalability
Numbers really affect the performance of a blockchain, the smaller the number of participants/nodes in the blockchain the fast the blockchain and vice versa. This means that if the nodes increase, the rate of processing and speed will be significantly slow causing the use of a higher energy and power which definitely increase the transaction fees.

Irreversibility of Transactions
In some cases this property of the blockchain is preferable but in other cases too it is a disadvantage. That is transactions once completed cannot be changed or removed. So in any case you mistakenly send a cryptocurrency to a wrong address, you cannot get back your funds or go back and change the address.
For example on Steemit, instead of sending your Steem to the address @deepcrypto8 to deposit in your Binance wallet and you mistakenly omit the 8 and send it to @deepcrypto, you Steem is lost forever and you cannot get it back.

85EDF14C-7A66-4A53-AAF6-171C0C98EC80.jpeg

Conclusion

From this lecture, I have learnt the broadness of this whole topic “Blockchain”. The types of blockchain, thus Public blockchain, Private blockchain, Hybrid and consortium Blockchain. Blockchain network use Hash as a security feature to keep it safe and secure.
Nodes are the computers that are connected to the blockchain network and blocks contain data and transactions details in the blockchain. The blocks are distributed across the entire blockchain using the distribution ledger technology.

The distribution ledger technology also helps to prevent double spending attacks on the blockchain. And this makes it more safer environment for investment. It has proven to be much more useful for investors because of these numerous features and advantages.

A slight change in data of block changes the entire block Hash and Nounce values and creates duplicate to be redistributed across the network.
In general, the blockchain technology has a much safer and reliable platform to make investment.

Thank you professor @stream4u for this week’s lesson, I have really learned a lot and wish to continue learning in the next lecture to come.

All images used in question 5 answer are screenshots from the website Blockchain demo

Sort:  

Hi @arahman

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

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

Thank you professor for the review. I’ll do my best to improve next time.

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.032
BTC 62596.14
ETH 3021.48
USDT 1.00
SBD 3.65