System Diagram
System Diagrams for Roru Labs Architecture
This document provides detailed system diagrams illustrating the architecture, data flows, and component interactions in the Roru ecosystem.
Overall System Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Roru Ecosystem │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Protocol │ │ Infra │ │ SDK │ │
│ │ Layer │ │ Layer │ │ Layer │ │
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │ │
│ └──────────────────┼──────────────────┘ │
│ │ │
│ ┌─────────▼─────────┐ │
│ │ Wallet Layer │ │
│ └─────────┬─────────┘ │
│ │ │
│ ┌─────────▼─────────┐ │
│ │ Hardware Layer │ │
│ │ (Roru One) │ │
│ └───────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘Protocol Layer Architecture
┌─────────────────────────────────────────────────────────────┐
│ Roru Protocol │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Shielded State Tree │ │
│ │ (Merkle Tree: 32 levels, 2^32 capacity) │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ ┌───────────────┼───────────────┐ │
│ │ │ │ │
│ ┌─────▼─────┐ ┌─────▼─────┐ ┌─────▼─────┐ │
│ │ Note │ │ Nullifier │ │ Balance │ │
│ │ Selection │ │ System │ │ Circuits │ │
│ └───────────┘ └───────────┘ └───────────┘ │
│ │ │ │ │
│ └───────────────┼───────────────┘ │
│ │ │
│ ┌─────────────────────▼─────────────────────┐ │
│ │ Zero-Knowledge Proof Circuits │ │
│ │ (Input, Output, Balance, Authorization) │ │
│ └─────────────────────┬─────────────────────┘ │
│ │ │
│ ┌─────────────────────▼─────────────────────┐ │
│ │ Settlement Engine │ │
│ │ (Multi-Chain Adapters, State Updates) │ │
│ └──────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘Infrastructure Architecture
┌─────────────────────────────────────────────────────────────┐
│ Roru Infra │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Attestation │ │ Relayer │ │ Sync │ │
│ │ Servers │ │ Clusters │ │ Nodes │ │
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │ │
│ └──────────────────┼──────────────────┘ │
│ │ │
│ ┌─────────▼─────────┐ │
│ │ Encrypted RPC │ │
│ │ Gateways │ │
│ └─────────┬─────────┘ │
│ │ │
│ ┌─────────▼─────────┐ │
│ │ Prover Clusters │ │
│ │ (TEE/SGX Enclaves)│ │
│ └─────────┬─────────┘ │
│ │ │
│ ┌─────────▼─────────┐ │
│ │ Gossip Layer │ │
│ │ (Offline Prop) │ │
│ └───────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘Transaction Flow Diagram
User Initiates Transaction
│
▼
┌───────────────────┐
│ Roru Wallet │
│ - Select Notes │
│ - Enter Amount │
└────────┬──────────┘
│
▼
┌───────────────────┐
│ Roru SDK │
│ - Build Tx │
│ - Generate Proof │
└────────┬──────────┘
│
▼
┌───────────────────┐
│ Roru Protocol │
│ - Create Bundle │
│ - Sign Tx │
└────────┬──────────┘
│
▼
┌───────────────────┐
│ Roru Infra │
│ - Verify Proof │
│ - Update State │
└────────┬──────────┘
│
▼
┌───────────────────┐
│ Blockchain │
│ - Settlement │
│ - Finalization │
└───────────────────┘State Synchronization Flow
Global Shielded State (Sync Nodes)
│
├─> State Root (Hash of entire tree)
├─> Merkle Proofs (for specific notes)
└─> Incremental Updates
│
▼
┌───────────────┐
│ Wallet Sync │
│ - Verify Root│
│ - Download │
│ Proofs │
└───────┬───────┘
│
▼
┌───────────────┐
│ Local Cache │
│ - Encrypted │
│ - Verified │
└───────────────┘Offline Transaction Flow
Roru One (Offline)
│
├─> Create Transaction
├─> Sign with Secure Element
├─> Generate Proof Locally
└─> Create Proof Bundle
│
▼
┌───────────────┐
│ Device-to-Device│
│ Transfer (NFC/ │
│ Bluetooth) │
└───────┬───────┘
│
▼
┌───────────────┐
│ Recipient │
│ - Validate │
│ - Store Queue │
└───────┬───────┘
│
[Network Available]
│
▼
┌───────────────┐
│ Broadcast │
│ - Network │
│ - Settlement │
└───────────────┘Multi-Chain Architecture
┌──────────────┐
│ Shielded │
│ State │
│ (Unified) │
└──────┬───────┘
│
┌──────────────────┼──────────────────┐
│ │ │
┌───────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐
│ Ethereum │ │ Solana │ │ Bitcoin │
│ Adapter │ │ Adapter │ │ Adapter │
└───────┬──────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
└──────────────────┼──────────────────┘
│
┌──────▼───────┐
│ Settlement │
│ Engine │
└──────────────┘Security Architecture
┌─────────────────────────────────────────────────────────────┐
│ Security Layers │
├─────────────────────────────────────────────────────────────┤
│ │
│ Layer 1: Hardware Security (Roru One) │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Secure Element │ Tamper Detection │ Secure Boot │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ Layer 2: Cryptographic Security │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ ZK Proofs │ Commitments │ Encryption │ Signatures │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ Layer 3: Network Security │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ TLS 1.3 │ E2E Encryption │ Certificate Pinning │ │
│ └─────────────────────────────────────────────────────┘ │
│ │ │
│ Layer 4: Infrastructure Security │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ TEE/SGX │ Attestation │ Encrypted Processing │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘Component Interaction Diagram
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Wallet │◄───────►│ SDK │◄───────►│ Protocol │
└────┬─────┘ └────┬──────┘ └────┬─────┘
│ │ │
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│Roru One │ │ Infra │ │Blockchain│
└──────────┘ └──────────┘ └──────────┘Data Flow: Proof Generation
Private Inputs
│
├─> Note Values
├─> Randomness
├─> Keys
└─> State Information
│
▼
┌───────────────┐
│ Witness │
│ Construction │
└───────┬───────┘
│
▼
┌───────────────┐
│ Circuit │
│ Execution │
└───────┬───────┘
│
▼
┌───────────────┐
│ Proof │
│ Generation │
│ (Groth16) │
└───────┬───────┘
│
▼
Zero-Knowledge Proof
(~1-2 KB)State Tree Structure
Root (State Root)
/ \
Node 1 Node 2
/ \ / \
Node 3 Node 4 Node 5 Node 6
/ \ / \ / \ / \
Leaf1 Leaf2 Leaf3 Leaf4 Leaf5 Leaf6 Leaf7 Leaf8
(Note) (Note)(Note)(Note)(Note)(Note)(Note)(Note)Conclusion
These diagrams illustrate:
System Architecture: Overall component organization
Data Flows: How data moves through the system
Security Layers: Multiple security mechanisms
Component Interactions: How components communicate
State Management: Shielded state organization
Use these diagrams as reference when developing with Roru Labs.
Last updated
