From b30bcb96aeccf2e115bb1c3c34fe905b2e25cf13 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Fri, 17 Feb 2023 09:09:17 +0100 Subject: [PATCH 1/2] Update context with Raphael's suggestion --- README.md | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 07b185a..651e022 100644 --- a/README.md +++ b/README.md @@ -83,26 +83,48 @@ 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, + "id": "@id", + "asset-did-spec": "https://github.com/KILTprotocol/spec-asset-did/blob/main/README.md", + "chain": { + "@id": "asset-did-spec:chain", + "@context": { + "namespace": "asset-did-spec:chain-namespace", + "reference": "asset-did-spec:chain-reference" + } + }, + "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: - + ```json { "@context": [ "https://www.w3.org/ns/did/v1", - "https://kilt.io/asset-did-context.json" + "https://github.com/KILTprotocol/spec-asset-did/blob/main/README.md" ], "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" } ``` From 04af93d8b7ce17067e410b5e8baacb95924603ae Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Thu, 23 Feb 2023 17:24:41 +0100 Subject: [PATCH 2/2] Fixes --- README.md | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 651e022..8121f25 100644 --- a/README.md +++ b/README.md @@ -90,19 +90,18 @@ The snippet below shows the context that the process of AssetDID resolution retu ```json { "@protected": true, - "id": "@id", "asset-did-spec": "https://github.com/KILTprotocol/spec-asset-did/blob/main/README.md", "chain": { "@id": "asset-did-spec:chain", "@context": { "namespace": "asset-did-spec:chain-namespace", "reference": "asset-did-spec:chain-reference" - } - }, - "namespace": "asset-did-spec:asset-namespace", - "reference": "asset-did-spec:asset-reference", - "identifier": "asset-did-spec:asset-identifier" + } }, + "id": "@id", + "namespace": "asset-did-spec:asset-namespace", + "reference": "asset-did-spec:asset-reference", + "identifier": "asset-did-spec:asset-identifier" } ``` @@ -114,7 +113,21 @@ As an example, the returned DID Document for [one of the CryptoKitties NFTs](htt { "@context": [ "https://www.w3.org/ns/did/v1", - "https://github.com/KILTprotocol/spec-asset-did/blob/main/README.md" + { + "@protected": true, + "asset-did-spec": "https://github.com/KILTprotocol/spec-asset-did/blob/main/README.md", + "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": {