PrismStateRead

fmgp.did.method.prism.PrismStateRead

Read-only interface for querying PRISM blockchain state.

This trait provides methods to query the state of PRISM DIDs (Decentralized Identifiers) and VDRs (Verifiable Data Registries) from an event-sourced storage backend. Events represent blockchain operations (create, update, deactivate) that form immutable chains tracked through hash references.

==Key Concepts==

'''SSI (Self-Sovereign Identity):''' A PRISM DID (e.g., did:prism:xxx) managed through CreateDidOP, UpdateDidOP, and DeactivateDidOP events. SSIs represent identity with keys and services.

'''VDR (Verifiable Data Registry):''' Storage entries owned by a DID, managed through CreateStorageEntryOP, UpdateStorageEntryOP, and DeactivateStorageEntryOP events. Used for storing arbitrary data on-chain.

'''Event Chains:''' Operations form chains via previousEventHash references. Create operations start chains; update/deactivate operations reference previous events. All events in a chain share the same root hash.

Attributes

Example
val state: PrismStateRead = ???
for {
 events <- state.getEventsForSSI(didSubject)
 ssi <- state.getSSI(didSubject)
 history <- state.getSSIHistory(didSubject)
} yield (events, ssi, history)
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def cursor: ZIO[Any, Nothing, EventCursor]

Attributes

Returns

EventCursor of the latest Event

Gets a specific event by its EventHash.

Gets a specific event by its EventHash.

Attributes

def getEventsIdBySSI(ssi: DIDSubject): ZIO[Any, Nothing, Seq[EventRef]]

Returns event references for a specific SSI DID.

Returns event references for a specific SSI DID.

Attributes

def getEventsIdByVDR(id: RefVDR): ZIO[Any, Nothing, Seq[EventRef]]

Returns event references for a specific VDR.

Returns event references for a specific VDR.

Attributes

def ssi2eventsRef: ZIO[Any, Nothing, Map[DIDSubject, Seq[EventRef]]]

Returns mapping of all SSI DIDs to their event references.

Returns mapping of all SSI DIDs to their event references.

Attributes

Note

TODO: make it a Stream of (DIDSubject, Seq[EventRef])

def vdr2eventsRef: ZIO[Any, Nothing, Map[RefVDR, Seq[EventRef]]]

Returns mapping of all VDRs to their event references.

Returns mapping of all VDRs to their event references.

Attributes

Note

TODO: make it a Stream of (RefVDR, Seq[EventRef])

Concrete methods

Fetches all events in the chain for the given DID.

Fetches all events in the chain for the given DID.

Attributes

Returns

ZIO effect that may fail with Throwable (RuntimeException if event hash missing or type validation fails) and succeeds with sequence of DID-related MySignedPrismEvent

Fetches all events in the chain for the given VDR reference.

Fetches all events in the chain for the given VDR reference.

Value parameters

refVDR

The VDR reference to query

Attributes

Returns

ZIO effect that may fail with Throwable (RuntimeException if event hash missing or type validation fails) and succeeds with sequence of storage-related MySignedPrismEvent

def getSSI(ssi: DIDSubject): ZIO[Any, Throwable, SSI]

Gets the current SSI state.

Gets the current SSI state.

Attributes

Gets the full SSIHistory for a SSI.

Gets the full SSIHistory for a SSI.

Attributes

def getVDR(ref: RefVDR): ZIO[Any, Throwable, VDR]

Gets the VDR state with full ownership validation.

Gets the VDR state with full ownership validation.

Attributes

Returns the last synced block timestamp.

Returns the last synced block timestamp.

Attributes

Returns

Tuple of (epoch seconds, nanoseconds)

Note

Current implementation returns current time (FIXME: should track actual sync state)

def ssiCount: ZIO[Any, Nothing, Int]

Returns count of SSI DIDs in the state.

Returns count of SSI DIDs in the state.

Attributes

Note

TODO: improve in specific implementations for better performance

def vdrCount: ZIO[Any, Nothing, Int]

Returns count of VDRs in the state.

Returns count of VDRs in the state.

Attributes

Note

TODO: improve in specific implementations for better performance