Hi Nikos

there is no correct answer.

The subject does not need to have an ID. It can be missing, meaning that it is a bearer credential. If this bearer credential has a publicKeyJwk property as you suggest in b) below, you could define its semantics as "this is the public key of the bearer of this credential".

Otherwise you can transform the public key into a URI and use it as the subject ID which your method a) proposes.

Clearly it is best to agree on one "standard" method if you want to interwork with others.

Kind regards

David

On 01/04/2021 12:56, Nikos Fotiou wrote:
Hi,
I have a case where I want to include in a VC the public key of the credential subject. I have thought of two approaches:

a) include in the "id" field of "credentialSubject"  a DID method like did:key or did:jwt (this an experimental method by David Chadwick)
b) add in the context of the credential "https://w3id.org/security", or create a credential type that has the property publicKeyJwk, and add inside  "credentialSubject"  something like:

"publicKeyJwk": {
      "crv": "Ed25519", 
      "x": "VCpo2LMLhn6iWku8MKvSLg2ZAoC-nlOyPVQaO3FxVeQ",
      "kty": "OKP", 
 } 

I find the latter approach "cleaner" but I am not sure if it is correct. Any opinion?

Best,
Nikos

--
Nikos Fotiou - http://pages.cs.aueb.gr/~fotiou
Researcher - Mobile Multimedia Laboratory
Athens University of Economics and Business
https://mm.aueb.gr