w3c-ccg / did-spec

Please see README.md for latest version being developed by W3C DID WG.
https://w3c.github.io/did-core/
Other
124 stars 45 forks source link

Definition of a valid value property of a public key is vague. #105

Closed gjgd closed 5 years ago

gjgd commented 6 years ago

According to the examples given here, it is not clear if the format of the value property for a public key should be publicKey<ENCODING> or if it can be anything (eg ethereumAddress like in the Uport's repo )

aljones15 commented 5 years ago

I agree with this one and I think the current spec is even more confusing:

The value of the publicKey property MUST be an array of public keys, and every public key property MUST be in the Linked Data Cryptographic Suite Registry.

I believe value property refers to one of:

The following is a non-exhaustive list of public key properties used by the community: publicKeyPem, publicKeyJwk, publicKeyHex, publicKeyBase64, publicKeyBase58, publicKeyMultibase, ethereumAddress.

I think it would be clearer if reworded:

Each public key MUST include id and type properties, and exactly one value property as defined in Linked Data Cryptography Suites and Key Formats. The array of public keys SHOULD NOT contain duplicate entries with the same id and different value properties with different formats.

EDIT:

just spoke to @msporny apparently this means that id and type can only be a single value i.e. id and type can be a string or a number or a boolean but not an object or array... which does not make that much sense.

dlongley commented 5 years ago

"and exactly one value property"

We should not have a requirement that a public key can't list its material in more than one format. The material should not be different, but there may be some client software that only understands publicKeyPem and other client software that only understands publicKeyBase58 ... and you should be able to list both in your public key to allow for interop with both.

peacekeeper commented 5 years ago

I believe this has been addressed by https://github.com/w3c-ccg/did-spec/pull/202 and can be closed.