bitcoin-data / mining-pools

Known Bitcoin mining pool coinbase tags and coinbase output addresses. Generated files: https://github.com/bitcoin-data/mining-pools/tree/generated
MIT License
18 stars 12 forks source link

Add IDs for pools #74

Closed 0xB10C closed 1 year ago

0xB10C commented 1 year ago

For https://github.com/mempool/mining-pools/issues/25. These IDs should not be changed as we want to rely on them in links or in databases as identifiers.

I used the mempool-space slugs where available. See the following script:

#!/usr/bin/env python3

import json
import glob
import sys

entity_files = glob.glob("pools/*.json")

# from https://github.com/mempool/mining-pools/blob/e73a42541eea345eb7bd65c02fa418778f0a909c/pools.json#L1322-L1461
mempool_space_ids = {
    "BlockFills": "blockfills",
    "ULTIMUSPOOL": "ultimuspool",
    "Terra Pool": "terrapool",
    "Luxor": "luxor",
    "1THash": "1thash",
    "BTC.com": "btccom",
    "Bitfarms": "bitfarms",
    "Huobi.pool": "huobipool",
    "WAYI.CN": "wayicn",
    "CanoePool": "canoepool",
    "BTC.TOP": "btctop",
    "Bitcoin.com": "bitcoincom",
    "175btc": "175btc",
    "GBMiners": "gbminers",
    "A-XBT": "axbt",
    "ASICMiner": "asicminer",
    "BitMinter": "bitminter",
    "BitcoinRussia": "bitcoinrussia",
    "BTCServ": "btcserv",
    "simplecoin.us": "simplecoinus",
    "BTC Guild": "btcguild",
    "Eligius": "eligius",
    "OzCoin": "ozcoin",
    "EclipseMC": "eclipsemc",
    "MaxBTC": "maxbtc",
    "TripleMining": "triplemining",
    "CoinLab": "coinlab",
    "50BTC": "50btc",
    "GHash.IO": "ghashio",
    "ST Mining Corp": "stminingcorp",
    "Bitparking": "bitparking",
    "mmpool": "mmpool",
    "Polmine": "polmine",
    "KnCMiner": "kncminer",
    "Bitalo": "bitalo",
    "F2Pool": "f2pool",
    "HHTT": "hhtt",
    "MegaBigPower": "megabigpower",
    "Mt Red": "mtred",
    "NMCbit": "nmcbit",
    "Yourbtc.net": "yourbtcnet",
    "Give Me Coins": "givemecoins",
    "Braiins Pool": "braiinspool",
    "AntPool": "antpool",
    "MultiCoin.co": "multicoinco",
    "bcpool.io": "bcpoolio",
    "Cointerra": "cointerra",
    "KanoPool": "kanopool",
    "Solo CK": "solock",
    "CKPool": "ckpool",
    "NiceHash": "nicehash",
    "BitClub": "bitclub",
    "Bitcoin Affiliate Network": "bitcoinaffiliatenetwork",
    "BTCC": "btcc",
    "BWPool": "bwpool",
    "EXX&BW": "exx&bw",
    "Bitsolo": "bitsolo",
    "BitFury": "bitfury",
    "21 Inc.": "21inc",
    "digitalBTC": "digitalbtc",
    "8baochi": "8baochi",
    "myBTCcoin Pool": "mybtccoinpool",
    "TBDice": "tbdice",
    "HASHPOOL": "hashpool",
    "Nexious": "nexious",
    "Bravo Mining": "bravomining",
    "HotPool": "hotpool",
    "OKExPool": "okexpool",
    "BCMonster": "bcmonster",
    "1Hash": "1hash",
    "Bixin": "bixin",
    "TATMAS Pool": "tatmaspool",
    "ViaBTC": "viabtc",
    "ConnectBTC": "connectbtc",
    "BATPOOL": "batpool",
    "Waterhole": "waterhole",
    "DCExploration": "dcexploration",
    "DCEX": "dcex",
    "BTPOOL": "btpool",
    "58COIN": "58coin",
    "Bitcoin India": "bitcoinindia",
    "shawnp0wers": "shawnp0wers",
    "PHash.IO": "phashio",
    "RigPool": "rigpool",
    "HAOZHUZHU": "haozhuzhu",
    "7pool": "7pool",
    "MiningKings": "miningkings",
    "HashBX": "hashbx",
    "DPOOL": "dpool",
    "Rawpool": "rawpool",
    "haominer": "haominer",
    "Helix": "helix",
    "Bitcoin-Ukraine": "bitcoinukraine",
    "Poolin": "poolin",
    "SecretSuperstar": "secretsuperstar",
    "tigerpool.net": "tigerpoolnet",
    "Sigmapool.com": "sigmapoolcom",
    "okpool.top": "okpooltop",
    "Hummerpool": "hummerpool",
    "Tangpool": "tangpool",
    "BytePool": "bytepool",
    "SpiderPool": "spiderpool",
    "NovaBlock": "novablock",
    "MiningCity": "miningcity",
    "Binance Pool": "binancepool",
    "Minerium": "minerium",
    "Lubian.com": "lubiancom",
    "OKKONG": "okkong",
    "AAO Pool": "aaopool",
    "EMCDPool": "emcdpool",
    "Foundry USA": "foundryusa",
    "SBI Crypto": "sbicrypto",
    "ArkPool": "arkpool",
    "PureBTC.COM": "purebtccom",
    "MARA Pool": "marapool",
    "KuCoinPool": "kucoinpool",
    "Entrust Charity Pool": "entrustcharitypool",
    "BTC Nuggets": "btcnuggets",
    "CloudHashing": "cloudhashing",
    "digitalX Mintsy": "digitalxmintsy",
    "Telco 214": "telco214",
    "BTC Pool Party": "btcpoolparty",
    "Multipool": "multipool",
    "transactioncoinmining": "transactioncoinmining",
    "BTCDig": "btcdig",
    "Tricky's BTC Pool": "trickysbtcpool",
    "BTCMP": "btcmp",
    "Eobot": "eobot",
    "UNOMP": "unomp",
    "Patels": "patels",
    "GoGreenLight": "gogreenlight",
    "BitcoinIndia": "bitcoinindia",
    "EkanemBTC": "ekanembtc",
    "CANOE": "canoe",
    "tiger": "tiger",
    "1M1X": "1m1x",
    "OKMiner": "okminer",
    "Titan": "titan"
}

