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
19 stars 12 forks source link

Change JSON scheme: Tag and address maps to list of pools #38

Closed 0xB10C closed 1 year ago

0xB10C commented 3 years ago

I've been thinking about changing the JSON schema.

Currently, pools.json contains two maps. One for mapping tags to pools and one for mapping addresses to pools.

{
   "coinbase_tags" : {
       "/pool a tag/": {
           "name": "Pool A",
           "link": "website pool a"
       },
   },
   "payout_addresses" : {
       "1Ea8eoaAddrToPoolASeryj3AXd3swuJ": {
           "name": "Pool A",
           "link": "website pool a"
       },
}

This results in a lot of duplicate data and has been an error source (e.g. "BitcoinIndia" vs. "Bitcoin India" as seen in #36).

I propose to have a single list of pool objects which each have a list of tags and addresses.

[
    {
       "name": "Pool A",
       "link": "website pool a",
       "tags": [
         "/pool a tag/",
       ],
       "addresses": [
          "1Ea8eoaAddrToPoolASeryj3AXd3swuJ",
       ],
    }
]

The goal is to make this more maintainable and reduce the error surface.

The old schema could still be automatically generated from the new schema.

mutatrum commented 3 years ago

Maybe do the root level as a map? This enforces uniqueness of pools.

E.g.:

{
    "Pool A": {
       "url": "website pool a",
       "tags": [
         "/pool a tag/",
       ],
       "addresses": [
          "1Ea8eoaAddrToPoolASeryj3AXd3swuJ",
       ],
    },
    "Pool B": {

    }
}
0xB10C commented 3 years ago

That's a good point!