{"id":13651104,"url":"https://github.com/mcdee/blockparser","last_synced_at":"2025-04-22T22:30:29.698Z","repository":{"id":8246003,"uuid":"9691248","full_name":"mcdee/blockparser","owner":"mcdee","description":"Fast, quick and dirty bitcoin blockchain parser","archived":false,"fork":true,"pushed_at":"2021-10-05T09:20:58.000Z","size":292,"stargazers_count":60,"open_issues_count":0,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-22T02:21:27.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"znort987/blockparser","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mcdee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-26T08:54:09.000Z","updated_at":"2025-03-06T14:46:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mcdee/blockparser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcdee%2Fblockparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcdee%2Fblockparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcdee%2Fblockparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcdee%2Fblockparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcdee","download_url":"https://codeload.github.com/mcdee/blockparser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250333852,"owners_count":21413468,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T02:00:45.192Z","updated_at":"2025-04-22T22:30:29.431Z","avatar_url":"https://github.com/mcdee.png","language":"C++","funding_links":[],"categories":["Blockchain dump","Blockchain Playgrounds","awesome Bitcoin"],"sub_categories":["E-Books"],"readme":"blockparser\n===========\n\n    Credits:\n    --------\n\n        Written by znort987@yahoo.com\n        If you find this useful: 1ZnortsoStC1zSTXbW6CUtkvqew8czMMG\n\n    What:\n    -----\n\n        A fairly fast, quick and dirty bitcoin whole blockchain parser.\n\n    Why:\n    ----\n\n        . Few dependencies: openssl-dev, boost\n\n        . Very quickly extract information from the entire blockchain.\n\n        . Code is simple and helps to understand how the data structure underlying bitcoin works.\n\n    Build it:\n    ---------\n\n        . Turn your x86-64 Ubuntu box on\n\n        . Make sure you have an up to date satoshi client blockchain in ~/.bitcoin\n\n        . Run this:\n\n            sudo apt-get install libssl-dev build-essential g++-4.4 libboost-all-dev libsparsehash-dev git-core perl\n            git clone git://github.com/znort987/blockparser.git\n            cd blockparser\n            make\n\n    Try it:\n    -------\n\n        . Compute simple blockchain stats, full chain parse (\u003c 1 second)\n\n            ./parser simpleStats\n\n        . Extract all transactions for popular address 1dice6wBxymYi3t94heUAG6MpG5eceLG1 (20 seconds)\n\n            ./parser transactions 06f1b66fa14429389cbffa656966993eab656f37\n\n        . Compute the closure of an address, that is the list of addresses that provably belong to the same person (20 seconds):\n\n            ./parser closure 06f1b66fa14429389cbffa656966993eab656f37\n\n        . Compute and print the balance for all keys ever used in a TX since the beginning of time (30 seconds):\n\n            ./parser allBalances \u003eallBalances.txt\n\n        . See how much of the BTC 10K pizza tainted each of the TX in the chain\n\n            ./parser taint \u003epizzaTaint.txt\n\n        . See all the block rewards and fees:\n\n            ./parser rewards \u003erewards.txt\n\n        . See a greatly detailed dump of the pizza transaction\n\n            ./parser show\n\n    Caveats:\n    --------\n\n        . You need an x86-84 ubuntu box and a recent version of GCC(\u003e=4.4), recent versions of boost\n          and openssl-dev. The whole thing is very unlikely to work or even compile on anything else.\n\n        . It needs quite a bit of RAM to work. Never exactly measured how much, but the hash maps will\n          grow quite fat. I might switch them to something different that spills over to disk at some\n          point. For now: it works fine with 8 Gigs.\n\n        . The code isn't particularly clean or well architected. It was just a quick way for me to learn\n          about bitcoin. There isnt much in the way of comments either.\n\n        . OTOH, it is fairly simple, short, and efficient. If you want to understand how the blockchain\n          data structure works, the code in parser.cpp is a solid way to start.\n\n    Hacking the code:\n    -----------------\n\n        . parser.cpp contains a generic parser that mmaps the blockchain, parses it and calls\n          \"user-defined\" callbacks as it hits interesting bits of information.\n\n        . util.cpp contains a grab-bag of useful bitcoin related routines. Interesting examples include:\n\n            showScript\n            getBaseReward\n            solveOutputScript\n            decompressPublicKey\n\n        . cb/allBalances.cpp    :   code to all balance of all addresses.\n        . cb/closure.cpp        :   code to compute the transitive closure of an address\n        . cb/csv.cpp            :   code to product a CSV dump of the blockchain\n        . cb/dumpTX.cpp         :   code to display a transaction in very great detail\n        . cb/help.cpp           :   code to dump detailed help for all other commands\n        . cb/pristine.cpp       :   code to show all \"pristine\" (i.e. unspent) blocks\n        . cb/rewards.cpp        :   code to show all block rewards (including fees)\n        . cb/simpleStats.cpp    :   code to compute simple stats.\n        . cb/sql.cpp            :   code to product an SQL dump of the blockchain\n        . cb/taint.cpp          :   code to compute the taint from a given TX to all TXs.\n        . cb/transactions.cpp   :   code to extract all transactions pertaining to an address.\n\n\n        . You can very easily add your own custom command. You can use the existing callbacks in\n          directory ./cb/ as a template to build your own:\n\n                cp cb/allBalances.cpp cb/myExtractor.cpp\n                Add to Makefile\n                Hack away\n                Recompile\n                Run\n\n        . You can also read the file callback.h (the base class from which you derive to implement your\n          own new commands). It has been heavily commented and should provide a good basis to pick what\n          to overload to achieve your goal.\n\n        . The code makes heavy use of the google dense hash maps. You can switch it to use sparse hash\n          maps (see util.h, search for: DENSE, undef it). Sparse hash maps are slower but save quite a\n          bit of RAM.\n\n    License:\n    --------\n\n        Code is in the public domain.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcdee%2Fblockparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcdee%2Fblockparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcdee%2Fblockparser/lists"}