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)
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