Skip to main content

anima_identity/
lib.rs

1//! # Anima Identity — Cryptographic Identity for Life Agents
2//!
3//! This crate provides the cryptographic operations for agent identity:
4//!
5//! - **Seed management**: Single 32-byte master seed → dual keypair derivation
6//! - **Ed25519**: Agent Auth Protocol compatible authentication + JWT signing
7//! - **secp256k1**: Haima-compatible wallet identity for on-chain economics
8//! - **Keystore**: Unified interface for creating and managing agent identity
9//!
10//! ## Key Derivation
11//!
12//! ```text
13//! MasterSeed (32 bytes, random)
14//!   ├── HKDF(seed, "anima/ed25519/v1")   → Ed25519 private key
15//!   └── HKDF(seed, "anima/secp256k1/v1") → secp256k1 private key
16//! ```
17//!
18//! Both keys are cryptographically independent despite sharing a seed.
19//! The seed is encrypted at rest using ChaCha20-Poly1305.
20
21pub mod did;
22pub mod ed25519;
23pub mod keystore;
24pub mod seed;
25
26pub use did::{generate_did_key, resolve_did_key, verify_did_key};
27pub use keystore::AnimaKeystore;
28pub use seed::{EncryptedSeed, MasterSeed};