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.
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.
- 01a_main_regressions.R: Creates Table 1
- 01b_appendix_bounding.R: Creates Appendix Table A2
- 01c_appendix_timeseries.do: Creates Appendix Table A3
- 01d_appendix_timeseries_regressions.R: Creates Appendix Table A4
- 01e_appendix_fixed_effects.R: Creates Appendix Table A5 and A6
- 01f_appendix_other_robust.R: Creates Appendix Tables A7 - A13, A16, A17
- 01g_appendix_other_coal.R: Creates Table A14
- All scripts require data/processed/00_data.rda created in 00_clean_data.R
02_charts: Code related to creating charts in paper.
- 02a_hashrate_chart.do: Creates Figures 1 and 2
- 02b_demean_charts.do: Creates Figure 3 and Appendix Figure A7
- All scripts require data/processed/00_data.csv created in 00_clean_data.R
03_context_extvalidity: Code related to external validity / context figures.
- 03a_context_extvalidity_all_plants.R: Creates Figure 4
- Requires files in data/annual_emissions and data/other folders.
- 03b_context_extvalidity_ba.R: Creates Appendix Figure A8
- Requires files in data/ba_carbon_accounting folder.
- 03c_context_extvalidity_pa.R: Creates Appendix Figure A5
- Requires files in data/annual_emissions and data/other folders.
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.
- 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
- 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)
- weekly-coal-northern-appalachia.csv: Weekly coal spot price collected from the EIA
- 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
- 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-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
- Download data for 2021 for each balancing authority from Singularity
- ripe-for-retirement-with-facility-id-high.csv: Digitized version of table from this report (Table E-2) from the Union of Concerned Scientists
- ripe-for-retirement-with-facility-id-low.csv: Digitized version of table from this report (Table E-3) the Union of Concerned Scientists
- coal-type.csv: This file collects information on the coal type used by certain power plants from GEM Wiki