new_ids = {
    "OKMINER": "okminer",
    "Carbon Negative (unidentified)": "carbonnegative",
    "UKRPool": "ukrpool",
    "TogetherPool": "togetherpool",
    "Bitdeer": "bitdeer",
    "KuCoin Pool": "kucoinpool",  # aka KuCoinPool above
    "Ultimus Pool": "ultimuspool",  # aka ULTIMUSPOOL above
    "Pega Pool": "pegapool",
    "Tiger Pool": "tigerpool",  # aka "tiger" and "tigerpoolnet" above
    "TMSPool": "tmspool",
    "BTCPool": "btcpool",
    "CN/TT": "cntt",
    "SlushPool": "slush",
    "Huobi Pool": "huobipool",
    "BTCPool (unidentified)": "btcpool",
}

ids = {**mempool_space_ids, **new_ids}

for file_path in entity_files:
    with open(file_path, "r") as f:
        e = json.load(f)

        id = ids[e["name"]]
        content = {
            "id": id,
            "name": e["name"],
            "addresses": e["addresses"],
            "tags": e["tags"],
            "link": e["link"],
        }

        del ids[e["name"]]

        with open(file_path, "w") as out:
            json.dump(content, out, indent=2, ensure_ascii=False)
            out.write('\n')

print("ids left:", ids)

This prints the following. I've added commentary on why the name -> id mapping wasn't used.

ids left: {
  'ULTIMUSPOOL': 'ultimuspool',    # renamed "Ultimus Pool"
  'Huobi.pool': 'huobipool',       # rename "Huobi Pool"
  'Braiins Pool': 'braiinspool',   # not yet including Braiins Pool (should be a rename of id=slush)
  'MiningKings': 'miningkings',    # removed earlier
  'tigerpool.net': 'tigerpoolnet', # consolidated with tiger to tigerpool
  'PureBTC.COM': 'purebtccom',     # not yet added
  'KuCoinPool': 'kucoinpool',      # renamed to 'KuCoin Pool'
  'Entrust Charity Pool': 'entrustcharitypool', # never even mined a block? https://mempool.space/mining/pool/entrustcharitypool
  'BTC Pool Party': 'btcpoolparty', # not traced (1PmRrdp1YSkp1LxPyCfcmBHDEipG5X4eJB isn't identificable)
  'tiger': 'tiger',                # consolidated with tigerpoolnet to tigerpool
  '1M1X': '1m1x',                  # Not an identified mining pool, and not yet tracked https://github.com/0xB10C/known-mining-pools/issues/73
  'OKMiner': 'okminer',            # renamed to OKMINER
  'BTCPool': 'btcpool'             # duplicate
}