Steemit Crypto Academy [Intermediate Level Courses] Season 3 Week 4 Homework by @pelon53 "Root Hash And Merkle Tree"

in hive-108451 •  3 years ago 

Hello steemian ...
This is my new post in the Steemit Crypto Academy community, on this season 3 week 4, I will be working on a homework from professor @pelon53 with the theme "Root Hash And Merkle Tree”.

image.webp
SOURCE: https://academy.binance.com/id/articles/merkle-trees-and-merkle-roots-explained

Merkle Tree is a concept that was first put forward by a computer scientist named Ralph Merkle in the 1980s.
Merkle tree is a structure that functions in terms of verifying the truth of data, a Merkle tree can do it efficiently. Discussing the Merkle tree of course also cannot ignore the hash because the hash is the main component of the Merkle tree structure.

For a more specific explanation of this, I will explain it based on the task below:

1. Describe in detail the hash rate.

The hash rate usually represents the health of the Bitcoin network. The higher the hash rate, it means that miners are investing their money in more capable mining equipment. Thus, the blockchain network is considered more secure.
Hash rate is a term that is often used in the crypto world to describe the speed at which a crypto asset is mined. The strength of the hash level depends on the ability of the miner's machine in the process of mining a new block of a crypto asset, also known as a hash function.
The speed of a machine is an important factor in mining a crypto asset because every mining requires a computer with a capable GPU processor level, which also requires strong electricity. Therefore, the hash rate is very important for every miner.
The thing that underlies why the hash rate is quite important is because, in bitcoin mining activities, the hash rate can predict profitability, then the hash rate can also help the miners in determining the machine they will use when mining because each computer device can certainly produce a different hash rate. different, the higher the hash rate means the safer the investment that we will do.
these are the types of hash rate measures used in mining crypto assets and are sorted by unit.

  1. 1 kilo hash (kH/s) = 1,000 hashes per second
  2. 1 mega hash (MH/s) = 1 million hashes per second
  3. 1 Giga hash (GH/s) = 1 billion hashes per second
  4. 1 tera hash (TH/s) = 1 trillion hashes per second
  5. 1 hash map (PH/s) = 1 quadrillion hashes per second
  6. 1 exa hash (EH/s) = 1 quintillion hashes per second
  7. 1 zeta hash (ZH/s) = 1 sextillion hashes per second
  8. 1 yotta hash (YH/s) = 1 septillion hashes per second

2. Create the following Merkle Tree:

2.A Transactions (tree leaves): Steem1; Steem2; Steem3; Steem4; Steem5; Steem6; Steem7; Steem8.

The following is the Merkle tree form of the Steem1 transaction; Steem2; Steem3; Steem4; Steem5; Steem6; Steem7; Steem8 :

steem markle only.JPG

2.B I managed to reach the Root Hash. And put each generated hash using SHA-256 , show screenshot.

For this stage it is required to generate a hash using SHA-256, each hash of Steem1; Steem2; Steem3; Steem4; Steem5; Steem6; Steem7; Steem8 (leaves) are:

  • Steem1 (hash=7760E25BCB80ADF1DD92DB339BF5790A59E90CD54EFA072F1250DCE13FA97045)

steem1.JPG

  • Steem2 (hash=FE00506E91CF52BC4B35321E6B978D1A7349397B19C6C1C01E095971FDEC9741)

steem2.JPG

  • Steem3 (hash=A9418332E0C351D6A50C835AA9E57D514F0573C231D491E97726DB8A5844F2DC)

steem3.JPG

  • Steem4
    (hash=22F4EC8E20C9CCAF2C313B23F18981B1C73BF39081BCD739E5D998A95A46AB30)

steem4.JPG

  • Steem5
    (hash=2A3C87336683AB0DDFA56AFEFC740E6C13A02FEA0A43D6797343B26D7AF0C57B)

steem5.JPG

  • Steem6 (hash=A7BAA6DE0C0658E9E3681966E542BACD116529F5AE9A2D9126CDB1C1D5BC1278)

steem6.JPG

  • Steem7 (hash=D441688DDA7F9285E8811728DD9A3955CF74F0A3C7600C1589D0F1D3B48FFAC7)

