veramo icon indicating copy to clipboard operation
veramo copied to clipboard

[proposal] new Storage API

Open mirceanis opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe. Veramo can currently use a single data source for credentials, presentations and messages; an implementation of the IDataStore and IDataStoreORM interfaces.

Most other veramo top-level plugins use a layered approach, where the top-level plugin acts as a coordinator between multiple lower level implementations of a common interface.

Also, the IDataStoreORM interface is based on a relational data model, with a lot of assumptions about the connections between the data items being stored. This makes new implementations difficult, so a new solution should be adopted.

Describe the solution you'd like A new storage model should support multiple data sources. Adopting such a pattern for storage, would bring it in line with the rest of the API as well as allowing users to store data in multiple locations (local private data, remote backup, remote inbox service, remote public information)

The solution chosen should be able to run queries on the data. Examples of common queries include:

  • all credentials issued by an issuer
  • issued after a certain date
  • containing a certain claim
  • matching a certain Type
  • all messages of a particular type
  • all presentations that include a certain @context
  • a VC/VP/message by ID
  • ...

Equally important is the ability to filter for credentials using JSONPath matches that are used in the DIF Presentation Exchange and Credential Manifest protocols.

Additional context

Some related projects already use an adapter pattern to support multiple sources:

mirceanis avatar Nov 07 '22 15:11 mirceanis