Historical data access

Historical data access

The indexing model described in this page is theoretical - it could be built as all the fundamental building blocks exist. However, such an indexer hasn't been implemented yet. Users will be able to access historical data once it's implemented.

Users expect to see their entire activity history, even on a confidential platform. Mirage has been carefully designed to allow an efficient user activity indexer to be built.

Activity history access delegation

For user activity history to be indexed, an indexer must first obtain access to such history. Utilizing the voluntary disclosure compliance feature, users can allow any indexer to access their history.

Under such a mechanism, an indexer would publish their own address. Users who want the indexing service can grant audit log access to the address if they opt in to the indexing service.

Ideally, the indexing software is open-source, such that any user can be their own indexer if so desired.

Efficient history indexer

An efficient history indexer can be implemented for Mirage that listens to these events:

Event(s)DescriptionAction
Any user activity eventA user has performed a certain actionBuilds a database of activity; attempts to fetch identities for Borrowing and Repayment but it's fine for these to stay unknown.
AuditLogRevealedA certain audit log entry is now publicly availableFetches lender identity and populates the activity database.
LenderAuditLogsRevealedAll audit logs for a user are now publicly availableIterates through the user's audit log to gather audit log IDs; populates the relevant items in the activity database.
AuditApprovalGrantedAccess to all of a user's audit logs has been grantedSame as LenderAuditLogsRevealed.

The audit log iteration upon LenderAuditLogsRevealed and AuditApprovalGranted events only needs to be performed once to back-fill old activity items, as the indexer would always attempt to fetch identities for new items.

An indexer built this way is efficient - it does not need to rescan the entire history whenver a new user authorization happens.