Skip to content

Code for "Bitcoin and carbon dioxide emissions: Evidence from daily production decisions" by Anna Papp, Douglas Almond, and Shuang Zhang - published in the Journal of Public Economics (2023).

Notifications You must be signed in to change notification settings

pappanna/bitcoin_co2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Bitcoin and carbon dioxide emissions: Evidence from daily production decisions

Code and data for Bitcoin and carbon dioxide emissions: Evidence from daily production decisions, by Anna Papp, Douglas Almond and Shuang Zhang, published in the Journal of Public Economics (2023).

Abstract: Environmental externalities from cryptomining may be large, but have not been linked causally to mining incentives. We exploit daily variation in Bitcoin price as a natural experiment for an 86 megawatt coal-fired power plant with on-site cryptomining. We find that carbon emissions respond swiftly to mining incentives, with price elasticities of 0.69-0.71 in the short-run and 0.33-0.40 in the longer run. A $1 increase in Bitcoin price leads to $3.11-$6.79 in external damages from carbon emissions alone, well exceeding cryptomining’s value added (using a $190 social cost of carbon, but ignoring increased local air pollution). As cryptomining requires ever more computing power to mine a given number of blocks, our study highlights both the revitalization of US fossil assets and the need for financial industry accounting to incorporate cryptomining externalities.

Code for Replicating Paper

After downloading appropriate data files, run the following scripts in the below order.

00_clean_data: Code related to data cleaning.

  • 00_clean_data.R: Clean and combine various data sources into main data file.
    • Requires files in data/bitcoin, data/coal, data/grid, data/weather, and data/emissions folders.
    • Creates data/processed/00_data.rda and data/processed/00_data.csv

01_regressions: Code related to running regressions presented in main and appendix tables.

02_charts: Code related to creating charts in paper.

03_context_extvalidity: Code related to external validity / context figures.

04_ripeforretirement: Code related to ripe for retirement calculations and figures.

  • 04_rfr_distribution.R: Created Appendix Figure A6
    • Requires files in data/annual_emissions, data/ripe_for_retirement, and data/other folders.

Data for Replicating Paper

Bitcoin Data

  • bitcoin-daily-nasdaq.csv: Bitcoin daily price downloaded from NASDAQ
  • bitcoin_difficulty.csv: Bitcoin network difficulty downloaded from NASDAQ
  • bitcoin-hashrate-reward.csv: Bitcoin network hashrate downloaded from NASDAQ
  • country-hashrate.csv: Countries' share of hashrate downloaded from CCAF

CEMS Emissions Data

  • daily-emissions-scrubgrass.csv: Emissions data for Scrubgrass, downloaded from the EPA, filtering for Scrubgrass power plant
  • daily-emissions-panther.csv: Emissions data for Panther Creek, downloaded from the EPA, filtering for Panther Creek power plant
  • daily-emissions-PA-waste.csv: Emissions data for other PA waste coal power plants, downloaded from the EPA, filtering for state (PA) and type of fuel (Coal, Waste Coal)

Coal Price

  • weekly-coal-northern-appalachia.csv: Weekly coal spot price collected from the EIA

PJM Grid Data

  • hourly-penelec.csv: Hourly day-ahead LMP for PENELEC zone of PJM downloaded from PJM
  • hourly-pjm.csv: Hourly day-ahead LMP for PENELEC zone of PJM downloaded from PJM
  • hourly-marginal-emissions.csv: Hourly marginal emissions (for recent months) downloaded from PJM

PJM Grid Weather Data

  • GEE: First, code is run on Google Earth Engine to calculate temperature in each grid cell. Use this code: https://code.earthengine.google.com/7b4aac9b43c339db67b8b8fec64ef18f to generate the below files
  • sumpop.csv: Population for each grid cell
  • sumprecip_YEAR.csv: Precipitation in each grid cell, for each year
  • sumtemp_YEAR.csv: Temperature in each grid cell, for each year

Annual Emissions Data

  • annual-emissions-2012-coal.csv: Annual emissions for all US power plants downloaded from the EPA, filtering for 2012 and coal power plants
  • annual-emissions-2022-coal.csv: Annual emissions for all US power plants downloaded from the EPA, filtering for 2022 and coal power plants
  • annual-emissions-2022-gas.csv: Annual emissions for all US power plants downloaded from the EPA, filtering for 2022 and gas power plants
  • annual-emissions-2022-oil.csv: Annual emissions for all US power plants downloaded from the EPA, filtering for 2022 and oil power plants
  • annual-emissions-2022-other.csv: Annual emissions for all US power plants downloaded from the EPA, filtering for 2022 and other power plants
  • annual-emissions-pa-coal.csv: Annual emissions for all US power plants downloaded from the EPA, filtering for state (PA) and coal power plants
  • annual-emissions-pa-coalpet.csv: Annual emissions for all US power plants downloaded from the EPA, filtering for state (PA) and coal pet power plants
  • annual-emissions-pa-coalrefuse.csv: Annual emissions for all US power plants downloaded from the EPA, filtering for state (PA) and coal refuse power plants

Carbon Accounting Data for Balancing Authorities

  • Download data for 2021 for each balancing authority from Singularity

Ripe for Retirement Data

Other Data

  • coal-type.csv: This file collects information on the coal type used by certain power plants from GEM Wiki

About

Code for "Bitcoin and carbon dioxide emissions: Evidence from daily production decisions" by Anna Papp, Douglas Almond, and Shuang Zhang - published in the Journal of Public Economics (2023).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published