openssi / peer-did-method-spec

A spec for the did:peer DID method.
https://dhh1128.github.io/peer-did-method-spec/index.html
Apache License 2.0
30 stars 17 forks source link

Use `@base` so fragment ids are valid IRIs #121

Closed OR13 closed 4 years ago

OR13 commented 4 years ago

https://identity.foundation/sidetree/spec/

If the DID Document is being rendered in the JSON-LD representation variant, the implementer SHOULD add an @base entry to the document’s @context, and set the @base value to the id of the resolved DID. This ensures relative path values in the output DID Document are correctly projected into id-related strings by JSON-LD parsers.

Example: https://did.actor/bob/did.json

{
  "@context": [
    "https://www.w3.org/ns/did/v1",
    {
      "@base": "did:web:did.actor:bob"
    }
  ],
  "id": "did:web:did.actor:bob",
  "publicKey": [
    {
      "id": "#z6MkkQBvgvqb6zGvS4cydworpUaRDzpszSFixq49ahbDeUTG",
      "type": "Ed25519VerificationKey2018",
      "controller": "",
      "publicKeyBase58": "6wvt6gb9mSnTKZnGxNr1yP2RQRZ2aZ1NGp9DkRdCjFft"
    }
  ]
}
dhh1128 commented 4 years ago

Closing now that issue is moved to its new repo home at https://github.com/decentralized-identity/peer-did-method-spec/issues/13.