-
Notifications
You must be signed in to change notification settings - Fork 99
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 warning about publicKeyMultibase #772
Conversation
Agree with the re-ordering, but don't really understand the warning..
|
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Why would you ever want to represent the private key in the DID document? |
see the comments on |
Could you please provide a link to those comments, or at least to their neighborhood? |
You would not want to ever represent a private key in a did document. You probably would want to be able to represent a private key in the same way you represent the public key in a did document... for For Thats what the advisement is about... as of right now, its not possible and its not documented anywhere... here are some PRs that made this possible for:
https://github.com/multiformats/multicodec/pulls?q=is%3Apr+is%3Aclosed+private Noting that those are not all the key types that we see in did documents... in particular, there is not a single FIPS/NIST approved key that can have its private key component represented by |
https://w3c.github.io/did-core/#dfn-publickeyjwk
|
A related comment regarding the lack of clarity on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also suggest adding this sentence at the beginning of the advisement:
"Note that publicKeyMultibase is not a standard and is therefore subject to change."
@OR13 Even if it would be nice |
@selfissued thats fair, one example of that potential change would be requiring or forbidding EC point compression, although I have yet to see a |
@oed https://github.com/w3c/did-test-suite/search?q=publicKeyMultibase
https://github.com/multiformats/multicodec/blob/master/table.csv#L86 and as the table notes, its status is "draft". Are you using |
@OR13 According to the did-core spec:
It says nothing about using the multicodec varint so if those implementations use that it seems incorrect? Seems like if you use multicodec it should be named something like |
|
@OR13 you are missing my point. What's in did-core right now clearly does not mandate the use of multicodec. |
@oed I get your point, show me an example of what is in did core today, in the wild or in the test suite... I might even suggest that did core is wrong today, given the only example in the test suite appears to use multicodec. Also, would you mind commenting on this PR: https://github.com/w3c-ccg/lds-ed25519-2020/pull/11 |
I would be fine with that since I think using multicodec makes sense :) |
Folks may find this helpful in understanding why the reference to MULTIBASE - https://datatracker.ietf.org/doc/html/draft-multiformats-multibase-03 is currently included, but there is no reference to MULTICODEC: |
@jonnycrunch you may also have feelings on this subject :) |
index.html
Outdated
There might be some cases where <code><b>public</b>KeyMultibase</code> can | ||
be represented although <code><b>private</b>KeyMultibase</code> cannot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjustment to surrounding text, following on @OR13's addition of @selfissued's requested text....
There might be some cases where <code><b>public</b>KeyMultibase</code> can | |
be represented although <code><b>private</b>KeyMultibase</code> cannot. | |
Note that publicKeyMultibase is not a standard and is therefore subject to | |
change. Further, there might be some cases where | |
<code><b>public</b>KeyMultibase</code> can be represented although | |
<code><b>private</b>KeyMultibase</code> cannot. |
While this is true, we shouldn't assume everyone that uses publicKeyMultibase will want to use multicodec or not. Some may prefer raw keys, others may prefer multicodec. The only commonality between those two approaches is multibase (not multicodec), which is why the property is named the way it is. The assumption here is that your I expect there would be a large number of -1s for changing this to |
It would make sense to just have a type that's |
The danger there is that you take something that has two failsafes and move it to only having one. One of the goals with the Linked Data Security work is to make cryptography safer to use for most developers. That means putting in multiple fail-safes to reduce the number of foot guns in the ecosystem. For example -- being able to semantically express private key values should either not be defined (and be application-specific) OR should not be defined in cryptosuites that are used in DID Documents and other public-facing data structures (this is counter to what JWKs do, which is globally define private key values across all applications -- which has led to disastrous publication of private key material in public spaces). While we can't prevent that sort of thing from happening 100% of the time, there are things we can do to reduce the possibility of that happening. Another fail safe is double-checking the key type against the multicodec header. For example, Hope that helps provide some background, @oed. :) |
@msporny Hm, I fail to see why having two if statements would be better than one. I understand the concern about private keys, but that could easily be mitigated by not allowing private key multicodecs? |
For the same reason that having seatbelts paired with airbags is a good idea. Having two failsafes are typically better than one, especially if there is no big cost to adding the failsafe. Two barriers to get through to prevent catastrophic failure. :)
Private key multicodecs are already a thing -- that ship sailed when ed25519-priv was placed into the table 10 months ago: multiformats/multicodec@28f7ad5 The table now contains multiple private key multicodecs, making it possible to accidentally expose (and index) private keys encoded in multicodec. https://github.com/multiformats/multicodec/blob/master/table.csv#L131 |
It might give the impression that
Regarding
|
I mean in the implementations of my DID methods the underlying data structure just uses multicodec to represent public keys. Then uses the information in there to generate the DID document deterministically.
Multibase doesn't say anything about what the data itself is! |
@msporny @peacekeeper can you please review? |
@oed do you think we are making a terrible mistake by using Do we believe this will result in 2 non interoperable representations of |
@OR13 if the intention is to specify what the actual representation is in the "type" then I guess that's ok. I think it's redundant, but w/e. |
Yes, that's the intention. The encoding beyond the multibase encoding is signalled via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor rewording by request... otherwise, LGTM.
Co-authored-by: Manu Sporny <[email protected]>
@msporny accepted changes, pinged for re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm good with this version being merged. Thanks for doing this, @OR13 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I fully understand the second sentence of the advisement, but I think it's trying to prevent developers or users of certain libraries from including private key data in the DID document. This is good.
Co-authored-by: Ted Thibodeau Jr <[email protected]>
related side note, are we planning to update json-ld suite contexts to support publicKeyMultibase (and publicKeyJwk)? |
Editorial, multiple reviews, changes requested and made, no objections, merging. |
This PR:
privateKeyMultibase
representations potentially not existing.https://pr-preview.s3.amazonaws.com/w3c/did-core/pull/772.html#dfn-publickeymultibase
Preview | Diff