-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conform to did:peer:2 spec #3
Changes from 6 commits
034a3f7
17bc44a
445c1be
1b81151
50f6f6d
8dd2b3a
59773d8
907574e
127a675
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 |
---|---|---|
|
@@ -36,31 +36,31 @@ export const resolveNumAlgo2 = async (did: string): Promise<IDIDDocument> => { | |
let encKeys: IDIDDocumentVerificationMethod[] = []; | ||
let services: IDIDDocumentServiceDescriptor[] = []; | ||
let keys = did.split('.') | ||
let serviceIndex = 0; | ||
let serviceMetadata = {index: 0}; | ||
let keyIndex = 1; | ||
delete keys[0]; | ||
keys.forEach(k => { | ||
switch (k.slice(0,1)) { | ||
case Numalgo2Prefixes.Authentication: | ||
authKeys.push({ | ||
id: `${did}#${k.slice(2)}`, | ||
id: `#key-${keyIndex++}`, | ||
controller: did, | ||
type: 'Ed25519VerificationKey2020', | ||
type: 'Multikey', | ||
publicKeyMultibase: k.slice(1) | ||
}) | ||
break; | ||
case Numalgo2Prefixes.KeyAgreement: | ||
encKeys.push({ | ||
id: `${did}#${k.slice(2)}`, | ||
id: `#key-${keyIndex++}`, | ||
controller: did, | ||
type: 'X25519KeyAgreementKey2020', | ||
type: 'Multikey', | ||
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. Cool to use new Data Integrity suites. I need to update my other libraries but will pin versions if I can't get to updating them as this is the right path forward |
||
publicKeyMultibase: k.slice(1) | ||
}) | ||
break; | ||
case Numalgo2Prefixes.Service: | ||
services.push(decodeService(did, k.slice(1), serviceIndex)) | ||
serviceIndex++; | ||
services.push(decodeService(did, k.slice(1), serviceMetadata)) | ||
break; | ||
} | ||
}) | ||
return createDIDDocument(did, authKeys, encKeys, services) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ export const encodeService = (service: IDIDDocumentServiceDescriptor): string => | |
return `.${Numalgo2Prefixes.Service}${base64url.encode(encoded)}` | ||
} | ||
|
||
export const decodeService = (did: string, service: string, index: number): IDIDDocumentServiceDescriptor => { | ||
export const decodeService = (did: string, service: string, metadata: Record<string, any>): IDIDDocumentServiceDescriptor => { | ||
const val = JSON.parse(utf8.decode(base64url.decode(service))) | ||
if (val.s) { | ||
val['serviceEndpoint'] = val.s; | ||
|
@@ -73,27 +73,38 @@ export const decodeService = (did: string, service: string, index: number): IDID | |
if (val.t) { | ||
if (val.t === 'dm') { | ||
val.type = 'DIDCommMessaging' | ||
val.id = `#didcommmessaging-${index}` | ||
} else { | ||
val.type = val.t; | ||
val.id = `#service-${index}` | ||
} | ||
delete val['t'] | ||
} | ||
if (!val.id) { | ||
if (metadata.index == 0) { | ||
TheTechmage marked this conversation as resolved.
Show resolved
Hide resolved
|
||
val.id = `#service`; | ||
} else { | ||
val.id = `#service-${metadata.index}`; | ||
} | ||
metadata.index++; | ||
} | ||
return val; | ||
} | ||
|
||
export const isPeerDID = (did: string) => { | ||
return new RegExp('^did:peer:(([01](z)([1-9a-km-zA-HJ-NP-Z]*))|(2((\.[AEVID](z)([1-9a-km-zA-HJ-NP-Z]*))+(\.(S)[0-9a-zA-Z=]*)?)))$').test(did) | ||
return new RegExp('^did:peer:(([01](z)([1-9a-km-zA-HJ-NP-Z]*))|(2((\.[AEVID](z)([1-9a-km-zA-HJ-NP-Z]*))+(\.(S)[0-9a-zA-Z=]*)*)))$').test(did) | ||
} | ||
|
||
export const createDIDDocument = ( | ||
did: string, | ||
authKeys: IDIDDocumentVerificationMethod[], | ||
encKeys: IDIDDocumentVerificationMethod[], | ||
services: IDIDDocumentServiceDescriptor[] | ||
services: IDIDDocumentServiceDescriptor[], | ||
TheTechmage marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) => { | ||
let contexts = ["https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/ed25519-2020/v1"] | ||
let contexts = ["https://www.w3.org/ns/did/v1", "https://w3id.org/security/multikey/v1"] | ||
const prefix = "did:peer:"; | ||
const didPeerNumalgo = parseInt(did.slice(prefix.length, prefix.length+1)) | ||
if (didPeerNumalgo < 2) { | ||
contexts = ["https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/ed25519-2020/v1"] | ||
} | ||
const auth = authKeys.map(k => k.id); | ||
const enc = encKeys.map(k => k.id); | ||
const ver = [...authKeys, ...encKeys].map(k => ({ | ||
|
@@ -106,16 +117,20 @@ export const createDIDDocument = ( | |
"id": did, | ||
assertionMethod: auth, | ||
authentication: auth, | ||
capabilityDelegation: auth, | ||
capabilityInvocation: auth, | ||
verificationMethod: ver, | ||
} | ||
if (didPeerNumalgo < 2) { | ||
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. did:peer:2 doesn't have 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. did:peer:2 does support expressing It is because of limitations like these that we're moving to did:peer:4 which can express any DID Document without limitations. 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. I'm not sure what needs to be done here as Delegation and Invocation are foreign diddoc concepts to me. All of my recent work has revolved around |
||
doc["capabilityDelegation"] = auth | ||
doc["capabilityInvocation"] = auth | ||
} | ||
if (enc.length > 0) { | ||
doc['keyAgreement'] = enc; | ||
contexts.push("https://w3id.org/security/suites/x25519-2020/v1"); | ||
if (didPeerNumalgo < 2) { | ||
contexts.push("https://w3id.org/security/suites/x25519-2020/v1"); | ||
} | ||
} | ||
if (services.length > 0) { | ||
doc['service'] = services | ||
} | ||
return {"@context": contexts, ...doc}; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"did": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ" | ||
"did": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ.SeyJpZCI6ImEtdmVyeS11bmlxdWUtc2VydmljZSIsInQiOiJkbSIsInMiOiJodHRwczovL2V4YW1wbGUuY29tL2VuZHBvaW50MiIsInIiOlsiZGlkOmV4YW1wbGU6c29tZW1lZGlhdG9yI3NvbWVrZXkxIl0sImEiOlsiZGlkY29tbS92MiIsImRpZGNvbW0vYWlwMjtlbnY9cmZjNTg3Il19.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDMiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,53 @@ | ||
{ | ||
"@context": [ | ||
"https://www.w3.org/ns/did/v1", | ||
"https://w3id.org/security/suites/x25519-2020/v1", | ||
"https://w3id.org/security/suites/ed25519-2020/v1" | ||
"https://w3id.org/security/multikey/v1" | ||
], | ||
"id": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ", | ||
"id": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ.SeyJpZCI6ImEtdmVyeS11bmlxdWUtc2VydmljZSIsInQiOiJkbSIsInMiOiJodHRwczovL2V4YW1wbGUuY29tL2VuZHBvaW50MiIsInIiOlsiZGlkOmV4YW1wbGU6c29tZW1lZGlhdG9yI3NvbWVrZXkxIl0sImEiOlsiZGlkY29tbS92MiIsImRpZGNvbW0vYWlwMjtlbnY9cmZjNTg3Il19.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDMiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ", | ||
"verificationMethod": [ | ||
{ | ||
"id": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ#6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud", | ||
"type": "X25519KeyAgreementKey2020", | ||
"controller": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ", | ||
"id": "#key-1", | ||
"type": "Multikey", | ||
"controller": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ.SeyJpZCI6ImEtdmVyeS11bmlxdWUtc2VydmljZSIsInQiOiJkbSIsInMiOiJodHRwczovL2V4YW1wbGUuY29tL2VuZHBvaW50MiIsInIiOlsiZGlkOmV4YW1wbGU6c29tZW1lZGlhdG9yI3NvbWVrZXkxIl0sImEiOlsiZGlkY29tbS92MiIsImRpZGNvbW0vYWlwMjtlbnY9cmZjNTg3Il19.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDMiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ", | ||
"publicKeyMultibase": "z6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud" | ||
}, | ||
{ | ||
"id": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ#6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V", | ||
"type": "Ed25519VerificationKey2020", | ||
"controller": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ", | ||
"id": "#key-2", | ||
"type": "Multikey", | ||
"controller": "did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ.SeyJpZCI6ImEtdmVyeS11bmlxdWUtc2VydmljZSIsInQiOiJkbSIsInMiOiJodHRwczovL2V4YW1wbGUuY29tL2VuZHBvaW50MiIsInIiOlsiZGlkOmV4YW1wbGU6c29tZW1lZGlhdG9yI3NvbWVrZXkxIl0sImEiOlsiZGlkY29tbS92MiIsImRpZGNvbW0vYWlwMjtlbnY9cmZjNTg3Il19.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDMiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ", | ||
"publicKeyMultibase": "z6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V" | ||
} | ||
], | ||
"authentication": [ | ||
"did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ#6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V" | ||
"#key-2" | ||
], | ||
"assertionMethod": [ | ||
"did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ#6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V" | ||
"#key-2" | ||
], | ||
"keyAgreement": [ | ||
"did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ#6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud" | ||
], | ||
"capabilityInvocation": [ | ||
"did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ#6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V" | ||
], | ||
"capabilityDelegation": [ | ||
"did:peer:2.Ez6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud.Vz6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V.SeyJ0IjoiZG0iLCJzIjoiaHR0cHM6Ly9leGFtcGxlLmNvbS9lbmRwb2ludDEiLCJyIjpbImRpZDpleGFtcGxlOnNvbWVtZWRpYXRvciNzb21la2V5MSJdLCJhIjpbImRpZGNvbW0vdjIiLCJkaWRjb21tL2FpcDI7ZW52PXJmYzU4NyJdfQ#6MkqRYqQiSgvZQdnBytw86Qbs2ZWUkGv22od935YF4s8M7V" | ||
"#key-1" | ||
], | ||
"service": [ | ||
{ | ||
"id": "#didcommmessaging-0", | ||
"id": "#service", | ||
"type": "DIDCommMessaging", | ||
"serviceEndpoint": "https://example.com/endpoint1", | ||
"routingKeys": ["did:example:somemediator#somekey1"], | ||
"accept": ["didcomm/v2", "didcomm/aip2;env=rfc587"] | ||
}, | ||
{ | ||
"id": "a-very-unique-service", | ||
TheTechmage marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"type": "DIDCommMessaging", | ||
"serviceEndpoint": "https://example.com/endpoint2", | ||
"routingKeys": ["did:example:somemediator#somekey1"], | ||
"accept": ["didcomm/v2", "didcomm/aip2;env=rfc587"] | ||
}, | ||
{ | ||
"id": "#service-1", | ||
"type": "DIDCommMessaging", | ||
"serviceEndpoint": "https://example.com/endpoint3", | ||
"routingKeys": ["did:example:somemediator#somekey1"], | ||
"accept": ["didcomm/v2", "didcomm/aip2;env=rfc587"] | ||
} | ||
] | ||
} |
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 prefer absolute URIs over relative. I know the spec uses relative and these get quite ugly but I don't think it will matter at an interoperability level unless I'm missing something
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 believe you're correct; whether the URLs are "expanded" or left as relative should not significantly impact interop as either should be considered acceptable. Using absolute URIs here I think is fair. @frostyfrog
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.
Alternatively I'd be ok with using relative and putting an
"@base": "did:peer:2z123najb..."
in the@context
which will effectively do the same thingThere 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 like the idea of using
@base
as it allows the document to be a bit cleaner when a Human is reading it. I have added it to the context property according to the pattern demonstrated in example 150 in the JSON-LD docs.