Crypto Academy / Season 3 / Week 4 - Homework Post for @pelon53

in hive-108451 •  3 years ago 

In this post, I am here to submit my Crypto Academy S3 Task 4, which I have carried as required by prof. @pelon53.

20210724_234932_0000.png

Q. Explain in detail the hash rate.


The rate at which a computing device generate a new block in any blockchain is called Hash Rate. It is denoted by H/S which is called Hash per second.

Hash rate uses proof of work consensus. Hash Rate shows the efficiency of any computing device as it shows that how many hash are solved in how much time.
Which can be expressed mathematically as :-

Number of hash solved by any computing device/time taken by that Device to solve hash

If any computing is having high hash rate this means that computing device is efficient and having speed as it is solving much hash in low time.
On the contrary, any computing device having low hash rate can be termed as inefficient device.

The higher is hash rate, the more chances are to win in solving cryto graphic equation.

For example, if a device is having high hash rate, then it will solve much hash in low time and chances to win to write next block is higher.

How to calculate hash rate

For example, If a computing device is solving 100,000 hashes in 10 second, then

Hash Rate= 100,000/10
= 10,000 H/S

importance of hash rate


  1. Price of computing device mainly depends on hash rate. The higher is hash rate, the costlier is the device.
    As device having high hash rate can solve more cryptographic equation In less time and chances to win is higher.

  2. Blockchain having high hash rate is more hard to hack than those of having low hash rate.

Disadvantages of hash rate


  1. Computing device having high hash rate are much costlier and consumes more energy to operate. Thus is also has more operating cost as well as high cost.

  2. Devices having needs more energy to operate and we know that we are still depend on coal power and nuclear power, it also impact our environment in an indirect way.

Q. Make the following Merkle Tree. Transaction (tree leaves): Steem1; Steem2; Steem3; Steem4; Steem5; Steem6; Steem7; Steem8.

Merkle Leaves Hash


Steem1

Hash:

7760E25BCB80ADF1DD92DB339BF5790A59E90CD54EFA072F1250DCE13FA97045

Screenshot_20210721-212822__01__01.jpg


Steem2

Hash:

FE00506E91CF52BC4B35321E6B978D1A7349397B19C6C1C01E095971FDEC9741

Screenshot_20210721-212928__01.jpg


Steem3

Hash:

A9418332E0C351D6A50C835AA9E57D514F0573C231D491E97726DB8A5844F2DC

Screenshot_20210721-212937__01.jpg


Steem4

Hash:

22F4EC8E20C9CCAF2C313B23F18981B1C73BF39081BCD739E5D998A95A46AB30

Screenshot_20210721-212945__01.jpg


Steem5

Hash:

2A3C87336683AB0DDFA56AFEFC740E6C13A02FEA0A43D6797343B26D7AF0C57B

Screenshot_20210721-212952__01.jpg


Steem6

Hash:

A7BAA6DE0C0658E9E3681966E542BACD116529F5AE9A2D9126CDB1C1D5BC1278

Screenshot_20210721-213000__01.jpg


Steem7

Hash:

D441688DDA7F9285E8811728DD9A3955CF74F0A3C7600C1589D0F1D3B48FFAC7

Screenshot_20210721-213007__01.jpg


Steem8

Hash:

F2E38ED4FF662087B6E9BEAFA4158EBC488B995732057BDA019A6A77FFB5F9F5

Screenshot_20210721-213013__01.jpg

Merkle Branches Hash


Steem1Steem2

Hash:

A5568957014F6AC3866923C7DE20D375E706B8D8C9F453636E90B9965ABEC62B

Screenshot_20210721-214155__01.jpg


Steem3Steem4

Hash:

18D25196DB699F6AB9222B7302EB8A6F6EBFADEC703C07DD5DB8D9455913A499

Screenshot_20210721-214254__01.jpg


Steem5Steem6

Hash:

D118E137F92A0DBEA138B6BF70C7714153A7BC393CD0272A44BD94864645224B

Screenshot_20210721-214309__01.jpg


Steem7Steem8

Hash:

A81D57BA11AEDFA9EFBBA42F6523D75D1EFA50B22C5E3557A21CEFFE87DDFC4A

Screenshot_20210721-214322__01.jpg

Higher Level Merkle Branches Hash


Steem1Steem2Steem3Steem4

Hash:

8A248C05E69C4F1AA403AD18A7F445FF500C42483DA425CE0C980CDB2FD1AD9B

Screenshot_20210721-214413__01.jpg


Steem5Steem6Steem7Steem8

Hash:

8B0935AEAB3F51BFA2B0750703EE2387E2B20EB19B0D24227E180C03A851AF17

Screenshot_20210721-214439__01.jpg

Merkle Root Hash


Steem1Steem2Steem3Steem4Steem5Steem6Steem7Steem8

Hash:

9C2FC83F36D59B8ED5033D2BCC417728583C8DAA0AA9868FD374BE3619D6E4F9

Screenshot_20210721-214531__01.jpg

After generating the Hashes of all levels, Create Merkle Tree

