, I wrote a set of tools to import data from .bitcoin/blocks/blkXXXXX.dat files into databases and allow you to explore the blockchain on your own PC by running ad-hoc queries of all the main Bitcoin Core data structures including blocks, TX's, inputs, outputs, addresses and more.
It's written in C++ and uses Bitcoin Core itself to read the data, so it's always 100% compliant with the latest Bitcoin release. I abstracted away the database functions, so you can implement "drivers" for any other DB system. I've been playing with it on MySQL but perhaps others would prefer Neo4J or Cassandra for nosql graph analysis.
Once the data is loaded, you can run any database query against it.
I implemented a simple reference Python interface to it so you can play with the blockchain. I made this outer layer in Python but any other language can be easily plugged in, including big data analysis systems like Spark or Hadoop.
Some stuff you can do with it:
- Trace any Bitcoin address funds by building a graph
- Run your own local block explorer without any external API
- Add and subtract inputs/outputs to build whatever statistics
- Plug in viz modules to output graphical stuff from the data
While loading the block files it does some additional work :
- Creates an index of block position in .dat files. Bitcoin Core does this but access to the index is locked while Core is running. With Toolbox you can play with this data even while Bitcoin Core is running independently. With this index you can go back to the raw data any time. This can be turned into a website service and exposed via an API
- Generates a address graph, resolving previous outputs from inputs and building a DB table with source and destination TX's and addresses side by side. It's like a WWW block explorer in your own database which you can query in any way.
Addresses, TX's and all other data structures are decoded by Bitcoin Core itself. The C++ Toolbox links to Bitcoin Core and uses the canonical implementation, so the loaded data is accurate. The Python reference implementation is almost 100% independent from the C++ code (except for configuration code which shares the same parameters and config file as the C++ Toolbox).
Released under the MIT license.
I hope you like playing with it!
Announcement : https://bitcointalk.org/index.php?topic=5211107.0
Docs : https://crypto.bi/tape/toolbox/
Source code: https://github.com/cryptobi/toolbox
Bitcoin was released to the world in 2009 by someone (or a group) who authored a technical whitepaper, released the source code to the protocol and commented on a few p2p forums and mailing lists under the pseudonym Satoshi Nakamoto for a few months prior and a few years afterwards before leaving the project. The project was left in the hands of Gavin Andresson who was another cryptographer that satoshi communicated regularly with on the forums and had been one of the first people involved in the project. Some time after satoshi left, one of his accounts was allegedly hacked and bitcointalk (the primary forum) itself was hacked so a meme kind of emerged that satoshi wouldn't be able to post again from his accounts or that posting from them would be dubious. In 2016 an Australian by the name of Craig S Wright was exposed by Wired
as potentially being the inventor of bitcoin. Craig then signed privately for Gavin Andreson
, Jon Matonis
but then when he was supposed to cryptographically sign to a journalist the method performed did not hold up to public scrutiny because he could have copy pasted a fragment from an earlier known signed message from satoshi and not generated it himself with the private keys. This cast a lot of doubt from many on the man's claims and he published an article saying he wasn't brave enough to sign
Since then the term cryptocurrency has blown out massively to include anything with a distributed ledger technology, a token, a security, and has really just devolved into a cesspit of buzzwords and disinformation. Once satoshi disappeared in 2011 and left the repo in the hands of Gavin and the open source community, it left a power vacuum in the space for how to interpret the protocol, whitepaper and handle the development. Gavin Andresson brought some other developers on board from the forums and mailing lists, Shortly after Gavin gave some other developers commit access, bitcointalk was hacked and these new developers somehow deleted gavin from the github repo due to apparent concern that his account was compromised from the hack and afterwards once he validated his identity in certain accounts he was never given access again. Gavin stopped being involved with the project after that.
In the time following satoshi's departure a meme had evolved that satoshi had left because Gavin had met with the CIA to discuss bitcoin. This meme combined with the interpretation of what satoshi meant when he included the quote "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" in the genesis block, the subsequent rise and fall of silk road and darknet markets, and the general lore of the space, his cypherpunk mailing list associations had led the scene to paint/project upon him as some kind of government hating tax dodging l33t h4xor demigod.
Although in the title of the whitepaper it was described as p2p cash
, bitcoin as most know it is now is marketed as a store of value. Although it was defined as the longest Proof of Work chain of digital signatures, bitcoin as most know it in actual fact has segregated witnesses (signatures) in the protocol. Although satoshi attests to how bitcoin is designed to scale to giant block sizes hosted and mined in data centers that never really hits a scaling ceiling
, it is being sold as that even at 1MB size, the damage has already been done and the blocksize should be 300kB
because every user needs to be able to run a full node for bitcoin to validate their own transactions with the lowest hardware and bandwidth requirements possible. A high vertice count with everyone running a (non-mining) full node is said to protect the network against malicious actions by the big bad government while graph theory states that it is the degree of inter connectivity of the vertcies (edge number) that confers security of the network against sybil attacks as it brings the number of hops down.
This decoupling from the original vision has led to development and scaling of bitcoin stalling for many years which led to the proliferation of many alt coins rising up to claim they possess superior attributes to bitcoin or can work in conjunction with bitcoin in a gold and silver type relationship, or serve a different use case to bitcoin. The debate between the groups that represented the opposing roadmaps reached a climax with bitcoin itself forking into two now separate blockchains with the minority chain being declared the imposter by social media claiming hashpower and the market had chosen despite their chain changing on the protocol level to implement segregated witnesses and reject the block size increase. These two now separate chains both forked again to birth bitcoin gold and diamond on the segwit chain and bitcoin cash and bitcoin sv on the non segwit chain. At the non segwit chain fork, bitcoin cash implemented checkpointing at the protocol level whereas bitcoin sv maintained the original nakamoto consensus and sought to scale greater than the 32MB blocksize limit BCH maintained with 64MB blocks.
Following these forking events both BTC (segwit) and BCH (checkpoints) also implemented Schnorr signatures which was marketed as economising the size of a typical bitcoin transaction though in actual fact it can be used to obfuscate signatures and allow for the mixing of coins to mask the chain of digital signatures and essentially "anonymously" launder money. The BSV chain (now Stewarded by Dr Craig Wright) was then declared the loser of that hash war by people heralding the power of the market and the miners to democratize money. The problem with such a claim though is just like current polical democracy, this apparent democratisation of money was just as susceptible to the influence of those who control the cryptocurrency media and just like in politics, there is a cabal like group that exerts a disproportionate influence over the narrative and appears to serve the interests of those in on the racket rather than those it is allegedly informing.
The main forums for discussion of cryptocurrency originally were bitcoin.org
with all three of them for some time sharing the same moderator theymos
. Coindesk and the bitcoinmagazine (started by ethereum devs) were some early sources, talking heads like andreas antonopolos (andreasma
), peter todd
) and greg maxwell (nullc
) being propped up as sources of knowledge on what is the best course of action for scaling and endorsing solutions like small blocks, second layer solutions and segwit as a necessarry bitcoin improvement protocol (BIP) while people like Roger Ver
dealers) and Dr Craig Wright
) endorsing a block size increase. Because the core developers had chosen to scale with small blocks and lots of nodes on the network were signalling in support of Segwit any discussion of a big block alternative was considered discussion of an alt coin and deleted and eventually users banned from /bitcoin
. Out of that incident /btc
emerged as an apparently censorship free forum for the discussion of all scaling plans for bitcoin but was ultimately a partisan sub populated with dejected big blockers. After the BCH fork, discussion for bitcoin sv exists on a few subs /bsv
(modded by BCHers), /bitcoinsv
(moderated by the lead technician at nChain (Craig Wright's company) and /bitcoincashsv
where many users have been banned from both /bitcoin
Now this so far is just kind of a synposis of the history of bitcoin covering all three of the main contenders for the legitimate claimant of the name but the part 2 will look more at what kind of drastically different societies would be built upon the different versions of the protocol and what may seem like their subtle differences and which one is likely to succeed.