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

Add key expression formats for ed25519. #102

Merged
merged 33 commits into from
Dec 6, 2019

Conversation

msporny
Copy link
Member

@msporny msporny commented Nov 10, 2019

index.html Outdated
base58-btc format using the <code>publicKeyBase58</code> property or
MAY be encoded in JSON Web Key (JWK) format using the <code>publicKeyJwk</code>
property. Both the raw 32-byte base58-btc format and JWK format MUST be
supported by DID Document Processors. The use of other key formats for RSA MUST
Copy link
Contributor

@troyronda troyronda Nov 10, 2019

Choose a reason for hiding this comment

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

This line has RSA instead of ed25519?

Similarly in the other PRs.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a mistake, will fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 41b0b47.

index.html Outdated
<td>
ed25519 key values MAY be expressed as the raw 32-byte value encoded in
base58-btc format using the <code>publicKeyBase58</code> property or
MAY be encoded in JSON Web Key (JWK) format using the <code>publicKeyJwk</code>
Copy link
Contributor

Choose a reason for hiding this comment

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

One question here is ... does anyone really use JWK for ed25519? If not, we could eliminate it and just have the common base58 representation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, use of JWKs for Ed25519 is common. That's why members of the community developed RFC 8037 - to define how to use the 25519 and 448 curves with JSON.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if anyone is currently using JWKs as a representation right now for ed25519 keys, (legacy implementations appear to use base58) but I read this as implementers of future DID registries are encouraged to use JWKs rather than base58.

Copy link
Member Author

Choose a reason for hiding this comment

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

@selfissued wrote:

Yes, use of JWKs for Ed25519 is common.

Do you have data or a citation for this assertion? I expect that's true in certain communities, but which ones, and which implementations?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@selfissued selfissued left a comment

Choose a reason for hiding this comment

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

Please revise the wording along the lines of that suggested for RSA keys in #100 (review) to indicate that allowing for PublicKeyBase58 is an exception, and explicitly limiting the algorithms and curves that it may be used with.

@dlongley
Copy link
Contributor

Note: We also need one of these PRs for Curve25519 (X25519KeyAgreementKeys) -- I'd expect it to look pretty much the same as this one.

index.html Outdated
@@ -1348,6 +1348,19 @@ <h2>
MAY be encoded in JSON Web Key (JWK) format using the <code>publicKeyJwk</code>
property. Both the raw 32-byte base58-btc format and JWK format MUST be
supported by DID Document Processors. The use of other key formats for RSA MUST
Copy link
Contributor

Choose a reason for hiding this comment

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

RSA mentioned on the end of this line too?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a mistake, will fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 41b0b47.

index.html Outdated
</td>
<td>
ed25519 key values MAY be expressed as the raw 32-byte value encoded in
base58-btc format using the <code>publicKeyBase58</code> property or
Copy link
Contributor

Choose a reason for hiding this comment

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

While base58 was introduced by btc, I don't think there's any difference between base58 and base58-btc. Would be more clear to simply say base58 here IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

There are two base58 encodings... Bitcoin's and Flickr's... We need to be specific about which one we're using (most use Bitcoin's base58 encoding scheme).

Copy link
Member Author

@msporny msporny Nov 17, 2019

Choose a reason for hiding this comment

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

Tried to clarify in 41b0b47.

index.html Outdated
ed25519 key values MAY be expressed as the raw 32-byte value encoded in
base58-btc format using the <code>publicKeyBase58</code> property or
MAY be encoded in JSON Web Key (JWK) format using the <code>publicKeyJwk</code>
property. Both the raw 32-byte base58-btc format and JWK format MUST be
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment here. s/base58-btc/base58/

Copy link
Member Author

Choose a reason for hiding this comment

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

There are two base58 encodings... Bitcoin's and Flickr's... We need to be specific about which one we're using (most use Bitcoin's base58 encoding scheme).

Copy link
Member Author

@msporny msporny Nov 17, 2019

Choose a reason for hiding this comment

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

Tried to clarify in 41b0b47.

@msporny msporny force-pushed the msporny-issue-67-secp256k1 branch from 150bcee to f21dcd1 Compare November 17, 2019 16:29
@msporny msporny force-pushed the msporny-issue-67-ed25519 branch from 419c8ec to 41b0b47 Compare November 17, 2019 16:32
Copy link
Member Author

@msporny msporny left a comment

