-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference Accounts per CAIP-10 #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great :D
The only thing that is wrong with this PR that should be fixed before merging, is that there isn't any specifications as far as I know to reference polkadot blockchain IDs CAIP-2 is a very generic for blockchain IDs which in turn have more specific CAIPs that define for each blockchain namespace. For Ethereum we got CAIP-3, for Bitcoin we got CAIP-4 While it's not required to create a CAIP to add Polkadot, it would be important define a more specific namespace for Polkadot account IDs other than my draft PS - this shouldnt be a blocker but it would be better to ask someone from the Polkadot community to fix it before merging |
Polkadot addresses already contain a network identifier (some details here https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)) but this is only enforced on the frontend (which converts addresses to a raw pubkey in most cases). other than that, there aren't any standards I'm aware of to disambiguate between chains, I think the right place to start would be to grab either spec_name as declared by individual chains (which you can grab using the |
That's very helpful @joshua-mir! Looking at your link it seems like there are only 48 address types that refer to networks. Is that right, or are you imagining that future networks when those 48 are filled up would use 128-...? @pedrouid do you think @joshua-mir what would happen if two different chains use the same |
@oed it's completely possible for two networks to share the same spec_name, and I don't believe it would cause significant issues, networking and consensus all use the genesis hash, spec_name is only used in the client (to determine which folder to look for chaindata in) and "onchain". I imagine prefixes 64 and up will also be available to networks, the spec is intentionally vague iiuc |
I don't think the external address format is a good identifier for a chain, since many different chains may also share them. Something like the spec_name + genesis hash makes more sense, but at that point, genesis hash should be good enough without the spec_name I think... |
So basically you dont have the concept of the chainId in Polkadot? @joshua-mir @shawntabrizi Then I guess this would be similar to Bitcoin's BIP122. Would it be possible to write a similar spec to CAIP-4 where we describe the Polkadot namespace for chainIds using the genesis hash? https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-4.md I can help with the PR but lets get it done on the CAIPs so that we can use it as blockchain reference for these account-links |
I've updated the polkadot example to be CAIP-13 compatible @oed Let's just wait for the CAIP-13 to be merged before merging this PR |
Ready to Merge! |
Using CAIP-10 (Chain Agnostic Account ID Spec) for account-links
CAIP-10: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md