Skip to content

Storage Operations

This document outlines the storage operations permitted within the SDK.

What Can Be Stored?

The SDK currently allows the storage of: - Credentials: Current account credentials. - Objects: General data objects. - Presentations: (Upcoming feature) Credential presentations.

Storage Location

The SDK uses SQLite for state management, similar to its mobile implementation. This means that data is stored on the filesystem. If you are running the SDK within a container, you will need to configure a volume to persist this data.

Usage Recommendations

Developers are encouraged to use the SDK's storage capabilities where appropriate: - Object Storage: Utilize for general application state management. - Credentials and Presentations: Use when they relate to the identity of the SDK/application/organization, as they are essential for proving identity.

From a compliance and licensing perspective, developers should avoid storing any state about others, except for addresses used as references.

Usage

Credential Storage

You can store credentials in the credential store using the CredentialStore method. Just pass in the credential you want to store as parameter.

selfAccount.CredentialStore(c)

To retrieve a credential from the store, you can use any of the CredentialLookupBy... methods exposed by the SDK. Just pass in the ID of the credential you want to retrieve.

c, err := selfAccount.CredentialLookupByCredentialType(credentialType []string)
// manage errors

[!WARNING] Removing credentials is not yet supported by the SDK.

Object Storage

This is not yet implemented.

Presentation Storage

This is not yet implemented.

Conclusion

The SDK's storage capabilities are designed to be used where they make sense, particularly for identity-related data. While the current setup is not configurable, it provides a robust solution for managing application state and identity data.