steem7.JPG

  • Steem8
    (hash=F2E38ED4FF662087B6E9BEAFA4158EBC488B995732057BDA019A6A77FFB5F9F5)

steem8.JPG

The next stage, we have to create a hash of Steem1Steem2, Steem3Steem4, Steem5Steem6, Steem7Steem8 (First Branches):

• Steem1Steem2
(hash=A5568957014F6AC3866923C7DE20D375E706B8D8C9F453636E90B9965ABEC62B)

Steem1Steem2.JPG

• Steem3Steem4
(hash=18D25196DB699F6AB9222B7302EB8A6F6EBFADEC703C07DD5DB8D9455913A499)

Steem3Steem4.JPG

• Steem5Steem6 (hash=D118E137F92A0DBEA138B6BF70C7714153A7BC393CD0272A44BD94864645224B)

Steem5Steem6.JPG

• Steem7Steem8
(hash=A81D57BA11AEDFA9EFBBA42F6523D75D1EFA50B22C5E3557A21CEFFE87DDFC4A)

Steem7Steem8.JPG

The next step, we have to create hashes of Steem1Steem2Steem3Steem4, and Steem5Steem6Steem7Steem8 (Second-Level Branches):

• Steem1Steem2Steem3Steem4
(hash=8A248C05E69C4F1AA403AD18A7F445FF500C42483DA425CE0C980CDB2FD1AD9B)

Steem1Steem2Steem3Steem4.JPG

• Steem5Steem6Steem7Steem8
(hash=8B0935AEAB3F51BFA2B0750703EE2387E2B20EB19B0D24227E180C03A851AF17)

Steem5Steem6Steem7Steem8.JPG

The last stage, we have to create a hash of Steem1Steem2Steem3Steem4Steem5Steem6Steem7Steem8 (Generate the Root Hash):

• Steem1Steem2Steem3Steem4Steem5Steem6Steem7Steem8
(hash=9C2FC83F36D59B8ED5033D2BCC417728583C8DAA0AA9868FD374BE3619D6E4F9)

Steem1Steem2Steem3Steem4Steem5Steem6Steem7Steem8.JPG

After everything is done, you will be able to form a Markle tree and its hash as follows:

steem markle root.JPG

2.C Tell the steps to follow to verify if Steem6 is included in the Markle Tree.
Before directly verifying whether Steem6 is included in the Merkle tree, we must first identify the Hashes of Steem5, Steem7Steem8, and Steem1Steem2Steem3Steem4. After Identification has been carried out, here are the steps in verifying whether Steem 6 is included in the Merkle tree:

  • The First stage, use SHA-256 or other hash generator websites to create Steem6.
  • The second stage, because in the first stage we have made a hash of Steem6 and have also identified the hash of Steem5 earlier, then combine Steem5 and Steem6 to combine the hash of Steem6, become Steem5Steem6, and calculate the hash.
  • The third stage, combine Steem5Steem6 and Steem7Steem8 (already identified at the beginning) and will become Steem5Steem6Steem7Steem8 and calculate the hash.
  • The fourth stage, at the beginning we have identified the hash of Steem1Steem2Steem3Steem4 and in the third stage we have identified the hash of Steem5Steem6Steem7Steem8, before knowing the two, we combine the two, which is to become the hash of Steem1Steem2Steem3Steem4Steem5Steem6Steem6Steem7Steem (merkle root).

3. Transaction (tree leaf):

3.A Transaction (tree leaf):SCA1; SCA2; SCA3; SCA4; SCA5; SCA6; SCA7; SCA8. Explain each step, show a screenshot.

For this stage it is required to generate a hash using SHA-256, each hash is SCA1; SCA2; SCA3; SCA4; SCA5; SCA6; SCA7; SCA8 (leaves) are:
• SCA1 (hash=13E0A04BB0E669E1C638DBE3A704743F99F162B25245E4D8C064D35BA38FA8C8)

SCA1.JPG

• SCA2 (hash=27849353A9C8CC4E948EB6E5748EDD79CB83513D8C0ADAF3E8C83D3792C9149B)
SCA2.JPG

• SCA3 (hash=67E872F952C105C35E0BCE130536D061F4999DCA5593754BA9BA7BE59B8E7C0D)
SCA3.JPG

