Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support publicKeyBase58 for Ed25519Signature2018 #121

Merged
merged 1 commit into from
Mar 17, 2021
Merged

Support publicKeyBase58 for Ed25519Signature2018 #121

merged 1 commit into from
Mar 17, 2021

Conversation

clehner
Copy link
Contributor

@clehner clehner commented Mar 11, 2021

Support the publicKeyBase58 property of verification material, for the Ed25519 Signature 2018 verification method.

DID Core allows either publicKeyJwk or publicKeyBase58. Although there is discussion of the spec replacing publicKeyBase58 with publicKeyMultibase, there is currently a test case in vc-http-api-test-suite that relies on it.

@clehner clehner changed the title [WIP] Support publicKeyBase58 for Ed25519Signature2018 Support publicKeyBase58 for Ed25519Signature2018 Mar 11, 2021
Copy link
Member

@sbihel sbihel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I realise I use publicKeyBase58 for the did:tz resolution, should I change that to JWK as we currently only support ed25519? My thinking was that it was more "idiomatic" as Tezos tools always manipulate those keys as base 58.

PS: little typo in your PR message, a publicKeyBase58 needs to be publicKeyMultiBase

@clehner
Copy link
Contributor Author

clehner commented Mar 15, 2021

@sbihel I would suggest using publicKeyJwk where possible. Tezos uses base58 with prefixes e.g. edpk, but this is not consistent with other linked data proof types; for example the Ed25519Signature2018 spec uses just the 32-byte public key in publicKeyBase58. I think it could create confusion/noninteroperability if we allow both Tezos-prefixed keys and raw bytes in publicKeyBase58.

I have leaned away from publicKeyBase58 because it doesn't seem as clear how the public keys should be serialized. I see now that did-method-key has test vectors for EcdsaSecp256k1VerificationKey2019 using publicKeyBase58. But I am unable to find any examples or specification for EcdsaSecp256r1VerificationKey2019 (P-256), e.g. to know whether it should use compressed, uncompressed or untagged representation. publicKeyJwk is more well-specified, in IETF RFCs.

If the smart contract and/or other tools need to use Tezos-style base58 keys, we could probably convert them to JWK internally.

@wyc wyc self-requested a review March 17, 2021 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants