
blockchain
-- EDIT AND UPDATE January 2, 2015 --
This code was refactored over Christmas break of 2014. Changes made were:
Now properly detects 'stealth addresses'
Now properly detects multi-sig addreses
Now properly reports pay-to-script hash addresses
Minor changes to accommodate a much larger blockchain. Now requires a massive amount of memory to run and may not survive another year as it is currently implemented. This code loads the entire blockchain into memory, but now the blockchain is so large this is no longer practical. The code will probably need to be substantially refactored to use some sort of disk-based mechanism to parse the whole blockchain, either memory mapped files or a formal database.
A new report is now generated breaking down the number and volume of new public key addresses generated per day
The program is now command line driven.
The original version had a single source file (blockchain.cpp) to implement everything. The code was cleaned up now, and it has several dependent source files which is easier to follow and maintain
This project contains a single C++ code snippet; one header file, one CPP, with no external dependencies, to rapidly and efficiently parse the raw bitcoin block-chain on your hard drive; assuming you are running the official bitcoin client.
Builds out of the box for either windows with Visual Studio for for Linux using standard make
It also contains individual code snippets to show how to compute an SHA256 and RIPEMD160 hash as well as convert bitcoin addresses to and from binary and ASCII formats.
Finally, it contains a console application which lets you parse and query the blockchain for statistics and reporting.
Here are some of the articles associated with this project:
The main original article:
http://codesuppository.blogspot.com/2013/07/bitcoin-code-snippets.html
An article documenting the blockchain in great deail:
http://codesuppository.blogspot.com/2014/01/how-to-parse-bitcoin-blockchain.html
An article documenting how to use the console app and a binary download:
http://codesuppository.blogspot.com/2014/01/a-command-line-interface-for-blockchain.html
Project Information
The project was created on Jul 1, 2013.
- License: MIT License
- 34 stars
- svn-based source control
Labels:
bitcoin
blockchain
C
Cryptography