Expand description
§Cyphr Storage
Storage backends for the Cyphr identity protocol.
This crate provides a backend-agnostic storage API for persisting
Cyphr principals, cozies, and actions. The core Store trait
defines the minimal interface that any storage backend must implement.
§Design Principles
- Storage is dumb: The storage layer only handles bytes. All semantic
operations (verification, state computation) are handled by
cyphr. - Immutable history: Entries are append-only; past entries are never modified.
- Order via
prechain: Canonical order is derived from cozprefield chaining, not storage order. - Bit-perfect preservation: Entries store original JSON bytes to ensure
correct
czdcomputation. SeeEntryfor details.
§Included Backends
FileStore: File-based storage using JSONL format (one file per principal).
Structs§
- Checkpoint
- Trusted checkpoint for partial replay.
- Commit
Entry - A stored commit bundle for the commit-based JSONL format.
- Entry
- A stored entry preserving bit-perfect JSON bytes.
- File
Store - File-based storage backend.
- KeyEntry
- Key material for a commit (SPEC §6).
- Query
Opts - Query options for filtered retrieval.
Enums§
- Entry
Error - Errors that can occur when working with entries.
- Export
Error - Errors that can occur during export.
- File
Store Error - Errors from the file-based storage backend.
- Genesis
- How the principal was created (genesis mode).
- Load
Error - Errors that can occur during import.
- Persist
Error - Errors from persist_entries (combines export and store errors).
Traits§
- Store
- Storage backend trait.
Functions§
- export_
commits - Export commits from a Principal for commit-based storage.
- export_
entries - Export all entries from a Principal for storage (legacy flat format).
- load_
from_ checkpoint - Load a principal from a trusted checkpoint.
- load_
principal - Load a principal by replaying entries from genesis.
- load_
principal_ from_ commits - Load a principal by replaying commit bundles from genesis.
- persist_
entries - Export entries and persist them to storage.