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

Update PortableDID Part 1 #19

Merged
merged 2 commits into from
Feb 4, 2024
Merged

Update PortableDID Part 1 #19

merged 2 commits into from
Feb 4, 2024

Conversation

mistermoe
Copy link
Contributor

@mistermoe mistermoe commented Feb 4, 2024

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 below

What's Included

changed ToKeys and FromKeys to ToPortableDID and FromPortableDID respectively

ToKeys and FromKeys no longer made sense because PortableDID includes more than just keys.


ToPortableDID no longer throws if the BearerDID'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 a PortableDID. This is useful because there's still necessary state even when re-inflating a BearerDID with an HSM based key manager


added Document field to PortableDID

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 to PrivateKeys

Now that we have the DID Document, including what was previously in VerificationMethod is duplicative

added Metadata. Used to store method-specific properties


What's Not Included

FromPortableDID doesn't accept an optional KeyManager arg yet

Will 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 explicit published 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 and ToPortableDID are in the did package right now which makes calling these functions from outside the package look like did.FromPortableDID and did.ToPortableDID. It's not evident what representation of DID you're going to or from just by reading the line of code.

@mistermoe mistermoe merged commit 947009d into main Feb 4, 2024
@mistermoe mistermoe deleted the portable-did branch April 14, 2024 06:08
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.

2 participants