Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR is part 1 of 3 to introduce changes discussed here: decentralized-identity/web5-spec#112 (comment).
Important
Prioritizing the changes in this first PR because it includes stuff that i need in order to implement
did:web
which is necessary to unblock a bunch of work for the upcoming week. Details on what was and wasn't included in the sections belowWhat's Included
changed
ToKeys
andFromKeys
toToPortableDID
andFromPortableDID
respectivelyToKeys
andFromKeys
no longer made sense becausePortableDID
includes more than just keys.ToPortableDID
no longer throws if theBearerDID
's Key Manager cannot export keys. Instead,PrivateKeys
is omitted.This makes it so
BearerDID
created using HSM based key manager's can still be exported to aPortableDID
. This is useful because there's still necessary state even when re-inflating aBearerDID
with an HSM based key manageradded
Document
field toPortableDID
Including the DID Document allows us to import a DID without making potential network calls and also does not require DIDs to be published prior to exporting them.
changed
VerificationMethod
field toPrivateKeys
Now that we have the DID Document, including what was previously in
VerificationMethod
is duplicativeadded
Metadata
. Used to store method-specific propertiesWhat's Not Included
FromPortableDID
doesn't accept an optionalKeyManager
arg yetWill likely move this function to method-specific packages to accommodate method-specific metadata. Also haven't decided how to share functional options yet.
PortableDID.Metadata
doesn't include an explicitpublished
property yet.This is simply because i can't remember a detail we discussed in the meeting where we decided all of these thangs. will double back with @frankhinek and @amika-sq and then make the appropriate change
What's Weird Right Now
FromPortableDID
andToPortableDID
are in thedid
package right now which makes calling these functions from outside the package look likedid.FromPortableDID
anddid.ToPortableDID
. It's not evident what representation of DID you're going to or from just by reading the line of code.