Blockchain simulation with Selfish and Stubborn Attacks

As part of the Blockchains course at IIT Bombay, I built a simulator for bitcoin-style blockchains. It supports various parameters including number of nodes, node degree distribution, number of slow/fast-network nodes, number of low/high (cpu-)power nodes, mean of transaction generation and block mining times, and so on. It can simulate around 100,000 seconds worth of events for 100 nodes, accurate to millisecond-intervals, in an hour. Detailed metrics of the revenue ratios and mining success rates (both specificity and selectivity) are saved to logfiles and connectivity graphs and blocktrees are saved as images. I studied the scaling behaviors of Selfish and Stubborn mining attacks as part of the course. There is more information along with the code over at GitHub.