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

Improve DID URL dereferencing for verification methods #128

Merged
merged 3 commits into from
Mar 17, 2021
Merged

Conversation

clehner
Copy link
Contributor

@clehner clehner commented Mar 16, 2021

Copied from #122

Verification method maps may appear in a DID document in multiple places, e.g. authentication or assertionMethod. Previously we required them to be under the verificationMethod property. When a verification method (or its id) is included in one of these arrays, it indicates a verification relationship between the DID subject and the verification method. These verification relationships correspond to the proofPurpose property in linked data proofs. DID Core says that the assertionMethod verification relationship is used for issuing Verifiable Credentials. It also says that authentication is used for authenticating via challenge-response protocols. Typically, the authentication proof purpose is used for creating Verifiable Presentations, as seen in VC Data Model - Example 45, and in test cases in vc-http-api-test-server such as case-1.json. We should respect verification relationships when verifying proofs.

This PR sets the default behavior for verifying a verifiable credential or verifiable presentation to require the proof's verification method to be in the DID document with the verification relationship corresponding to the proof purpose in the verification options - with assertionMethod the default proof purpose for a VC, and authentication the default for a VP.

This change only affects verification. During issuance, the proof purpose and verification method must still be passed in as options.

The publicKey is added back to the DID document even though it is no longer in DID Core, since there is a test case in vc-http-api-test-server that depends on it. It is treated as another place where verification methods may be stored, like the verificationMethod array. A verification method in the verificationMethod array or publicKey array should also be referenced in one of the verification relationship arrays like assertionMethod and/or authentication, to express a verification relationship and therefore be used with linked data proofs.

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.

I assumed there were no particular change from the previous PR I reviewed.

@wyc wyc merged commit d6922ee into main Mar 17, 2021
@clehner clehner deleted the feat/more-vm-deref branch March 18, 2021 13:31
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.

None yet

3 participants