Choose a reason for hiding this comment

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

Note: We also need one of these PRs for Curve25519 (X25519KeyAgreementKeys) -- I'd expect it to look pretty much the same as this one.

Added PR to cover this here: #110

@msporny
Copy link
Member Author

msporny commented Nov 17, 2019

Please revise the wording along the lines of that suggested for RSA keys in #100 (review) to indicate that allowing for PublicKeyBase58 is an exception, and explicitly limiting the algorithms and curves that it may be used with.

Updated language to reflect the most recent straw poll results in #67 (comment).

index.html Outdated
<td>
Ed25519 public key values MUST be encoded in either JSON Web Key (JWK)
format using the <code>publicKeyJwk</code> property or as the raw 32-byte
public key value encoded in Base58 Bitcoin format using the
Copy link
Member

Choose a reason for hiding this comment

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

Each occurrence of Base58 Bitcoin format should be linked to (a reference to) the relevant spec/RFC/whatever.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

This appears to be a better choice, albeit not a standard in the usual sense, as it actually says something -- https://en.bitcoin.it/wiki/Base58Check_encoding

Copy link
Member Author

Choose a reason for hiding this comment

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

This was done in the msporny-issue-67 PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW, Base58Check is not Base58 BTC -- Base58Check is a bad name and requires a funky double sha256 + checksum algorithm above and beyond base encoding. We are suggesting base58btc. That said, the issue notes that we haven't made a decision here yet, and still need to do so.

@msporny msporny force-pushed the msporny-issue-67-secp256k1 branch from f21dcd1 to 9d76711 Compare November 27, 2019 04:31
@msporny msporny force-pushed the msporny-issue-67-ed25519 branch from 41b0b47 to 1fce006 Compare November 27, 2019 04:46
index.html Outdated
ed25519
</td>
<td>
Ed25519 public key values MUST be encoded as the raw 32-byte public key value
Copy link
Member

Choose a reason for hiding this comment

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

Ed25519 public key values MUST be encoded as the raw 32-byte public key value
encoded in Base58 Bitcoin format using the <code>publicKeyBase58</code> property
if they are not encoded in JWK format.

->

Ed25519 public key values MUST be encoded in JSON Web Key (JWK) format using
the <code>publicKeyJwk</code> property or with the raw 32-byte public key
value encoded in Base58 Bitcoin format using the <code>publicKeyBase58</code>
property.

Copy link
Member Author

Choose a reason for hiding this comment

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

While I agree with your wording, the consensus position of the group on @selfissued's proposal was to not word things in the way that you worded them. What you are suggesting is more or less what we had before, and the group straw polled to change it so that we don't have normative statements about JWK's usage in the table.

Copy link
Member

Choose a reason for hiding this comment

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

I do not recall such a straw poll (which you refer to nearby as a resolution, where you cite the special Monday call, which I was not able to join). I do not think I would have agreed with it, given the result, and I do not recall it being mentioned in the regular Tuesday call. Can you provide a specific pointer to the relevant section of minutes?

In any case -- I'm suggesting the text be changed because the current wording is clumsy at best, and confusing at worst. Either the table should only mention the alternative encodings (leaving all mention of JWK in the preceding text), or it should be fully explicit (and mention both/all encoding options for each public key in the row), as in the table text I've suggested.

Copy link
Member Author

Choose a reason for hiding this comment

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

The table now does the following thing you requested:

it should be fully explicit (and mention both/all encoding options for each public key in the row)

Copy link
Contributor

@selfissued selfissued left a comment

Choose a reason for hiding this comment

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

I would prefer that the wording be changed to "Secp256k1 public key values MUST either be encoded as a JWK or be encoded as the raw 32-byte public key value encoded in Base58 Bitcoin format using the publicKeyBase58 property." That would put the two representations on a more even editorial footing.

@msporny msporny force-pushed the msporny-issue-67-secp256k1 branch from 9d76711 to 943db24 Compare December 3, 2019 15:20
@msporny
Copy link
Member Author

msporny commented Dec 6, 2019

Ok, this PR is good to be merged down into msporny-issue-67-secp256k1... please make all future comments there.

@msporny msporny merged commit 3eadfb7 into msporny-issue-67-secp256k1 Dec 6, 2019
@msporny msporny deleted the msporny-issue-67-ed25519 branch January 7, 2020 15:54
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.

9 participants