Expand description
AmateRS - Fully Homomorphic Encrypted Distributed Database
This is the meta crate that re-exports all AmateRS components for convenient access.
§Overview
AmateRS (天照RS) is a distributed database system providing Encryption-in-Use capabilities via TFHE (Fully Homomorphic Encryption). The name comes from Amaterasu (天照), the Japanese sun goddess.
This crate provides a unified API to all AmateRS components:
core: Core types, storage engine (Iwato), and compute engine (Yata)net: Network layer (Musubi) with gRPC and mTLS supportcluster: Consensus layer (Ukehi) with Raft implementationsdk: Rust SDK for client applications
§Architecture (Japanese Mythology Theme)
| 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 |
§Quick Start
ⓘ
use amaters::prelude::*;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Connect to AmateRS server
let client = AmateRSClient::connect("http://localhost:50051").await?;
// Store encrypted data
let key = Key::from_str("user:123");
let value = CipherBlob::new(vec![/* encrypted bytes */]);
client.set("users", &key, &value).await?;
// Retrieve data
if let Some(data) = client.get("users", &key).await? {
println!("Retrieved {} bytes", data.len());
}
Ok(())
}§Features
§Storage Engine (Iwato)
ⓘ
use amaters::core::storage::MemoryStorage;
use amaters::core::traits::StorageEngine;
use amaters::prelude::*;
let storage = MemoryStorage::new();
let key = Key::from_str("data");
let value = CipherBlob::new(vec![1, 2, 3]);
storage.put(&key, &value).await?;
let retrieved = storage.get(&key).await?;§Consensus (Ukehi)
ⓘ
use amaters::cluster::{RaftNode, RaftConfig, Command};
let config = RaftConfig::new(1, vec![1, 2, 3]);
let node = RaftNode::new(config)?;
let cmd = Command::from_str("SET key value");
let index = node.propose(cmd)?;§Query Builder
ⓘ
use amaters::sdk::query;
use amaters::prelude::*;
let q = query("users")
.where_clause()
.eq(col("status"), CipherBlob::new(vec![1]))
.build();§Module Structure
| Module | Crate | Description |
|---|---|---|
core | amaters-core | Storage, compute, types, and errors |
net | amaters-net | gRPC services and mTLS |
cluster | amaters-cluster | Raft consensus |
sdk | amaters-sdk-rust | Client SDK |
§Feature Flags
full- Enable all featuresmtls- Enable mTLS support in networkingfhe- Enable full FHE support with TFHE
Re-exports§
pub use amaters_core as core;pub use amaters_net as net;pub use amaters_cluster as cluster;pub use amaters_sdk_rust as sdk;
Modules§
- prelude
- Prelude module for convenient imports.