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

Optimize DID resolution in proof verification #263

Open
clehner opened this issue Aug 23, 2021 · 0 comments
Open

Optimize DID resolution in proof verification #263

clehner opened this issue Aug 23, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@clehner
Copy link
Contributor

clehner commented Aug 23, 2021

Currently, when verifying a VC or VP, the issuer/holder id is usually resolved twice: once to verify that the proof's verification method has the appropriate verification relationship with the issuer in its DID document, and then again when verifying the proof, to dereference the verification method and get the key material to perform verification. With did:web, this results in two HTTPS requests.
Other DID+VC implementations perform similarly.
While resolving a did:key may be fast and cheap, HTTP(S) requests are more expensive and may be slow: w3c-ccg/vc-api#173. It may therefore be desirable to have verification do only one DID resolution when possible. This could be accomplished in one of two ways:

  1. Cache/memoize DID resolution during verification. i.e. in the verify function, and/or outside it, wrap the resolver in a new struct, e.g. MemoizedResolver, that implements and memoizes DIDResolver. Since the DIDResolver trait methods take an immutable reference to the DIDResolver trait object, either those trait functions would have to be changed to use mutable references, or the MemoizedResolver would need to use interior mutability, e.g. with RefCell. Caching resolution results would also be useful if verifying the proof requires verifying additional proofs, e.g. fetching a verifying a revocation list / status list credential.
  2. Refactor verification to require only one DID resolution when the verification method is defined in the issuer's DID document. We have the beginnings of this in Implement default verification method #253 in the get_verification_methods function. The ProofSuite functions in src/ldp.rs could be changed to take a VerificationMethodMap argument instead of dereferencing the VM id on its own.

Also: spruceid/didkit#39

sbihel added a commit that referenced this issue Sep 9, 2021
Also enable socks proxy support by default.

Close #263
Close spruceid/didkit#39
sbihel added a commit that referenced this issue Sep 9, 2021
Also enable socks proxy support by default.

Close #263
Close spruceid/didkit#39
@clehner clehner added the enhancement New feature or request label Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant