-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: fix context definition #1
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -83,26 +83,61 @@ The same process is followed for the asset identifier. | |||||
The identifier is decomposed into its namespace, reference, and optional ID. | ||||||
Then, the resolver for the specified asset namespace is used to resolve the asset reference and ID. | ||||||
|
||||||
### JSON-LD Context | ||||||
|
||||||
The snippet below shows the context that the process of AssetDID resolution returns. | ||||||
|
||||||
```json | ||||||
{ | ||||||
"@protected": true, | ||||||
"asset-did-spec": "https://github.com/KILTprotocol/spec-asset-did/blob/main/README.md", | ||||||
"chain": { | ||||||
"@id": "asset-did-spec:chain", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you could add |
||||||
"@context": { | ||||||
"namespace": "asset-did-spec:chain-namespace", | ||||||
"reference": "asset-did-spec:chain-reference" | ||||||
} | ||||||
}, | ||||||
rflechtner marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
"id": "@id", | ||||||
"namespace": "asset-did-spec:asset-namespace", | ||||||
"reference": "asset-did-spec:asset-reference", | ||||||
"identifier": "asset-did-spec:asset-identifier" | ||||||
} | ||||||
``` | ||||||
|
||||||
As an example, the returned DID Document for [one of the CryptoKitties NFTs](https://opensea.io/assets/ethereum/0x06012c8cf97bead5deae237070f9587f8e7a266d/634446), identified with the Asset DID `did:asset:eip155:1.erc721:0x06012c8cf97bead5deae237070f9587f8e7a266d:634446`, is the following: | ||||||
|
||||||
<!-- TODO: Store the context somewhere and update this link when defined. --> | ||||||
<!-- TODO: Change context URL with IPFS link --> | ||||||
|
||||||
```json | ||||||
{ | ||||||
"@context": [ | ||||||
"https://www.w3.org/ns/did/v1", | ||||||
"https://kilt.io/asset-did-context.json" | ||||||
{ | ||||||
"@protected": true, | ||||||
"asset-did-spec": "https://github.com/KILTprotocol/spec-asset-did/blob/main/README.md", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still broken I think. Try adding the hash in the playground and observe how the expanded result changes
Suggested change
|
||||||
"chain": { | ||||||
"@id": "asset-did-spec:chain", | ||||||
"@context": { | ||||||
"namespace": "asset-did-spec:chain-namespace", | ||||||
"reference": "asset-did-spec:chain-reference" | ||||||
} | ||||||
}, | ||||||
"id": "@id", | ||||||
"namespace": "asset-did-spec:asset-namespace", | ||||||
"reference": "asset-did-spec:asset-reference", | ||||||
"identifier": "asset-did-spec:asset-identifier" | ||||||
} | ||||||
], | ||||||
"id": "did:asset:eip155:1.erc721:0x06012c8cf97bead5deae237070f9587f8e7a266d:634446", | ||||||
"chain": { | ||||||
"id": "eip155:0", | ||||||
"namespace": "eip155", | ||||||
"reference": "0" | ||||||
}, | ||||||
"asset": { | ||||||
"namespace": "erc721", | ||||||
"reference": "0x06012c8cf97bead5deae237070f9587f8e7a266d", | ||||||
"identifier": "634446" | ||||||
} | ||||||
"namespace": "erc721", | ||||||
"reference": "0x06012c8cf97bead5deae237070f9587f8e7a266d", | ||||||
"identifier": "634446" | ||||||
} | ||||||
``` | ||||||
|
||||||
|
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 you check what the predicates expand to? Not sure, but you might need to add a
#
to make sure the result is a valid URL