fmgp.did.method.prism
Members list
Packages
Type members
Classlikes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CardanoService.type
DID Prism (only short form)
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
DIDPrismResolver.type
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
DIDResolverProxy.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
EventHash.type
Attributes
- Supertypes
- Self type
-
EventRefOrdering.type
Inspiration from Git
Inspiration from Git
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class PrismChainServiceImpl
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PrismChainServiceclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PrismState.type
Writable PRISM state interface extending PrismStateRead with event storage capabilities.
Writable PRISM state interface extending PrismStateRead with event storage capabilities.
Adds methods to persist blockchain events to the state backend. Events are added without validation, allowing implementations to handle ordering and chain integrity according to their storage strategy.
Attributes
- Example
-
val state: PrismState = ??? val event: MySignedPrismEvent[CreateDidOP] = ??? for { _ <- state.addEvent(event) ssi <- state.getSSI(event.event.didPrism) } yield ssi - Companion
- object
- Supertypes
- Known subtypes
-
class PrismStateInMemoryclass PrismStateMongoDB
- Self type
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PrismStateReadclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PrismStateReadclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
PrismStateInMemory.type
Thread-safe in-memory implementation of PrismState using ZIO Ref.
Thread-safe in-memory implementation of PrismState using ZIO Ref.
Stores all events and indices in memory using immutable maps. Suitable for testing, development, and small datasets where persistence is not required. Not recommended for production use with large datasets.
==Event Chain Tracking==
This implementation tracks event chains by recursively following previousEventHash references:
- Create operations establish the root of a chain
- Update/Deactivate operations reference previous events
- Helper methods
ssiFromPreviousEventHashandvdrFromPreviousEventHashtraverse chains to find roots
==Thread Safety==
All state updates use ZIO Ref for lock-free, thread-safe mutations. Multiple concurrent operations are safely handled without explicit locking.
Value parameters
- ref
-
ZIO Ref containing mutable PrismStateInMemoryData
Attributes
- Constructor
-
Creates in-memory state with ZIO Ref
- Example
-
for { state <- PrismStateInMemory.empty _ <- state.addEvent(createEvent) _ <- state.addEvent(updateEvent) ssi <- state.getSSI(didSubject) docs <- state.didDocuments } yield (ssi, docs) - Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PrismStatetrait PrismStateReadclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
Data container for in-memory PRISM state storage.
Data container for in-memory PRISM state storage.
Value parameters
- opHash2op
-
Map of event hash (hex string) to signed events
- ssi2eventRef
-
Map of DID subjects to their event references
- tx2eventRef
-
Map of transaction ID to event references
- vdr2eventRef
-
Map of VDR references to their event references
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
PrismStateMongoDB.type
MongoDB-backed implementation of PrismState for production use.
MongoDB-backed implementation of PrismState for production use.
This implementation uses a sophisticated two-collection strategy to Debug out-of-order blockchain events:
==Collections==
'''Main Collection (events):''' Stores events with known parent relationships. Each event is stored with a rootRef field that tracks the root event (Create operation) of its chain. This enables efficient querying of all events for a DID or VDR by querying on the rootRef field.
'''Lost Collection (events_lost):''' Stores orphaned events whose parent (referenced via previousEventHash) has not yet been seen. This handles the case where Update or Deactivate operations arrive before their corresponding Create operation.
==Event Chain Tracking==
Events form chains through previousEventHash references:
- Create operations (CreateDidOP, CreateStorageEntryOP) start chains and have no previous hash
- Update/Deactivate operations reference the previous event's hash
- All events in a chain share the same
rootRef(the hash of the Create event)
When adding an event:
- If it has no
previousEventHash, it's inserted withrootRef = eventHash - If it has a
previousEventHash, we search for the parent event - If parent exists, event is inserted with parent's
rootRef - If parent is missing, event goes to lost collection for potential later recovery
Value parameters
- reactiveMongoApi
-
MongoDB connection wrapper using ReactiveMongo driver
Attributes
- Constructor
-
Creates a MongoDB-backed PRISM state
- Example
-
val mongoApi: ReactiveMongoApi = ??? val state = PrismStateMongoDB(mongoApi) for { _ <- state.addEvent(createEvent) _ <- state.addEvent(updateEvent) ssi <- state.getSSI(didSubject) } yield ssi - Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PrismStatetrait PrismStateReadclass Objecttrait Matchableclass AnyShow all
Read-only interface for querying PRISM blockchain state.
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) - Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
trait PrismStateclass PrismStateInMemoryclass PrismStateMongoDBclass PrismStateFSclass PrismStateHTTP
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
SSIHistory.type