Crate amaters

Crate amaters 

Source
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 support
  • cluster: Consensus layer (Ukehi) with Raft implementation
  • sdk: Rust SDK for client applications

§Architecture (Japanese Mythology Theme)

ComponentOriginRole
Iwato (岩戸)Heavenly Rock CaveStorage Engine
Yata (八咫鏡)Eight-Span MirrorCompute Engine
Ukehi (宇気比)Sacred PledgeConsensus Layer
Musubi (結び)The KnotNetwork 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

ModuleCrateDescription
coreamaters-coreStorage, compute, types, and errors
netamaters-netgRPC services and mTLS
clusteramaters-clusterRaft consensus
sdkamaters-sdk-rustClient SDK

§Feature Flags

  • full - Enable all features
  • mtls - Enable mTLS support in networking
  • fhe - 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.

Constants§

NAME
Library name
VERSION
Library version