input-output-hk / prism-did-method-spec

Apache License 2.0
15 stars 1 forks source link

Which public key encoding should be used in the DID document? #7

Closed peacekeeper closed 1 year ago

peacekeeper commented 1 year ago

The DID document example currently uses publicKeyBase58: https://github.com/input-output-hk/prism-did-method-spec/blob/9b63d9f75cfdce2840972a214a15efafacf21165/w3c-spec/PRISM-method.md?plain=1#L96

But the text above that mentions JWK: https://github.com/input-output-hk/prism-did-method-spec/blob/9b63d9f75cfdce2840972a214a15efafacf21165/w3c-spec/PRISM-method.md?plain=1#L77

This should be made consistent, and there are various options of representing public keys.

I would probably go with publicKeyBase58, i.e. leave the example as-is but change the associated text.

EzequielPostan commented 1 year ago

@patlo-iog , I think you are closer to the implementation than me here. Could you expand a bit on what we have?

patlo-iog commented 1 year ago

The current implement is using publicKeyJwk for encoding public key and we're only using 4 fields in JWK: kty, crv, x, y right now. It would be nice to use publicKeyJwk as it is already implemented. I don't see it as a blocker if we switch to publicKeyBase58, but I'll need some reference I can refer to when switching.

peacekeeper commented 1 year ago

Related to https://github.com/input-output-hk/prism-did-method-spec/issues/19. Perhaps it's really best to just use publicKeyJwk to be as flexible as possible.

EzequielPostan commented 1 year ago

given the comments in #19 , I guess I will update the spec to correct the "translation to JSON-LD" section so that it uses JWK. For the specifics of #19, I imagine we will stick to supporting only secp and ed255 keys for now, using the current protobuf models