Skip to content

Architecture Overview

Qazna follows a 3-Layer Architecture, designed to bridge sovereign banking systems with the global AI economy.

1. The Core ("Financial Linux")

  • Implementation: core/ledger (Rust)
  • Role: A high-performance, in-memory double-entry accounting engine.
  • Key Capabilities:
    • Native ISO 20022: Direct ingestion and processing of banking standards (e.g., pacs.008).
    • Programmable Compliance: "Compliance as Code" engine injecting regulatory rules (Limits, AML) into the kernel.
    • Financial Identity: Native Alias Registry mapping human-readable names to Account IDs.
    • Offline Resilience: Ed25519-based cryptographic signature verification for trustless transaction submission.

2. The Network ("Financial TCP/IP")

  • Implementation: core/gateway (Rust)
  • Role: Routing and settlement layer connecting independent sovereign ledgers.
  • Key Capabilities:
    • Liquidity Routing: "Financial BGP" pathfinding to discover optimal currency conversion paths across the network.
    • Atomic Swaps: Trustless cross-ledger value transfer (HTLCs).

3. The Interface ("AI Agent Layer")

  • Implementation: clients/python, core/api (Go/gRPC)
  • Role: SDKs and APIs for human and machine interaction.
  • Interfaces:
    • gRPC: Low-latency, strongly typed internal communication.
    • Python SDK: (pip install qazna) for AI agents.
    • REST/HTTP: External API gateway (Legacy support).

Data Flow (Rust Core)

  1. Ingestion: Transactions arrive via gRPC (from API or Gateway) or File (ISO 20022 XML).
  2. Validation:
    • Crypto: Verifies Ed25519 signatures if public_key is registered.
    • Identity: Resolves Aliases to Account IDs.
    • Compliance: ComplianceEngine checks transaction against active Rules (e.g., MaxAmount).
  3. Execution: Atomic update of State (in-memory HashMaps).
  4. Persistence: Append-only log for durability and auditability.
  5. Event Emission: Publishes events (e.g., Transaction, LiquidityAdPosted) to detailed audit logs.

Released under the Apache 2.0 License.