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

Resolve DIDDocument from cached events #426

Open
nichonien opened this issue Apr 21, 2022 · 2 comments
Open

Resolve DIDDocument from cached events #426

nichonien opened this issue Apr 21, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@nichonien
Copy link

Hi Team,

The did resolution to DIDDocument takes blockchain interaction to execute and sometimes may not be efficient for large number of resolution calls. If the resolver could have configurations / options to accept cached did events and fetch the events beyond the cached scope to create the DIDDoc it would be much more faster I guess.

So the resolver might look like, resolver(did, cachedEvent[], lastBlock). The lastBlock param would be the block number till where the events have been cached.

Let me know your thoughts. Thanks!

@clehner clehner added the enhancement New feature or request label Apr 21, 2022
@clehner
Copy link
Contributor

clehner commented Apr 21, 2022

Hi @nichonien,

Sounds like a useful construct.

A query would still need to be made to the underlying blockchain or verifiable data registry, to see if there is new information that would invalidate the cache, right? Is the idea that only the block height needs to be queried?

It might also assist testing and particular applications to effectively enable constructing simple DID method implementations by pre-populating DID resolution results in the cache.

Related issue about caching internally to VC verification: #263.

Maybe lastBlock could be a DID resolution option (input metadata). It would just be a number, right? A non-blockchain generalization might be to use a timestamp.
Currently we have a no-cache binary option, from DID Resolution, although we're not yet making use of it.

Providing the cached DID resolutions, and implementing the lastBlock option, could be done independently.

@nichonien
Copy link
Author

Thanks @clehner for sharing the ongoing work and resources to understand better. Looks like the team has already envisioned possibility of caching .

A query would still need to be made to the underlying blockchain or verifiable data registry, to see if there is new information that would invalidate the cache, right? Is the idea that only the block height needs to be queried?

Yes, so the API would receive the cached events and the lastBlock, so it is only needed to query the blockchain for events between lastBlock and latest.

It might also assist testing and particular applications to effectively enable constructing simple DID method implementations by pre-populating DID resolution results in the cache.

Agreed, also the caching system could always sync the last events from the blockchain even without the request for resolution. So if there is any use case for checking history of updates for did it could be very well performed with just the cached events. It would definitely open more possibility for efficient executions for different use cases.

hmm, the lastBlock could be part of resolution metadata, it would be number as the events should be cached with reference to blockchain and tech conventions and it should have no influence with a non-blockchain scope.

Providing the cached DID resolutions, and implementing the lastBlock option, could be done independently.

I didn't really understand your reference here.

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

2 participants