Archived: GitHub - kylemcdonald/ethereum-nft-activity: Estimate the total emissions for popular CryptoArt platforms.

This is a simplified archive of the page at https://github.com/kylemcdonald/ethereum-nft-activity

Use this page embed on your own site:

Estimate the total emissions for popular CryptoArt platforms. - GitHub - kylemcdonald/ethereum-nft-activity: Estimate the total emissions for popular CryptoArt platforms.

ReadArchived

ethereum-nft-activity

How much energy does it take to power popular Ethereum-backed CryptoArt platforms? And what emissions are associated with this energy use?

These questions do not have clear answers for two reasons:

  1. The overall energy usage and emissions of Ethereum are hard to estimate. I am working on this in a separate repo: kylemcdonald/ethereum-energy
  2. The portion for which a specific user, platform, or transaction might be considered "responsible" is more of a philosophical question than a technical one. Like many complex systems, there is an indirect relationship between the service and the emissions. I am working on different approaches in this notebook: Per-Transaction Models

This table represents one method for computing emissions, as of March 5, 2022. The methodology is described below.

Name Fees Transactions kgCO2
Art Blocks 12,006 244,594 21,531,626
Async 224 27,403 332,657
Foundation 8,602 661,074 14,568,164
KnownOrigin 507 64,326 904,455
Makersplace 1,840 144,163 3,010,383
Nifty Gateway 1,621 151,950 2,385,675
OpenSea 314,515 20,012,086 551,268,013
Rarible 20,930 1,802,971 27,706,539
SuperRare 2,215 320,697 3,172,169
Zora 532 21,660 721,254

Updates:

  • March 5, 2022: Missing contracts were added to Art Blocks and OpenSea, massively incresaing their totals. Duplicate contracts were removed remove Nifty Gateway, halving the totals. The contracts were duplicated because they were found both when scraping Nifty Gateway, and also when pulling labeled contracts from Etherscan.

Preparation

First, sign up for an API key at Etherscan. Create env.json and add the API key. It should look like:

{
    "etherscan-api-key": "<etherscan-api-key>"
}

Install dependencies:

pip install -r requirements.txt

Note: this project requires Python 3.

contracts_footprint.py

This will pull all the transactions from Etherscan, sum the gas and transaction counts, and do a basic emissions estimate. Results are saved in the /output directory as JSON or TSV. Run the script with, for example: python contracts_footprint.py --verbose --tsv data/contracts.json data/nifty-gateway-contracts.json.

This may take longer the first time, while your local cache is updated. When updating after a week, it can take 5 minutes or more to download all new transactions. The entire cache can be multiple gigabytes.

This script has a few unique additional flags:

  • --summary to summarize the results in a format similar to the above table, combining multiple contracts into a single row of output.
  • --startdate and --enddate can be used to only analyze a specific date range, using the format YYYY-MM-DD.
  • --tsv will save the results of analysis as a TSV file instead of JSON.

contracts_history.py

This will pull all the transactions from Etherscan, sum the transaction fees and gas used, and group by day and platform. Results are saved in the /output directory as CSV files. Run the script with, for example: python contracts_history.py --verbose data/contracts.json data/nifty-gateway-contracts.json

The most recent results are cached in the gh_pages branch.

Additional flags

Both scripts have these shared additional flags:

  • --noupdate runs from cached results. This will not make any requests to Nifty Gateway or Etherscan. When using the Etherscan class in code without an API key, this is the default behavior.
  • --verbose prints progress when scraping Nifty Gateway or pulling transactions from Etherscan.

Helper scripts

  • python ethereum_stats.py will pull stats from Etherscan like daily fees and block rewards and save them to data/ethereum-stats.json
  • python nifty_gateway.py will scrape all the contracts from Nifty Gateway and save them to data/nifty-gateway-contracts.json

Methodology

The footprint of a platform is the sum of the footprints for all artwork on the platform. Most platforms use a few Ethereum contracts and addresses to handle all artworks. For each contract, we download all the transactions associated with that address from Etherscan. Then for each day, we take the sum of all fees paid on all those transactions divided by the total fees paid across the whole network for that day. This ratio is multiplied by the daily Ethereum emissions estimate to get the total emissions for that address. Finally, the total emissions for a platform are equal to the emissions for all addresses across all days.

Sources

Contracts are sourced from a combination of personal research, DappRadar, and Etherscan tags.

When possible, we have confirmed contract coverage directly with the marketplaces. Confirmed contracts include:

  • SuperRare: all confirmed
  • Foundation: all confirmed
  • OpenSea: some contracts on DappRadar have not been confirmed
  • Nifty Gateway: all confirmed

How to add more platforms

To modify this code so that it works with more platforms, add every possible contract and wallet for each platform to the data/contracts.json file, using the format:

'<Platform Name>/<Contract Name>': '<0xAddress>'

Then submit a pull request back to this repository. Thanks in advance!

Contracts and Addresses

Contracts and addresses used by each platform can be found in data/contracts.json and are also listed here using python print_contracts.py to generate Markdown. Nifty Gateway contracts are listed separately in data/nifty-gateway-contracts.json.

Art Blocks

Async

  • ASYNC 2020-02-25 to 2021-12-21
  • ASYNC-V2 2020-07-21 to 2022-01-09

Foundation

KnownOrigin

Makersplace

Nifty Gateway

OpenSea

Rarible

SuperRare

Zora