-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Create adr-043-interchain-identifiers.md #9589
Conversation
First draft ADR for feedback. Is 043 the next in this sequence?
Where: | ||
- `COSMOS` is the method _(it is not the Cosmos Zone namespace)_. | ||
- `CHAIN` is the namespace, such as `IXO` or `REGEN` _(it is not the chain-id)_. | ||
- `MODULE` is the module namespace, such as `NFT` or `BANK` _(as named within the context of each application chain)_. |
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.
So I think this is maybe where there are some misunderstandings arising. I have been advocating for namespaced denoms within bank. But bank
would never itself issue any denoms itself but rather manage denoms from a number of sources that are likely namespaced. I would feel more comfortable using the language NAMESPACE instead of MODULE. Module is the software component and there likely won't be a 1:1 correspondence. Instead, a chain would have a mapping for which modules deal with which namespaces of assets IID. I think fundamentally this comes down to the SDK's information model for assets and identities - it's not as if just any module exposes its own asset interface. Currently only two modules fundamentally deal with assets and identities - bank and auth respectively. Maybe there will be a third one for NFTs if that doesn't get dealt with by bank, but either way it's a different level of the stack. The namespace, however, would likely point to a class of assets dealt with by a specific module or rule set proxied through the generic bank, nft and auth module APIs. Hope that makes sense.
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.
I would feel more comfortable using the language NAMESPACE instead of MODULE.
@aaronc this makes complete sense and I will update accordingly.
It's not as if just any module exposes its own asset interface.
Agreed, but we should at least have a core set of standard interfaces for modules which deal with assets.
There's still a question in my mind about whether an asset module should store its own identifiers and metadata, vs relying on a an identifier and metadata module (e.g. x/IID) which could service all modules.
In working through this, Joe and I feel there are advantages to an asset module handling its own identifiers and metadata, within the context of the module and the services it offers.
We would be keen to hear what others think about this.
In the interim, we are continuing to develop the IID interface and a demo module. The next question would be whether we should submit another ADR to propose an IID module for the SDK.
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.
@aaronc I agree that renaming the "module" component to namespace is a solid improvement. There need not be the expectation that all namespaces within a chain are 1:1 controlled by modules.
That said, there is a nuance with IIDs that I want to anchor.
@aaronc wrote:
It's not as if just any module exposes its own asset interface.
Correct, if a module isn't managing on-chain state, there's no need to expose an IID interface.
However, any module that manages on-chain state of any kind of asset, whether those assets are NFTs, FTs, accounts, services, transactions, encumbrances, or something else would benefit from IIDs. All a module needs to do is expose an IID interface (and provide the routing at the hub and chain level) and it can plug in to the cosmos IID ecosystem and have a fully conformant DID for whatever assets it manages.
We anticipate, for example, that bespoke licensing modules are going to emerge to handle arbitrarily complex domain-specific encumbrances for NFTs that reside elsewhere (either on another module or another chain). Each of these modules would/could/should expose an IID for controlling their assets, e.g., the licensing contract attached to an NFT but managed by a module that understands that Paris is in France or the royalty agreement attached to a given NFT. These assets may or may not be "tokens" in any sense.
In other words, I see far more modules exposing an IID interface than I think you've been considering. It isn't just the NFTs and accounts that need IIDs; anything the manages an on-chain state and exposes an interface for managing that, can (and IMO should) expose an IID interface.
Of course, this transition will be gradual and it will likely be a while before it is the norm. However, the architecture of IIDs is far more flexible than your comments suggest.
@ig-shaun and I have been working through whether or not there is a place for an IID module that is, itself, managing the state of IID Documents by recording them, explicitly, on chain. My sensibility is that such a module is likely going to replicate state-management logic already encoded in the module that manages the asset. For example, if we had a cryptokitties module (which uses native cosmos modules for some of the underlying work, like bank and auth) that module has all the logic for translating on-chain records (based on signed transactions) to the "cattribute" properties that define a given cryptokitty, such as genes and "siredWith".
I imagine an IID module that provides helper functions to turn a set of properties and behaviors into well-formed IID Documents, but which itself is not managing state of those properties & behaviors. Alternatively, a cryptokitty module could defer (at least some) state management to an IID Module, but my estimate is that will lead to duplicate data stored on chain, which feels like both a systemic waste and an attack vector should the IID Module and the asset module get out of sync for any reason. We're still working through these tradeoffs.
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 for sharing that context @jandrieu. My sense is that generally the IID layer shouldn't manage its own state, but rather act as a translation layer which exposes the IID API for existing modules.
Changed asset MODULE to asset NAMESPACE. Assets SHOULD be identified within the context of a chain-specific asset namespace, regardless of which asset module issues and/or controls the asset. Responds to cosmos#9589 (comment)
@@ -0,0 +1,108 @@ | |||
# ADR 043: Interchain Identifiers |
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.
# ADR 043: Interchain Identifiers | |
# ADR 045: Interchain Identifiers |
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.
Looks like this will bump to 046 if we get this merged soon.
As requested in #9329 (comment)
Since that was the second time I responded to a direct request for comment and was asked to move the topic off the NFT issue, I'm moving it here. If, in fact, the current approach for IBC is incompatible with DIDs, then this proposal would need to be completely rethought. I made the case in the NFT conversation because I had thought IBC was fundamentally a dumb pipe, but folks kept asserting that IBC somehow requires a compositional identifier architecture that, apparently, won't work if IIDs or DIDs are used to identify NFTs. If the current proposal for NFTs doesn't work for DIDs, then I think we should keep working on that to ensure that Cosmos NFTs are compatible with DIDs. Can anyone clarify how DIDs break IBC? |
I would really love it if someone from IBC could comment here (@colin-axner or @AdityaSripal?), but I'll try. So the thing that won't work with the current setup is using an IID as an on-chain identifier to uniquely identify an asset that came from another chain. Currently, even if somehow we know that two tokens came from the same IBC chain, we can't make them fungible because they're actually vouchers for escrow tokens on the channel/port combos they came from. So, we can't just say in the bank or NFT module that all Maybe there is a way that on-chain governance could limit the routes that IBC tokens take to get on a chain so that there is a consensus 1:1 mapping between any unique chain and a channel/port. This would mean having some way to reject tokens that don't come over an expected channel/port combo so that we don't run into this problem. I don't know if this is a feasible idea or if anyone has talked about it, but it might be a way to make this all work nicely using IIDs both on-chain and in user interfaces. Again, it would be great if anyone with more context than myself were able to comment on this topic. |
@AdityaSripal can provide the most insight here, but I'll do my best to offer some perspective in the meantime. IID's need to make use of channel/port id's. Channel/port id's are what offer an understanding of where the token originated from. Chain identifiers are like consensus parameters and should not be used as a single source of truth in IBC. They are like a chain's unbonding period, you cannot possibly know what chain you are referring to by just referencing the unbonding period. Validators sign over these consensus parameters. What does identify a chain is its root hash and the next validator set hash for some height. IBC maps the channel/port to the consensus states (root hash/next validator set for a sparse set of block heights) and a set of consensus parameters in the form of a client state for which the consensus states are valid for I forget the exact format of IID's but simplicity sake in the IBC case lets say it looks something like this: If the question is about trying bring this UX abstraction on-chain, then that seems me more of a question of how to bring social consensus on chain. At some point we all need to agree that what is referred to as "Cosmos Hub" comes from specific genesis file I may not have a complete picture of how IID's work with IBC, but a few months ago @AdityaSripal did this investigation and it seemed entirely possible to me |
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.
Left few comments. I propose to merge this PR and iterate towards a proposal.
|
||
Where: | ||
- `COSMOS` is the method _(it is not the Cosmos Zone namespace)_. | ||
- `CHAIN` is the namespace, such as `IXO` or `REGEN` _(it is not the chain-id)_. |
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.
If we have only one method name (cosmos), then who will be in charge of creating and assigning chain name?
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.
My expectation is that this would be an on-chain registry on the Hub with some sort of governance mechanism for managing name claims.
As for who would build or control that, I'm not sure who the best party would be, but I understand there are a few options available.
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.
Good, let's add it in the doc.
- `DID:COSMOS:CHAIN:` for a Cosmos chain namespace | ||
- `DID:COSMOS:CHAIN:NAMESPACE:` for an asset namespace in a Cosmos application chain | ||
- `DID:COSMOS:CHAIN:NAMESPACE:{unique identifier string}` for the application's chosen method for deriving a unique identifier string | ||
2. IID implementations in the Cosmos SDK MUST conform to the Interchain Identifier (IID) specification RFC-09. |
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.
Please provide a link to the RFC-09
PING - shall we we update the ADR and move forward? |
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.
@robert-zaremba this ADR can't move forward because there is no technical solution yet. Putting a block here to make this clear.
This ADR specifies an IID format with a CHAIN
identifier. @colin-axner described a way to make IID's work using the IBC channel/port's, but that is not what this ADR tries to do and would not result in unique interchain identifiers for assets. That piece requires bringing social consensus on-chain about which as @colin-axner has pointed out. We don't yet have a solution for that. Nevertheless, I do think it's a great idea.
What's needed to move this forward IMHO is a conversation between someone from the IBC team (maybe @AdityaSripal or @colin-axner) and the gov working group (maybe @hxrts or myself) to talk through what's needed to bring social consensus about chain identifiers on-chain and coordinate that with IBC. |
There is an implementation of a DID module in the cosmos-cash project that is compliant with the W3C DID spec. There will be some small updates in the next few weeks, the most notable will be the upgrade to 0.43.0 and some updates to the structure to match best practices in the SDK, e.g removal of
Also, feel free to check out the Universal Resolver Frontend that points at the cosmos cash testnet node: There are also some demo scripts that you can view as a reference if you want to interact with the chain e.g create a DID and then use the universal resolver front end to query the did you created Also, any feedback on the module is welcome! 😄 All things considered, I propose a two-step approach to adding the IID module to the SDK:
If this is the route we want to take I'm happy to put some engineering effort into making this happen! |
@aaronc the ADR is in Draft. If we agree that IIC is something we want to do, then I think we should merge a a clean version of it as a Draft and specify the technical solution later. This way we will "book" the ADR number and have a common reference for the future. Now we need to push back the ADR number. |
## Decision | ||
|
||
1. Cosmos IID Method DIDs SHOULD follow the standard format: | ||
- `DID:COSMOS:` for the Cosmos Method (IID) |
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.
- `DID:COSMOS:` for the Cosmos Method (IID) | |
- `DID:COSMOS:` for the Cosmos Method (IID) |
We should discuss the use of 'cosmos' for this IID methods. I think there is an important opportunity to maintain the IID convention, where the DID only ever identifies on-chain assets and do so in a way that any Cosmos blockchain can easily adopt. This convention ensures some modest privacy benefits but is, by necessity, a different way to do things that "normal" DIDs. It is just a convention, but if we start promoting using IIDs to represent people, then we can't tell, for example, if a given VC with the subject as a cosmos DID/IID is about the person the DID is used to refer to, or to an on-chain asset that record data for the DID.
At the same time, there is also high demand for more traditional DIDs on Cosmos (as odd as that sounds for a tech that hasn't even been published as a formal standard). DIDs that are used to represent people or companies, are not IIDs, by definition. It may well be far more appropriate to use did:cosmos for generic identifiers and find another monicker for cosmos-based IIDs.
Once we have the software for one (either a Cosmos DID Method or a Cosmos IID Method), the software should be readily usable for the other. The main advantage of supporting a Cosmos DID Method (on which is not an IID) is that existing and emerging DID expectations are that DIDs for people use the primary authentication for the DID as a means of authenticating people. IIDs provide a way to authenticate as either the NFT or as an subset identifier defined within the IID's namespace. Those subset IDs can refer to people in IIDs and IIDs allow that in a way that removes the HTTPRange14 problem, but most authentication approaches I know do not actively support the notion of authenticating as a subidentifier.
ALTHOUGH, I just thought of a way that we might be able to get support for authenticating subidentifiers without too much of a lift. At least there might be a way to have the only real difference between IIDs and DIDs be how they are used (convention) rather than DID-level functionality like authentication and authorizations.
So, if the DIDs for people use case is important, and I think it is, we should probably use did:cosmos for that use and explore another monicker for cosmos IIDs.
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.
@ig-shaun @AdityaSripal @Sam-Interchain
Can we find the right party to make a decision on this? I agree that if we can't have a name service, we can't have a universal did:cosmos that works for all cosmos chains.
However, it seems there would be significant value for a did:cosmos that allowed any Cosmos chain to stand up a DID issuing capability without formally developing their own DID method.
If that value doesn't make sense for Cosmos, then I'd recommend establishing a common interface without solving for a universal did:cosmos, so that application chains could at least develop interoperable DID methods, such as did:ixo and did:regen.
Co-authored-by: Robert Zaremba <[email protected]>
Co-authored-by: Robert Zaremba <[email protected]>
Co-authored-by: Robert Zaremba <[email protected]>
Co-authored-by: Robert Zaremba <[email protected]>
IBC doesn't natively support absolute identifiers for interchain assets, because IBC does not have absolute identifiers of the chains it connects to. It only has relative names like An asset can have a unique name on a single chain A, and then all connected chains could have a relative path to that chainA and then reference the unique name on chainA. But all connected chains do not have the same unique identifier for If that is an absolute requirement, it would require some additional piece of infrastructure to provide that absolute, global chain naming. Perhaps through a Chain Name Service |
Co-authored-by: Joe Andrieu <[email protected]>
I am confused by this. If IBC can't support unique identifiers, then IBC can't support IIDs as their own internal representation of NFTs. But IIDs don't depend on IBC. But if I read it correctly, what I think you are actually saying is that IBC can't support a unified cosmos IID without a name resolver. That's correct. DIDs and IIDs must be globally unique. That's the whole point. If we want IBC to support DIDs for on chain assets, you're going to need to come up with a solution for uniqueness. The known solution is to provide a name resolver as part of the Cosmos DID infrastructure, so that the first step in resolving a Cosmos IID is to resolve the cosmos name to the chain. Then you contact that chain to resolve the chain-specific name space. IMO, the only other alternative is to NOT provide a unified Cosmos IID (or DID), but instead establish the pattern that any application chain may register its own DID method, with its own specification, eg., did:ixo or did:regen. That approach gives us an interoperable approach to IIDs and DIDs, but without the ease of which a unified name resolver enables. If a name resolver is a non-starter, @AdityaSripal is right, we should get rid of the chain component and, instead, find ways to make it easy for application chains to establish their own independent method (which, naturally will still be able to leverage a shared codebase, but will need a separate method specification). -j |
Maybe what is proposed in #9948 is a reasonable way to achieve the goals of IID's? Basically that each chain has a gov controlled chain name <-> IBC mapper. |
Co-authored-by: Joe Andrieu <[email protected]>
- `CHAIN` is the namespace, such as `IXO` or `REGEN` _(it is not the chain-id)_. | ||
- `NAMESPACE` is the asset namespace, such as `NFT` or `DOMAIN` _(as named within the context of each application chain)_. | ||
- `{unique identifier string} abc123` is defined by applications developers _(NFTs in two different networkscould even have the identical Inique Identifier String value and will still have completely unique IIDs)_ | ||
|
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.
Example: `did:cosmos:ixo:earth_nft:submodule_address` |
|
||
When we refer to on-chain assets, this includes tokens, wallets, name records, or any other uniquely identifiable entity within a chain namespace. | ||
|
||
**Interchain Identifiers** (IIDs) are a standards-compliant method (based on [W3C DID-Core](https://w3c.github.io/did-core/)) for uniquely identifying, locating, referring to and verifying digital assets which are accessed within, or through, chain namespaces. |
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.
let's make the explanation a bit easier, eg: In other words, Cosmos IID is DID with an on chain record.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
First draft ADR for feedback.
Is 043 the next in this sequence?
Description
New ADR proposal
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change