-
Notifications
You must be signed in to change notification settings - Fork 10
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
Reified Edges? #41
Comments
SummaryReified edges might in face be the general case of some of the additional tree and graph-based problems we have discussed elsewhere. There are many use-cases where simple addressability is the concern and the question is mapping together two arbitrary The first version of this nameservice focussed on a simple We already have two use cases at present: subdomains, and addressing contracts. SubdomainsThis solves the subdomains question, as outlined in #29 - allowing for recursive traversal in arbitrary graph walks, in the most flexible way possible. I suppose it opens up the question of "what is a subdomain anyway?" other than the OBJECT, where the SUBJECT is a Addressing contractsThis solves (to some extent) the issue of addressing a contract, where the OBJECT of the edge would be another address - something simply not allowed for in the current scheme. #45 Discussion pointsThe remaining questions here are:
|
Approach 2: (which is not incompatible with this, necessarily) Contract can call the nameservice, where a receive msg will create an NFT with the caller (i.e. the contract) as This is potentially better as it simplifies the lookup in that case. However, still think subdomains might be better expressed as a bi-directional edge. |
Current thinking on first pass here: We have a type that is a pub const EDGES: Map<(Entity, Entity), EdgeMetadata> = Map::new("edges"); This, if we return to pseudocode, is effectively:
Which fulfils our need to arbitrarily map the
(to cover the cases where the object is an
(to cover the cases where the object is a
An edge should be createable by the wallet or owner of the token that is in subject position. In this example you would need a multiindex over type, and meta would need to contain a pathName, and then indexes over both subject and object to allow for querying, I guess. |
I think this means you'd set it up as an IndexedMap with a multiindex on the Type https://github.com/CosmWasm/cw-plus/tree/main/packages/storage-plus#indexedmap |
So tl;dr the only thing we're really concerned about here is covering off the address case, and there's only a couple:
and validator is probably already covered by the meta field, which means only contract|wallet |
Some additional scribbes from my brain dump
|
Open question: is there utility in a primitive that shows the relationship between things? Would probably have to be a (mostly) open meta struct, but at the moment needs a bit more thought.
EDIT: more thought below. too much, if anything.
The text was updated successfully, but these errors were encountered: