Introduction to Blockchain Analytics

As blockchain technology is on the rise there is also a huge potential für analytics applications: Forensics, fraud detection and price forecasting - just to mention a few. In this blog post I would like to give a short introduction on how to analyse blockchain-related data.

Why is blockchain analytics relevant?

Before diving into the analytics part I would like to shortly motivate why analyzing blockchain data is of interest.

Forensics and Fraud Detection

As blockchains and cryptocurrencies have not yet seen much regulations -although goverments are looking into it- it can be used for criminal activities. Its anonymous nature makes it a good candidate to carry out trades on the black market or money laundering. Analysing blockchain data in a behavioral context could help law enforcement agencies fighting cybercrime, inside trading or other criminal activities.

Price Forecasting

Predicting the price of crypto assets is a hot topic for retail traders but also for institutional investment companies. In the context of financial analysis raw blockchain data could be fused with price data, news data which could include possible regulations from goverments or announcements about updates or forks from the community. Social media activities from crypto advisors or influencers could also be merged with the goal to accurately predict the price of crypto currencies.

Data sources for blockchain analytics

Once the analytics-related questions are formulated it is necessary that the relevant blockchain data is gathered. As of now there are various possible data sources and procedures to get hold of data and it pretty much depends on the specific problem you are working on.

Download of blockchain data

The probably fastest and easiest approach is to download relevant blockchain data. One example is this thread on the bitcointalk forum where bitcoin data can be downloaded.

APIs for blockchain data

There are also API providers which offer. For the Ethereum blockchain the etherscan API might be a good starting point. Their API might be used to get account balances, list transactions and event logs. The API is designed in a REST style and uses the HTTP protocol. There is also the websocket protocol used to exchange information about events in realtime. Another option for the Ethereum blockchain is Ethplorer.

Interacting with the blockchain

In some situations relying on external parties to download blockchain data or use their API for queries might not be desired as it introduces dependencies and somehow violates the paradigm of decentralization. In such cases one might directly interact with nodes of the blockchain.

For the Ethereum blockchain there is a JavaScript API which is called web3. This allows you to pull data from the blockchain such as transactions, store the data and run your analytics scripts.

Software and tools for blockchain analytics

Once the apropriate data sources have been identified to address a blockchain analysis problem it is the moment to look into software and tools that can be used to process and store the data. Solutions can range from simple Excel files up to big data pipeline with distributed storage and processing accross multiple nodes.