Merkle Tree

20210724_154342_0000__01__01.png

Tell the steps to follow to verify if Steem6 is included in the Markle Tree.*

There are some quite simple steps that we have to follow to verify, if Steem6 is included in Merkle tree or not.

. Step1: The first step is generate the Hash steem5 and check.

IMG-20210724-WA0029.jpg

.Step2: The second step is , Generate the Hash Steem7Steem8 and check it.

Screenshot_20210721-214322__01.jpg

.Step3 :The third step is, Generate the Hash Steem1Steem2Steem3Steem4 on the other side of tree and check it.

Screenshot_20210721-214413__01.jpg

. Step4 :And the last step is, Check the Root hash. Now it will be verified that steem6 is included in Merkle tree

20210724_154342_0000__01__02.png

Q. Using the SHA-256; you must place each complete hash in the Merkle Tree. Transaction (tree leaves): SCA1; SCA2; SCA3; SCA4; SCA5; SCA6; SCA7; SCA8. Explain each step, show screenshots.

Merkle Leaves Hash


SCA1
Hash:

13E0A04BB0E669E1C638DBE3A704743F99F162B25245E4D8C064D35BA38FA8C8

Screenshot_20210721-222224__01.jpg

SCA2
Hash:

27849353A9C8CC4E948EB6E5748EDD79CB83513D8C0ADAF3E8C83D3792C9149B

Screenshot_20210721-222232__01.jpg

SCA3
Hash:

67E872F952C105C35E0BCE130536D061F4999DCA5593754BA9BA7BE59B8E7C0D

Screenshot_20210721-222240__01.jpg

SCA4
Hash:

491928A32BAE70A12FA251412BBFD7C9999F317BA6BF577C283C724225270A43

Screenshot_20210721-222251__01.jpg

SCA5
Hash:

99C078C39CDE7F47799E0E8691460A9F3E83E78D498EA989308FCFCC58907B19

Screenshot_20210721-222259__01.jpg

SCA6
Hash:

7A648D887B124DB14E96E23BA92783E7F26D00957C19B9B8229632C2C1873729

Screenshot_20210721-222305__01.jpg

SCA7
Hash:

7E0BBD6BA4BA9896F9911AF46B06DD2C47535F9C80B29D693FDF6B9319D0D68E

Screenshot_20210721-222313__01.jpg

SCA8
Hash:

562ABCEEB497E1FE7AE275A883FD5EF9D92A05F5C19D82ABAA0DC1571B7DF3AD

Screenshot_20210721-222320__01.jpg

Merkle Branches Hash

SCA1SCA2
Hash:

91B09BBA815748166FB36413342C7E4E7E809F4BAC538C0418841A4476B527EF

Screenshot_20210721-222350__01.jpg

SCA3SCA4
Hash:

B49B48697A3ACBC5E3D2E36B6EE49C44020D88E664C5C1AA7A7CF34058177379

Screenshot_20210721-222415__01.jpg

SCA5SCA6
Hash:

F026924CD1285FF92C2A2DE9B9313027EB67273A82375C939348C887F6B52F77

Screenshot_20210721-222441__01.jpg

SCA7SCA8
Hash:

AA55EC5A6B11393B289C4B2B6916172ACC2941C5C978FB1D7BF02696BAB323A4

Screenshot_20210721-222452__01.jpg

Higher Level Merkle Branches Hash

SCA1SCA2SCA3SCA4
Hash:

F50DC120CBF6C46923037F6D7F41D4153ECC9AB7430DDA662C142DB1FFE483F7

Screenshot_20210721-222525__01.jpg

SCA5SCA6SCA7SCA8
Hash:

A3D8CA8494CC426ABD5E1FC5FA0FEAE4F2B2ECE4C4CECDCA05E19EB66542533F

Screenshot_20210721-222547__01.jpg

Merkle Root Hash

SCA1SCA2SCA3SCA4SCA5SCA6SCA7SCA8
Hash:

CB40CA6DB72DD507CF9118963F94B7740822258E74AFB0FD45D89DB35D24B386

Screenshot_20210721-222647__01.jpg

Merkle Tree

IMG-20210724-WA0031.jpg

So let's discuss what happens when there are leaves on the tree in odd number.

So as we know that in any merkle tree, pairs are formed and those pairs formed the next branch.
But when the number of leaves is odd, in that case, pairs can't be formed and one leave is left

So simply we can't form a merkle tree when the leaves are In odd number.

But there is a solution to this situation as well. Simply we copy the last hash, and can create a pair with the same hash, duplicate of it. This means that even if the tree has an odd number of leaves, the tree can still be constructed and a Root Hash can be generated.

20210724_211657_0000__01__01.png

Thank you

Cc:-
@pelon53

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
Loading...

You have been upvoted by @sapwood, a Country Representative from INDIA. We are voting with the Steemit Community Curator @steemcurator07 account to support the newcomers coming into Steemit.

Engagement is essential to foster a sense of community. Therefore we would request our members to visit each other's post and make insightful comments.

Thank you