Analyzing Ethereum Classic with Google BigQuery
By: Yaz Khoury
Tags: Bigquery, Data Science, Ethereum Classic, Blockchain, Decentralization

I’m happy to announce, through collaboration with Allen Day and Evgeny Medvedev of Google, Ethereum Classic is now part of the Google BigQuery dataset. There’s even a CoinDesk article about it.

This means that now, it’s more easier than ever to query the Ethereum Classic network using regular SQL which allows for more seamless data analysis. You can also download the datasets directly in Kaggle to use in your notebooks for analysis.

Why is this a Big Deal?

Blockchains are most accessible to cryptography and blockchain engineers, who are most familiar with the inner workings of the client and viewing the data. On the finance side, analysts mostly observe market data. For your average data scientist or entrepreneur who wants to do quick analysis of block data, they’re stuck with running their own Geth or Parity node and trying to parse it. Even if that’s successful, they need to continue doing so to keep up to date with more recent Ethereum Classic data.

With the Ethereum Classic dataset being constantly available on Google BigQuery and continuously updating daily, researchers, entrepreneurs and stakeholders can quickly analyze Ethereum Classic’s network and blocks without having to worry about the data engineering aspects or their cloud infrastructure or node setups. They can just focus on the data science and let us do all the rest!

How Did This Project Come About?

We at the ETC Cooperative always believed the most important stories can be told with data, and Ethereum Classic is no exception. We were planning on quantifying Ethereum Classic’s decentralization for a while now, along with many other analysis we want to explore. For your average data scientist, getting blockchain data can be tricky, if not daunting.

It immediately seemed clear to us there was no easy way to query Ethereum Classic’s blockchain history, so we set about looking for solutions.

Apache Airflow is used to update the dataset daily

I’ve stumbled upon the Ethereum-ETL library developed by Evgeny Medvedev to parse EVM based data, and quickly worked with him on adding more features to allow it to parse Ethereum Classic nodes. We also used Apache Airflow, a powerful workflow library, to update the Ethereum Classic dataset daily. It was all adapted from the original project for Ethereum dataset. If you would like to know how it was built or you’d like to build your own, check out this post.

Analyzing The Ethereum Classic Dataset

The Ethereum Classic dataset contains several tables, like blocks , transactions and traces which contains lots of interesting information about the blockchain activity. Furthermore, you can even analyze traces and smart contracts (who wants to analyze the DAO smart contract before and after the hack?). For more ideas on how what you can analyze with smart contracts, check out this post.

In this Medium post, we will show our analysis of a few interesting things we found in Ethereum Classic.

We set out to quantify decentralization in Ethereum Classic. For that, we will measure the Gini Coefficient of Ethereum Classic using BigQuery. The Gini coefficient is a measure of the income or wealth distribution of a population.

We will use it in two instances here:

1) Daily Top 10K Account Balances

2) Daily Mining Rewards.

Furthermore, we will be using Balaji Srinivasan’s “Nakamoto Coefficient” for further analysis of Ethereum Classic, as discussed in his blog post Quantifying Decentralization. Nakamoto Coefficient is a proposed measure by Balaji regarding a blockchain’s subsystem. It measures what is the minimum number of entities that can influence more than 51% of a subsystem. To check out that, head on over to Analyzing ETC With Nakamoto Coefficient section below. Over there, we also introduce the nakamoto Python library I’ve built for data analysis.

Running SQL on BigQuery

The following queries and plots have full source code in this Kaggle notebook that you can clone and run on your own.

With BigQuery, we can run a query to get the average daily hash rate as shown in the following plot.

We can plot the output of the following query for the hash rate using Plotly with the following graph shown here, measured in Giga hash.