Loading vLEI.wiki
Fetching knowledge base...
Fetching knowledge base...
This comprehensive explanation has been generated from 32 GitHub source documents. All source documents are searchable here.
Last updated: October 7, 2025
This content is meant to be consumed by AI agents via MCP. Click here to get the MCP configuration.
Note: In rare cases it may contain LLM hallucinations.
For authoritative documentation, please consult the official GLEIF vLEI trainings and the ToIP Glossary.
cesride is a Rust implementation of CESR (Composable Event Streaming Representation) cryptographic primitives, providing six core primitive types (Diger, Verfer, Signer, Siger, Cigar, Salter) with methods for generating and parsing qualified base64 and binary representations of cryptographic material used in KERI protocol operations.
cesride is a Rust implementation of cryptographic primitives designed for use with CESR (Composable Event Streaming Representation), a core encoding specification in the KERI ecosystem. The library serves as a foundational component for building KERI-based applications in Rust, providing the cryptographic building blocks necessary for identifier management, event signing, and verification operations.
The implementation is ported from KERIpy (the Python reference implementation) and maintains compatibility with its terminology and design decisions. cesride is currently under active development and is licensed under Apache 2.0, making it suitable for both open-source and commercial applications.
The primary purpose of cesride is to provide a robust, performant set of cryptographic building blocks that support CESR's unique qualification system—where cryptographic material is prefixed with codes that indicate the algorithm and type, enabling self-describing data structures that can be parsed without external schema information. This self-framing property is fundamental to KERI's composability and enables efficient stream processing.
cesride implements six fundamental primitive types, each representing a specific cryptographic concept:
Diger - Represents a cryptographic (hash). A can verify that input data hashes to its stored raw value, supporting operations like:
cesride uses Apache 2.0 licensing, which differs from other Rust KERI implementations (cesrox/keriox use EUPL v1.2). Developers should:
As of source documents, cesride is "under active development" with approximately 90% CESR 1.0 compliance. Some sources indicate it may be "currently inactive." Developers should:
While cesride is ported from KERIpy and maintains terminology compatibility:
Rust's performance characteristics make cesride suitable for:
However, developers should profile actual performance for their specific workloads.
The parsing architecture requires:
Implementations must handle version transitions correctly to maintain stream integrity.
When using cesride via WASM bindings:
Diger.qb64() - qualified base-64 string representation.qb64b() - qualified base-64 representation as bytes.qb2() - qualified base-2 binary representation.code() - derivation code indicating hash algorithm.raw() - raw hash bytes without qualificationVerfer - Represents a public key used for signature verification. It provides methods to verify signatures on data and can be derived from a Signer. The Verfer primitive is essential for validating key event signatures in KEL processing.
Signer - Represents a private key with signing capabilities. Can generate both indexed signatures (Siger) for multi-key scenarios and unindexed signatures (Cigar) for single-key use cases. This primitive is critical for controller operations when creating signed events.
Siger - An indexed signature attachment used when signing with multi-key autonomic identifiers. The index indicates which of multiple public keys was used to generate the signature, critical for KERI's multi-sig support and threshold signature schemes.
Cigar - An unindexed signature for single-key signing scenarios where no index is needed. Used in contexts where the signing key is unambiguous.
Salter - Represents a cryptographic seed that can deterministically generate Signer instances through key stretching, enabling hierarchical key derivation.
All primitives support CESR's qualification scheme, where cryptographic material is prefixed with a derivation code that describes its type and algorithm. For example:
DKxy2sgzfplyr-tgwIxS19f2OchFHtLwPWD3v4oYimBx - prefix D indicates a transferable Ed25519 public keyELEjyRTtmfyp4VpTBTkv_b6KONMS1V8-EW-aGJ5P_QMo - prefix E indicates a Blake3-256 digestThis qualification enables self-framing streams where parsers can identify and extract primitives without pre-negotiated schemas, a key feature for KERI's composability.
The library supports nine hash algorithms across three families:
Blake3: 256-bit and 512-bit variants (recommended for most applications due to performance and security)
Blake2: Blake2b-256 and Blake2b-512, Blake2s-256 variants
SHA: SHA3-256, SHA3-512, SHA2-256, SHA2-512 for compatibility with existing systems
For digital signatures, cesride supports:
Ed25519: Edwards-curve Digital Signature Algorithm, the primary signing algorithm in KERI
ECDSA secp256k1: For Bitcoin/Ethereum compatibility scenarios
The library provides both transferable and non-transferable key derivation codes, enabling support for both persistent identifiers (where keys can be rotated) and ephemeral identifiers (where keys cannot be rotated).
Each primitive type implements a consistent set of methods:
.qb64() - Returns qualified base-64 representation as a string.qb64b() - Returns qualified base-64 representation as bytes.qb2() - Returns qualified base-2 binary representation.code() - Returns the derivation code indicating cryptographic algorithm.raw() - Returns raw cryptographic material without qualificationThis consistent interface enables generic handling of cryptographic primitives across the KERI protocol stack.
cesride works in conjunction with Parside, the stream parsing component. The division of responsibilities is:
This modular design leverages CESR's self-framing property, allowing parsers to dispatch different parts of the stream to appropriate parsing entities based on the strip parameter.
The sniffer component detects stream format types:
For non-CESR formats, the parser uses regex to find the version string inside the data structure, extracts the length, and resumes sniffing after processing that section.
cesride includes a WASM FFI layer that enables JavaScript/TypeScript applications to utilize cesride's CESR parsing capabilities and cryptographic primitives across multiple JavaScript runtime environments through WebAssembly bindings.
Three build targets are supported:
wasm-pack build - outputs modules optimized for webpack bundlingwasm-pack build --target=nodejs - generates modules for direct NodeJS consumptionwasm-pack build --target=web - creates modules for direct browser usage without bundlersDemo applications are provided for both NodeJS (demo/node/) and browser (demo/web/) environments.
For WASM builds, the official Rust WASM toolchain is required:
cargo install wasm-pack
The standard Rust build process applies:
cargo build --release
For WebAssembly targets:
# Default webpack target
wasm-pack build
# NodeJS target
wasm-pack build --target=nodejs
# Browser target
wasm-pack build --target=web
Two demonstration implementations are provided:
NodeJS Demo (located in demo/node/):
cd demo/node
yarn install
yarn start
Browser Demo (located in demo/web/):
cd demo/web
yarn install
yarn serve
# Access via http://localhost:8080
While specific API documentation is not provided in the source documents, the common methods pattern indicates typical usage:
// Creating a Diger from data
let data = b"example data";
let diger = Diger::new(data, DigestAlgorithm::Blake3_256);
// Getting qualified representations
let qb64_string = diger.qb64(); // "ELEjyRTtmfyp4VpTBTkv_b6KONMS1V8-EW-aGJ5P_QMo"
let qb64_bytes = diger.qb64b(); // Bytes representation
let qb2_binary = diger.qb2(); // Binary representation
let code = diger.code(); // "E" for Blake3-256
let raw = diger.raw(); // Raw hash bytes
// Verification
let is_valid = diger.verify(data);
// Creating a Salter (seed)
let salter = Salter::new();
// Generating a Signer from seed
let signer = salter.generate_signer();
// Creating signatures
let data = b"message to sign";
let cigar = signer.sign(data); // Unindexed signature
let siger = signer.sign_indexed(data, 0); // Indexed signature with index 0
// Getting corresponding Verfer
let verfer = signer.verfer();
// Verification
let is_valid = verfer.verify(data, &cigar);
The cesride primitives integrate with Parside for stream processing:
KERIpy - The reference implementation in Python, from which cesride is ported. KERIpy provides 100% compliance with KERI, ACDC, and CESR specifications and serves as the authoritative implementation.
keride - A Rust library for Key Event Receipt Infrastructure that includes CESR, signing, prefixing, pathing, and parsing capabilities. While cesride focuses on primitives, keride provides higher-level KERI protocol operations.
signify-ts - TypeScript edge agent library that can consume cesride's WASM bindings for client-side KERI operations with minimal cryptographic overhead.
cesride serves as a foundational layer that can be consumed by:
cesride is licensed under Apache 2.0, which differs from some other Rust KERI implementations. The licensing discussion in the KERI community (captured in December 2022 - August 2023 Slack discussions) reveals important context:
Developers should be aware that mixing EUPL and Apache 2.0 code may have legal implications depending on jurisdiction and usage patterns.
As of the source documents (September 2020), cesride is described as "currently under active development." The implementation provides approximately 90% CESR 1.0 compliance according to the KERI ecosystem overview, though some sources indicate it may be "currently inactive."
Developers should verify the current maintenance status before adopting cesride for production use.
Rust implementations like cesride offer significant performance advantages over Python implementations:
These characteristics make cesride particularly suitable for:
The source documents explicitly state that cesride is "ported from KERIpy" and "maintains compatibility with its terminology and design decisions." This means:
However, developers should test interoperability for their specific use cases, as implementation details may diverge over time.
The parsing architecture requires careful version management:
This design enables forward compatibility as CESR specifications evolve.
The parser maintains a default version count code to handle scenarios where:
This robustness is critical for production systems that may experience interruptions.
The architecture supports dynamically loaded code tables, allowing cesride to handle different versions and extensions of CESR specifications without requiring parser modification. This extensibility is important for long-term protocol evolution.
cesride is part of the broader KERI suite of technologies, which includes:
The KERI community coordinates through:
Developers working with cesride should engage with this community for support, updates, and contribution opportunities.
Developers should:
When using cesride for cryptographic operations:
Before production use: