libkeri 0.1.0

A Rust library for KERI (Key Event Receipt Infrastructure)
Documentation
After analyzing the Python coring.py file, I can see that Matter is the base class for a hierarchy of cryptographic material classes. Let me outline the key aspects of this hierarchy and recommend a Rust
design approach.


                                                                                    Python Matter Class Hierarchy Overview

1 Matter: Base class for cryptographic material with properties like:
• code: Derivation code indicating cipher suite
• raw: Raw cryptographic material
• qb64/qb64b: Base64 representations
• qb2: Binary representation
• Methods for serialization/deserialization
2 Key Subclasses:
• Verfer: For verification keys with signature verification
• Cigar: For signatures with verification capability
• Diger: For digests with verification capability
• Prefixer: For identifier prefixes
• Saider: For self-addressing identifiers
• Seqner: For sequence numbers
• Number: For ordinal numbers
• Dater: For RFC-3339 datetimes
• Tagger: For compact special fixed size primitives
• Texter: For variable length text strings
• Bexter: For variable length Base64 text strings
• Pather: For SAD path language
• Labeler: For field map labels
• Ilker: For message types
• Traitor: For configuration traits
• Verser: For version primitives


                                                                                          Rust Design Recommendation

                                                                                                  Core Traits


                                                                                             Design Considerations

1 Trait-based approach: Using traits allows for polymorphism while maintaining Rust's performance characteristics.
2 Composition over inheritance: Since Rust doesn't have inheritance, we use composition (the matter field) to reuse functionality.
3 Error handling: Using thiserror for structured error handling.
4 Immutability by default: Rust structs are immutable by default, which aligns well with cryptographic material.
5 Builder pattern: For complex initialization, consider implementing builder patterns.
6 Serialization: Consider using serde for JSON/CBOR serialization.
7 Constant tables: Using constant tables for code lookups rather than Python's dictionaries.
8 Type safety: Leveraging Rust's type system to prevent misuse.

This design provides a solid foundation for implementing the KERI cryptographic material classes in Rust, maintaining the functionality of the Python implementation while leveraging Rust's strengths.


Tokens: 45k sent, 2.6k received. Cost: $0.17 message, $0.20 session.
Edit the files? (Y)es/(N)o [Yes]: Yes
Based on the Python code analysis, I'll implement a Rust version of the Matter class hierarchy. I'll start by creating the core traits and implementations.