Expand description
§AmateRS Core - Fully Homomorphic Encrypted Database Engine
amaters-core is the kernel of the AmateRS distributed database, providing Encryption-in-Use capabilities via TFHE (Fully Homomorphic Encryption).
§Core Principles
- Encryption in Use: All data remains encrypted during computation
- Zero Trust: Servers never see plaintext data
- Deterministic: Reproducible results with cryptographic proofs
- High Performance: GPU-accelerated FHE operations
§Architecture
AmateRS consists of four core components inspired by Japanese mythology:
| Component | Origin | Role |
|---|---|---|
| Iwato (岩戸) | Heavenly Rock Cave | Storage Engine |
| Yata (八咫鏡) | Eight-Span Mirror | Compute Engine |
| Ukehi (宇気比) | Sacred Pledge | Consensus Layer |
| Musubi (結び) | The Knot | Network Layer |
§Modules
error- Comprehensive error types and recovery strategiestypes- Core types (CipherBlob, Key, Query)traits- Storage engine trait definitionsstorage- Iwato storage engine (LSM-Tree with WiscKey)compute- Yata FHE execution enginevalidation- Input validation helpers
§Quick Start
ⓘ
use amaters_core::{
storage::MemoryStorage,
traits::StorageEngine,
types::{CipherBlob, Key},
};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let storage = MemoryStorage::new();
let key = Key::from_str("secret_data");
let encrypted = CipherBlob::new(vec![/* encrypted bytes */]);
storage.put(&key, &encrypted).await?;
let retrieved = storage.get(&key).await?;
Ok(())
}§Feature Flags
storage- Enable storage engine (Iwato)compute- Enable FHE compute engine (Yata)parallel- Enable parallel operations with Rayonmmap- Enable memory-mapped storagegpu- Enable GPU accelerationcuda- Enable CUDA backend (requiresgpu)metal- Enable Metal backend (requiresgpu)
§Security Model
See the technical whitepaper for details on:
- Threat model and countermeasures
- Post-quantum security guarantees
- Key management best practices
§Development Status
Phase 1 (MVP): Basic storage and compute stubs ✅ Phase 2: Full LSM-Tree and FHE integration 🚧 Phase 3: Distributed consensus and GPU acceleration 📋
Re-exports§
pub use error::AmateRSError;pub use error::ErrorContext;pub use error::Result;pub use traits::StorageEngine;pub use types::CipherBlob;pub use types::ColumnRef;pub use types::Key;pub use types::Predicate;pub use types::Query;pub use types::QueryBuilder;pub use types::Update;pub use types::col;
Modules§
- compute
- Compute engine module (Yata - The Eight-Span Mirror)
- error
- Error handling module for AmateRS
- storage
- Storage engine module (Iwato - The Rock Cave)
- traits
- Core trait definitions for AmateRS
- types
- Core type definitions for AmateRS
- utils
- Utility functions and helpers for AmateRS
- validation
- Input validation helpers
Macros§
- error_
context - Convenience macro for creating error context with automatic location tracking