Open adn-misa opened 2 years ago
I would have thought that application/did+ld+json
would return the @context
in the response?
Instead in the above post, it's the opposite - application/did+json
returns @context
and application/did+ld+json
does not.
@OR13 @peacekeeper
All ELEM did document representations should include an @context
... just like all ION ones currently do.
I can't get that (pre sidetree v1) did to resolve atm... not sure why. I have seen a bunch of old element node traffic lately, maybe some of these recent operations have toasted our testnet node.
We're in the process of updating element to sidetree v1.... which will saddly involve another set of breaking changes.
I think it does not only affect ELEM as i mentioned above.
You can see the same behaviour on ION:
No Context
curl -H "Accept: application/did+ld+json" "https://dev.uniresolver.io/1.0/identifiers/did:ion:EiAnKD8-jfdd0MDcZUjAbRgaThBrMxPTFOxcnfJhI7Ukaw:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiJzaWdfNzJiZDE2ZDYiLCJwdWJsaWNLZXlKd2siOnsiY3J2Ijoic2VjcDI1NmsxIiwia3R5IjoiRUMiLCJ4IjoiS2JfMnVOR3Nyd1VOdkh2YUNOckRGdW14VXlQTWZZd3kxNEpZZmphQUhmayIsInkiOiJhSFNDZDVEOFh0RUxvSXBpN1A5eDV1cXBpeEVxNmJDenQ0QldvUVk1UUFRIn0sInB1cnBvc2VzIjpbImF1dGhlbnRpY2F0aW9uIiwiYXNzZXJ0aW9uTWV0aG9kIl0sInR5cGUiOiJFY2RzYVNlY3AyNTZrMVZlcmlmaWNhdGlvbktleTIwMTkifV0sInNlcnZpY2VzIjpbeyJpZCI6ImxpbmtlZGRvbWFpbnMiLCJzZXJ2aWNlRW5kcG9pbnQiOnsib3JpZ2lucyI6WyJodHRwczovL3d3dy52Y3NhdG9zaGkuY29tLyJdfSwidHlwZSI6IkxpbmtlZERvbWFpbnMifV19fV0sInVwZGF0ZUNvbW1pdG1lbnQiOiJFaUR4SWxJak9xQk5NTGZjdzZndWpHNEdFVDM3UjBIRWM2Z20xclNZTjlMOF9RIn0sInN1ZmZpeERhdGEiOnsiZGVsdGFIYXNoIjoiRWlBLXV3TWo3RVFheURmWTRJS3pfSE9LdmJZQ05td19Tb1lhUmhOcWhFSWhudyIsInJlY292ZXJ5Q29tbWl0bWVudCI6IkVpQ0czQ1M5RFJpeU1JRVoxRl9sSjZnRVRMZWVHREwzZnpuQUViMVRGdFZXNEEifX0" | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1393 0 1393 0 0 1174 0 --:--:-- 0:00:01 --:--:-- 1174
{
"assertionMethod": [
"#sig_72bd16d6"
],
"service": [
{
"id": "#linkeddomains",
"type": "LinkedDomains",
"serviceEndpoint": {
"origins": [
"https://www.vcsatoshi.com/"
]
}
}
],
"id": "did:ion:EiAnKD8-jfdd0MDcZUjAbRgaThBrMxPTFOxcnfJhI7Ukaw:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiJzaWdfNzJiZDE2ZDYiLCJwdWJsaWNLZXlKd2siOnsiY3J2Ijoic2VjcDI1NmsxIiwia3R5IjoiRUMiLCJ4IjoiS2JfMnVOR3Nyd1VOdkh2YUNOckRGdW14VXlQTWZZd3kxNEpZZmphQUhmayIsInkiOiJhSFNDZDVEOFh0RUxvSXBpN1A5eDV1cXBpeEVxNmJDenQ0QldvUVk1UUFRIn0sInB1cnBvc2VzIjpbImF1dGhlbnRpY2F0aW9uIiwiYXNzZXJ0aW9uTWV0aG9kIl0sInR5cGUiOiJFY2RzYVNlY3AyNTZrMVZlcmlmaWNhdGlvbktleTIwMTkifV0sInNlcnZpY2VzIjpbeyJpZCI6ImxpbmtlZGRvbWFpbnMiLCJzZXJ2aWNlRW5kcG9pbnQiOnsib3JpZ2lucyI6WyJodHRwczovL3d3dy52Y3NhdG9zaGkuY29tLyJdfSwidHlwZSI6IkxpbmtlZERvbWFpbnMifV19fV0sInVwZGF0ZUNvbW1pdG1lbnQiOiJFaUR4SWxJak9xQk5NTGZjdzZndWpHNEdFVDM3UjBIRWM2Z20xclNZTjlMOF9RIn0sInN1ZmZpeERhdGEiOnsiZGVsdGFIYXNoIjoiRWlBLXV3TWo3RVFheURmWTRJS3pfSE9LdmJZQ05td19Tb1lhUmhOcWhFSWhudyIsInJlY292ZXJ5Q29tbWl0bWVudCI6IkVpQ0czQ1M5RFJpeU1JRVoxRl9sSjZnRVRMZWVHREwzZnpuQUViMVRGdFZXNEEifX0",
"verificationMethod": [
{
"id": "#sig_72bd16d6",
"controller": "",
"type": "EcdsaSecp256k1VerificationKey2019",
"publicKeyJwk": {
"crv": "secp256k1",
"kty": "EC",
"x": "Kb_2uNGsrwUNvHvaCNrDFumxUyPMfYwy14JYfjaAHfk",
"y": "aHSCd5D8XtELoIpi7P9x5uqpixEq6bCzt4BWoQY5QAQ"
}
}
],
"authentication": [
"#sig_72bd16d6"
]
}
And on ION explorer it has a context:
{
"@context": "https://w3id.org/did-resolution/v1",
"didDocument": {
"id": "did:ion:EiAnKD8-jfdd0MDcZUjAbRgaThBrMxPTFOxcnfJhI7Ukaw:eyJkZWx0YSI6eyJwYXRjaGVzIjpbeyJhY3Rpb24iOiJyZXBsYWNlIiwiZG9jdW1lbnQiOnsicHVibGljS2V5cyI6W3siaWQiOiJzaWdfNzJiZDE2ZDYiLCJwdWJsaWNLZXlKd2siOnsiY3J2Ijoic2VjcDI1NmsxIiwia3R5IjoiRUMiLCJ4IjoiS2JfMnVOR3Nyd1VOdkh2YUNOckRGdW14VXlQTWZZd3kxNEpZZmphQUhmayIsInkiOiJhSFNDZDVEOFh0RUxvSXBpN1A5eDV1cXBpeEVxNmJDenQ0QldvUVk1UUFRIn0sInB1cnBvc2VzIjpbImF1dGhlbnRpY2F0aW9uIiwiYXNzZXJ0aW9uTWV0aG9kIl0sInR5cGUiOiJFY2RzYVNlY3AyNTZrMVZlcmlmaWNhdGlvbktleTIwMTkifV0sInNlcnZpY2VzIjpbeyJ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dG9zaGkuY29tLyJdfSwidHlwZSI6IkxpbmtlZERvbWFpbnMifV19fV0sInVwZGF0ZUNvbW1pdG1lbnQiOiJFaUR4SWxJak9xQk5NTGZjdzZndWpHNEdFVDM3UjBIRWM2Z20xclNZTjlMOF9RIn0sInN1ZmZpeERhdGEiOnsiZGVsdGFIYXNoIjoiRWlBLXV3TWo3RVFheURmWTRJS3pfSE9LdmJZQ05td19Tb1lhUmhOcWhFSWhudyIsInJlY292ZXJ5Q29tbWl0bWVudCI6IkVpQ0czQ1M5RFJpeU1JRVoxRl9sSjZnRVRMZWVHREwzZnpuQUViMVRGdFZXNEEifX0"
}
],
"service": [
{
"id": "#linkeddomains",
"type": "LinkedDomains",
"serviceEndpoint": {
"origins": [
"https://www.vcsatoshi.com/"
]
}
}
],
"verificationMethod": [
{
"id": "#sig_72bd16d6",
"controller": "",
"type": "EcdsaSecp256k1VerificationKey2019",
"publicKeyJwk": {
"crv": "secp256k1",
"kty": "EC",
"x": "Kb_2uNGsrwUNvHvaCNrDFumxUyPMfYwy14JYfjaAHfk",
"y": "aHSCd5D8XtELoIpi7P9x5uqpixEq6bCzt4BWoQY5QAQ"
}
}
],
"authentication": [
"#sig_72bd16d6"
],
"assertionMethod": [
"#sig_72bd16d6"
]
},
"didDocumentMetadata": {
"method": {
"published": false,
"recoveryCommitment": "EiCG3CS9DRiyMIEZ1F_lJ6gETLeeGDL3fznAEb1TFtVW4A",
"updateCommitment": "EiDxIlIjOqBNMLfcw6gujG4GET37R0HEc6gm1rSYN9L8_Q"
},
"equivalentId": [
"did:ion:EiAnKD8-jfdd0MDcZUjAbRgaThBrMxPTFOxcnfJhI7Ukaw"
]
}
}
FWIW, I tend to skip the universal resolver in middleware when I know its just mapping through to another cloud service, that is publicly accessible, because it removes the http overhead, and potential issues where the universal resolver may tamper with the data provided by the origin server it relies on for resolution, such as this reported issue.
@peacekeeper and I have chatted about if the universal resolver should attempt to process responses from did methods... its my perspective that the universal resolver should not do anything but forward resolution requests, and responses, and not add or drop properties based on context definitions.
@adn-misa I wonder if this could be an issue for the universal resolver (https://github.com/decentralized-identity/universal-resolver).
@OR13 That's a good point i will try to see if i can achieve that with the go framework.
@troyronda I think it actually is. As my example with ION, it does remove it and as @OR13 said, it seems that universal resolver could do some processing.
What I'm trying to do
I'm trying to resolve DIDs with universal resolver from the mobile binding
Expected result
The DID Document should resolve using the universal resolver
Actual result
After trying some DIDs i always got the same error message:
It seems that universal resolver does sometimes not return the context depending on which
accept
header was set. The differences can be seen underneath the sample code.By changing from
application/did+ld+json
inpkg/vdr/httpbinding/resolver.go
line 22 toapplication/did+json
it does work as universal resolver now returns the context. Is this a viable solution or does it imply other problems?The same behaviour can be observed with other methods like
ion
with for example:Sample code / test case
Aries configuration:
Call to VDRController:
Simulating current resolve request:
Simulating possible solution: