w3c / did-resolution

RELEASED DRAFT: Decentralized Identifier Resolution (DID Resolution) 0.2 Specification
https://w3c.github.io/did-resolution/
Other
14 stars 9 forks source link

Expand referenced keys to inline keys #39

Open peacekeeper opened 4 years ago

peacekeeper commented 4 years ago

This issue tracks https://github.com/hyperledger/aries-rfcs/issues/117 by @mitfik:

When DID resolver resolves DID url with service query it provides the block for whole service with keys references.

Does it make sens that DID resolver can already compile all keys inline so the requester does not have to resolve each key separately?

llorllale commented 4 years ago

@peacekeeper what would this look like? A JWK in compact form?

peacekeeper commented 4 years ago

I think what @mitfik is looking at are service endpoints like this:

{
  "service": [{
    "id": "did:example:123456789abcdefghi#did-communication",
    "type": "did-communication",
    "recipientKeys" : [ "did:example:123456789abcdefghi#1" ],
    "serviceEndpoint": "https://agent.example.com/"
  }],
  "publicKeys": [{
    "id": "did:example:123456789abcdefghi#1",
    "type": "Ed25519VerificationKey2018",
    "controller": "did:example:123456789abcdefghi",
    "publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
  }]
}

You can see that the service block references the public key did:example:123456789abcdefghi#1.

I believe he is suggesting that a DID Resolver could automatically expand that referenced public key inside the service block, i.e.:

{
  "service": [{
    "id": "did:example:123456789abcdefghi#did-communication",
    "type": "did-communication",
    "recipientKeys" : [{
      "id": "did:example:123456789abcdefghi#1",
      "type": "Ed25519VerificationKey2018",
      "controller": "did:example:123456789abcdefghi",
      "publicKeyBase58": "H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV"
    }],
    "serviceEndpoint": "https://agent.example.com/"
  }]
}

My feedback in that other original issue is that I think a standard JSON-LD processor could have built-in support for transformations like this.

tplooker commented 4 years ago

+1 to this I think this is a great addition!