logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Henry BehrensAccounting
(5/5)

975 Answers

Hire Me
expert
Earle BirdsellBusiness
(5/5)

805 Answers

Hire Me
expert
Seth PowelllEngineering
(5/5)

652 Answers

Hire Me
expert
Rasmi SehgalSocial sciences
(5/5)

614 Answers

Hire Me
Python Programming

The aim of this lab is to check the validity of the Blockchain. Calculate Hash independently and compare it with stored hash to ensure there is no tampering in the data

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Part 1:

The aim of this lab is to check the validity of the Blockchain. Follow the steps mentioned below:

1- Check Hash Values of all linked blocks, and make sure every block is linked with next.

2- Calculate Hash independently and compare it with stored hash to ensure there is no

tampering in the data.
Tips:

  1. Create class Block and class Blockchain, as mentioned in Lab1.

  2. Create class ChainValidation. In this class, create two functions: head_check() and

integrity_check().

The head_check() function should see and compare the

hashes of each block and see if the previous hash value mentioned in this block header

matches with the actual hash value of the previous block.

If the hashes are not matching,print the message that Blockchain not linked properly, else print that Blocks are linkedproperly.

The integriy_check()function calculate hash independently and compare

it with stored hash to ensure that there is not tampering in the data

Part 2:

Using the Code from part 1.

The aim of this lab is to implement Proof-of-Work (PoW) consensus algorithm of the Blockchain.

Follow the steps mentioned below:

  1. Refer to Lab # 1, step 3, there you provided different parameters values in Blockchain

class, such as difficulty in mining, maxNonce, and target value.

  1. Using the above values, incorporate a function mine() in Blockchain class which will

implement the logic of Proof-of-Work (PoW) consensus algorithm.

For illustration purpose, see the output below, where when we increase the difficulty, the number of

hashes required to mine the block increases.

In the mine() function, you just need to implement this logic: If the value of Hash is less than target, the block is not mined, else increment the nonce and the block is mined successfully. Then print the number of hashes required to mine the block

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme