Crypto Academy / Season 3 / Week 4 - Homework Post for [Crypto Professor @pelon53 ]
Explain in detail the hash rate.
Hashrate(Hash per second, h/s) is the unit used to measure the number of times a double SHA-computations is executed in one second on the bitcoin network during cryptocurrency mining. Another name for Hashrate is hashing power with SI prefix h/s. Hashrate is one of the factors put in place during cryptocurrency mining to evaluate the performance of the blockchain network.
The high the Hastrate, that means high speed in performance by the miner and therefore more processing data in one second. for Bitcoin, Hashrate is the number of time an SHA-256 is calculated for Proof-Of-Work in every second.
Hashrate is measure in units
- k (kilo, 1,000) 1 khash/s indicates 1 thousand hash calculations are done every second
- M (mega, 1 million) 1 Mhash/s indicates 1 million hash calculations are done every second
- G (Giga, 1 billion) 1 Ghash/s indicates 1 billion hash calculations are done every second
- T (Tera, 1 trillion) 1 Thash/s indicates 1 trillion hash calculations are done every second
How to Calculate Hashrate
Hash rate = Number of hashes / time
To conclude Hashrate represents the number of SHA-256 algorithms perform in a second. By taking the block information and converting it to a hash. For simple understanding, miners mine blocks and generate strings of text which are then converted into hashes by the SHA-256 algorithm.
Drawback
- High energy efficiency needed
- High cost in mining as more processing power computers are needed
Make the following Merkle Tree:
Transaction (tree leaves): Steem1; Steem2; Steem3; Steem4; Steem5; Steem6; Steem7; Steem8.
To create a Merkle Tree for the transaction above, I will need to start by generating SHA-256 for all the leaves. We have eight(8) leaves to start transactions. I will be using SHA-256
Steem1
Hash: 7760E25BCB80ADF1DD92DB339BF5790A59E90CD54EFA072F1250DCE13FA97045
Steem2
Hash: FE00506E91CF52BC4B35321E6B978D1A7349397B19C6C1C01E095971FDEC9741
Steem3
Hash: A9418332E0C351D6A50C835AA9E57D514F0573C231D491E97726DB8A5844F2DC
Steem4
Hash: 22F4EC8E20C9CCAF2C313B23F18981B1C73BF39081BCD739E5D998A95A46AB30
Steem5
Hash: 2A3C87336683AB0DDFA56AFEFC740E6C13A02FEA0A43D6797343B26D7AF0C57B
Steem6
Hash: A7BAA6DE0C0658E9E3681966E542BACD116529F5AE9A2D9126CDB1C1D5BC1278
Steem7
Hash: D441688DDA7F9285E8811728DD9A3955CF74F0A3C7600C1589D0F1D3B48FFAC7
Steem8
Hash: F2E38ED4FF662087B6E9BEAFA4158EBC488B995732057BDA019A6A77FFB5F9F5
We completed the hashes for all the leaves, so let move to our first middle hash branch
Steem1Steem2
Hash: A5568957014F6AC3866923C7DE20D375E706B8D8C9F453636E90B9965ABEC62B
Steem3Steem4
Hash: 18D25196DB699F6AB9222B7302EB8A6F6EBFADEC703C07DD5DB8D9455913A499
Steem5Steem6
Hash: D118E137F92A0DBEA138B6BF70C7714153A7BC393CD0272A44BD94864645224B
Steem7Steem8
Hash: A81D57BA11AEDFA9EFBBA42F6523D75D1EFA50B22C5E3557A21CEFFE87DDFC4A
I just completed my first middle hash branch, more transactions to execute for us to get to the Root Hash. Let move to our second middle hash branch.
Steem1Steem2Steem3Steem4
Hash: 8A248C05E69C4F1AA403AD18A7F445FF500C42483DA425CE0C980CDB2FD1AD9B
Steem5Steem6Steem7Steem8
Hash: 8B0935AEAB3F51BFA2B0750703EE2387E2B20EB19B0D24227E180C03A851AF17
As you can see my second middle hash branch is the last middle hash branch for the transaction. My last step will be to generate the Root Hash.
Steem1Steem2Steem3Steem4Steem5Steem6Steem7Steem8
Hash: 9C2FC83F36D59B8ED5033D2BCC417728583C8DAA0AA9868FD374BE3619D6E4F9
Now let create my Merkle Tree
Design using paint by @fombae
2b)
To verify if Steem6 is included in the Merkle Tree, I need to do a breakdown.
- I will need to generate the Hash for Steem5, Steem6, Steem7, and Steem8 (you can see Leave hashes on the Merkle Tree above)
- Next, I put together Steem5Steem6 and Steem7Steem8 to generate their hashes (you can see the First middle hash branch on the Merkle Tree above)
- Now we have both Steem5Steem6 and Steem7Steem8 (Note Steem6 is included in the Steem5Steem6). Now I put together Steem5Steem6Steem7Steem8 and Generate it Hash (you can see the second middle hash branch on the Merkle Tree above).
- Finally, I did not ignore Steem1Steem2Steem3Steem4, just that our interest was Steem6. To complete and have our Root has, i willputtogethere Steem1Steem2Steem3Steem4 and Steem5Steem6Steem7Steem8 to have Steem1Steem2Steem3Steem4Steem5Steem6Steem7Steem8 and generate our hash.
Now I can say Steem6 is included in our Merkle root hash after going through the four-step on the Merkle Tree.
3.- 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.
SCA1
Hash: 13E0A04BB0E669E1C638DBE3A704743F99F162B25245E4D8C064D35BA38FA8C8
SCA2
Hash: 27849353A9C8CC4E948EB6E5748EDD79CB83513D8C0ADAF3E8C83D3792C9149B
SCA3
Hash: 67E872F952C105C35E0BCE130536D061F4999DCA5593754BA9BA7BE59B8E7C0D
SCA4
Hash: 491928A32BAE70A12FA251412BBFD7C9999F317BA6BF577C283C724225270A43
SCA5
Hash: 99C078C39CDE7F47799E0E8691460A9F3E83E78D498EA989308FCFCC58907B19
SCA6
Hash: 7A648D887B124DB14E96E23BA92783E7F26D00957C19B9B8229632C2C1873729
SCA7
Hash: 7E0BBD6BA4BA9896F9911AF46B06DD2C47535F9C80B29D693FDF6B9319D0D68E
SCA8
Hash: 562ABCEEB497E1FE7AE275A883FD5EF9D92A05F5C19D82ABAA0DC1571B7DF3AD
Im done with hashes for the tree leaves, so will move up to the first middle hash branch.
SCA1SCA2
Hash: 91B09BBA815748166FB36413342C7E4E7E809F4BAC538C0418841A4476B527EF
SCA3SCA4
Hash: B49B48697A3ACBC5E3D2E36B6EE49C44020D88E664C5C1AA7A7CF34058177379
SCA5SCA6
Hash: F026924CD1285FF92C2A2DE9B9313027EB67273A82375C939348C887F6B52F77
SCA7SCA8
Hash: AA55EC5A6B11393B289C4B2B6916172ACC2941C5C978FB1D7BF02696BAB323A4
Now im done with my First middle hash branch, Loe move to the second middle hash branch
SCA1SCA2SCA3SCA4
Hash: F50DC120CBF6C46923037F6D7F41D4153ECC9AB7430DDA662C142DB1FFE483F7
SCA5SCA6SCA7SCA8
Hash: A3D8CA8494CC426ABD5E1FC5FA0FEAE4F2B2ECE4C4CECDCA05E19EB66542533F
Finally, we have completed all middle hash branches, let generate the Root hash
SCA1SCA2SCA3SCA4SCA5SCA6SCA7SCA8
Hash: CB40CA6DB72DD507CF9118963F94B7740822258E74AFB0FD45D89DB35D24B386
Merkle Tree with all hashes
Design using paint by @fombae
If the number of leaves on the tree is odd, what should you do? Explain.
well, this is not too complicated, leaves are pair to form branches. if I have an odd leave without a pair, I will hash the leave and keep. As I build up the tree creating branches with pair leaves, I get to the point which will seem to be the root hash. Now because of the pending Leaves hash, I have not yet generated my Root hash.
Now I will use the supposed root hash and pair it with the pending leave hash to generate my Root hash for my odd tree.
Design using paint by @fombae
Hashing is the backbone of blockchain, this is the factor that has boosted the mining process on several blockchain networks. Thanks, @pelon53 for another opportunity to learn more again about hashing.
Thank you for your work! Catch up vote for Daily Report as Greeter Helper on Newcomers Achievement Program(24/06/2021)