polkadot-js / api

Promise and RxJS APIs around Polkadot and Substrate based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides in terms of metadata.
Apache License 2.0
1.07k stars 354 forks source link

Is there an official substrate-based chain-list with chain-ids within polkadot-js? #5345

Closed wottpal closed 1 year ago

wottpal commented 1 year ago

Hey!

From the EVM-ecosystem, I was used to having an official chain ID for every chain (e.g. 1 for Ethereum Mainnet, 137 for Polygon, etc.). See the following repositories/files on GitHub for reference:

Is there something equivalent for Substrate-based chains? I'm asking here because I assume you have something like this in polkadot-js already somewhere. I'm currently building a boilerplate for dynamic multi-chain usage, and something like this would come in handy, otherwise, I would have to define inofficial IDs myself. The only things I could find via search:

ty in advance

jacogr commented 1 year ago

This is not Ethereum, so there is no chain id.

There is the ss58 prefixes that can be used for address encoding, see https://github.com/paritytech/ss58-registry which is probably closest to a "list of chains" (Testnets are not registered in this list, they should always use the general 42 prefix for addresses)

The first repo you linked to is only for Ledger apps, aligning with the Ledger repo by ZondaX - some chains have Ledger apps, some do not. (Cannot comment on the second link)

wottpal commented 1 year ago

Thank you for the reference to ss58-registry, really appreciated! I probably have to use network string identifiers to be also able to separate testnets from each other, but that's not a big deal. I just wanted to make sure I don't miss out on anything :)

ty

polkadot-js-bot commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.