• SCA4 (hash=491928A32BAE70A12FA251412BBFD7C9999F317BA6BF577C283C724225270A43)
SCA4.JPG

• SCA5 (hash=99C078C39CDE7F47799E0E8691460A9F3E83E78D498EA989308FCFCC58907B19)
SCA5.JPG

• SCA6 (hash=7A648D887B124DB14E96E23BA92783E7F26D00957C19B9B8229632C2C1873729)
SCA6.JPG

• SCA7 (hash=7E0BBD6BA4BA9896F9911AF46B06DD2C47535F9C80B29D693FDF6B9319D0D68E)
SCA7.JPG

• SCA8 (hash=562ABCEEB497E1FE7AE275A883FD5EF9D92A05F5C19D82ABAA0DC1571B7DF3AD)
SCA8.JPG

The next step, we have to create a hash of SCA1SCA2, SCA3SCA4, SCA5SCA6, SCA7SCA8 (First Branches):

• SCA1SCA2 (hash=91B09BBA815748166FB36413342C7E4E7E809F4BAC538C0418841A4476B527EF)
SCA1SCA2.JPG

• SCA3SCA4 (hash=B49B48697A3ACBC5E3D2E36B6EE49C44020D88E664C5C1AA7A7CF34058177379)
SCA3SCA4.JPG

• SCA5SCA6 (hash=F026924CD1285FF92C2A2DE9B9313027EB67273A82375C939348C887F6B52F77)
SCA5SCA6.JPG

• SCA7SCA8 (hash=AA55EC5A6B11393B289C4B2B6916172ACC2941C5C978FB1D7BF02696BAB323A4)
SCA7SCA8.JPG

In the next step, we have to create hashes of SCA1SCA2SCA3SCA4, and SCA5SCA6SCA7SCA8 (Second-Level Branches):

• SCA1SCA2SCA3SCA4 (hash=F50DC120CBF6C46923037F6D7F41D4153ECC9AB7430DDA662C142DB1FFE483F7)
SCA1SCA2SCA3SCA4.JPG

• SCA5SCA6SCA7SCA8 (hash=A3D8CA8494CC426ABD5E1FC5FA0FEAE4F2B2ECE4C4CECDCA05E19EB66542533F)
SCA5SCA6SCA7SCA8.JPG

Finally, we have to create a hash of SCA1SCA2SCA3SCA4SCA5SCA6SCA7SCA8 (Generate the Root Hash):

• SCA1SCA2SCA3SCA4SCA5SCA6SCA7SCA8 (hash=CB40CA6DB72DD507CF9118963F94B7740822258E74AFB0FD45D89DB35D24B386)

SCA1SCA2SCA3SCA4SCA5SCA6SCA7SCA8.JPG

After everything is done, you will be able to form a markle tree and its hash as follows:
SCA markle root.JPG

3.B If the number of leaves on the tree is odd, what should you do? Explain.
If the number of leaves on the tree is odd and leaves 1 unpaired hash, then the hash will copy itself until it finds a pair and the hash is at an even stage. Example :

If the number of leaves on the tree is odd and leaves 1 unpaired hash, then the hash will copy itself until it finds a pair and the hash is at an even stage. Example :

hash ganjil.JPG

At the Leaves stage, it can be seen that the hash is odd and leaves H5 unpaired so that the hash copies itself as its partner hash. when the First Branches stage, the hash55 (the combination of two 5 hashes) is still odd and unpaired, then it copies itself again. Only at the second-level branches hash the hash becomes even, and no hash has to copy itself, and from the two remaining hashes, it becomes a Merkle root.

Conclusion

Merkle tree is a structure that functions in terms of verifying the truth of data, a Merkle tree can do it efficiently. Discussing the Merkle tree of course also cannot ignore the hash because the hash is the main component of the Merkle tree structure.

The speed of a machine is an important factor in mining a crypto asset because every mining requires a computer with a capable GPU processor level, which also requires strong electricity. Therefore, the hash rate is very important for every miner.

each computer device can certainly produce a different hash rate, the higher the hash rate means the safer the investment we will make.

This is everything I know about “Root Hash And Merkle Tree”, I'm writing this based on some of the references I've studied.

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