Skip to main content

Crate cesr

Crate cesr 

Source
Expand description

CESR primitive encoding and cryptography for Rust.

§Architecture: the primitive substrate of a five-crate workspace

A KERI key event message is a serialized event body followed by CESR-framed attachments:

{"v":"KERI10JSON000189_","t":"icp","d":"EAgi…",…} -VAt -AAC AADB_mVj…88ch ABAN5tRO…88ch
└──────────────────── body ─────────────────────┘└─────────── attachments ────────────┘
                                                  │    │    └ two indexed Ed25519 sigs
                                                  │    └ `-A` ControllerIdxSigs, count 2
                                                  └ `-V` attachment frame, size in quadlets

Each layer owns one part of that message:

  • cesr-stream finds it — cold-start detection and version-string framing slice the body span; counters delimit the attachment groups.
  • keri-events names it — the typed domain: events, identifiers, seals, thresholds. Pure data, no serialization of its own.
  • core spells it — the CESR primitive alphabet (Matter, indexers, counters) that every layer above composes; b64 is its Base64 codec, [crypto] its digests, keypairs, and verifiers.

The body codec — the strict canonical JSON parser with in-place SAID verification, the builders that write keripy’s exact bytes back, and the end-to-end read and write spines over them — lives in the keri-codec crate, which composes cesr-stream framing with keri-events’ typed domain.

§Features

b64 provides Base64 and implies alloc; core adds CESR primitives and implies b64; crypto adds signing, verification, digests and salty derivation and implies core. std is on by default. The standalone b64, core and crypto profiles also compile without std, including for wasm32-unknown-unknown.

Modules§

b64b64
CESR Base64 codec.
corecore
CESR (Composable Event Streaming Representation) core primitives and codes.
prelude
The common imports for working with cesr.

Structs§

Datercore
ISO-8601 DateTime encoded as CESR Matter. Code is always MatterCode::DateTime (1AAG).
Mattercore
A CESR-encoded primitive with typed code C, a raw payload, and an optional soft field.
Numbercore
An unsigned integer with an automatically selected CESR number code.
Seqnercore
CESR sequence number, wrapping a Number for event ordering.
Sigercore
An indexed signature primitive.

Enums§

CesrVersioncore
CESR protocol version for code table selection.

Traits§

Ordinalcore
An unsigned whole-number ordinal renderable as minimal lowercase hex.

Type Aliases§

Cigarcore
Non-indexed signature
Digercore
Digest — holds a hash value
Labelercore
Label primitive — field name or tag
Noncercore
Nonce/UUID primitive — salt, digest, or empty
Prefixercore
AID prefix — a verification key used as an autonomic identifier
Saidercore
Self-addressing identifier (SAID) — a digest used as a content identifier
Signercore
Signing key seed — can produce signatures (actual crypto in cesr-crypto)
Textercore
Text primitive — variable-length byte string
Verfercore
Verification key — can verify signatures
Versercore
Version primitive — encodes protocol/genus version info