Skip to content

C++ program that is able to calculate merkleRoot from blocks over Bitcoin blockchain to verify transactions

License

Notifications You must be signed in to change notification settings

HarshitJoshi/merkleRoot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Merkle Root

This program can be used to verify transactions using Merkle root of a block over the Bitcoin blockchain using C++. The program fetches block information from an API over the Bitcoin blockchain in JSON format. Then parses through it and calculates the Merkle Root of the block. Later, the information is compared with the derived value to check for inconsistencies.


Prerequisites

The program utilizes the following external libraries:

Recommendations

This program has only been tested using the insight API and Block Explorer API. In the long term, the Block Explorer API has turned out to be more stable out of the two. This program is dependent on the JSON format response of the block information from the API such that the appropriate libraries can calculate the Merkle Root. A sample format has been provided above for the block.json file.

Compiling

The program compiles with the following flags:

-ljsoncpp -lcrypto -lcurl

Debugging

The program allows debugging and view of under the hood SHA-256 and Merkle Trees in the Bitcoin implementation. In order to debug, set the debug variable to true.

\\ debug
bool print = true;

License

This project is licensed under the MIT License - see the LICENSE.md file for more details

About

C++ program that is able to calculate merkleRoot from blocks over Bitcoin blockchain to verify transactions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages