Skip to content

This project was offered by Association for Computing Activities (ACA), IIT Kanpur to first-year UG students.

Notifications You must be signed in to change notification settings

mandar7-git/Blocks_and_Chains-ACA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blocks_and_Chains-ACA

This project was offered by Association for Computing Activities (ACA), IIT Kanpur to first-year UG students.

It was based on finding the nonce for a given string. We had to write a program that takes some data as string input. Then it tries to find a positive number x such that when x is appended to the end of the string, the SHA256 hash of this new string is less than the target, which is
0x0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.

The code logs the required nonce and the final hash of the string for you!

The related theory.

It was based on verifying signatures. We had to verify if the public key can decrypt the encrypted text, and that the decrypted text was equal to the unencrypted text provided by the user.

Assignment 3.js file takes inputs to create a .dat file containing the hash of the Transaction data.

Given the index of the block, the hash of the parent block, the target value and a binary file which contains the block body, Assignment5.js calculates the block header for this block and finds a suitable nonce value.

Aim was to create a simple web server listening on port 8787 with an endpoint which calculates the SHA-256 hash of the given string, converts it to hexadecimal representation, and returns it as JSON encoded data. Assignment6.js contains the relevant code.

About

This project was offered by Association for Computing Activities (ACA), IIT Kanpur to first-year UG students.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published