Skip to content

Architecture: Federation Gateway ("Financial TCP/IP")

Status: Prototype Component: core/gateway

The Vision

Qazna instances are sovereign. A Central Bank in Country A does not control the ledger of a Neobank in Country B. The Gateway allows them to transfer value trustlessly.

The Protocol: HTLC

We use Hashed TimeLock Contracts (HTLC) over gRPC.

State Machine

  1. Prepare (Lock):
    • Sender generates a secret S and hash H = sha256(S).
    • Sender locks funds on Ledger A conditioned on H.
    • Gateway communicates H to Receiver.
  2. Fulfill (Claim):
    • Receiver sees the lock on Ledger A (via proof).
    • Receiver reveals S to claim the funds on Ledger B (or creates a mirrored lock).
    • Once S is revealed on-chain, the atomic swap completes.

gRPC Service Definition

protobuf
service FederationService {
  // Check connectivity
  rpc Ping(PingRequest) returns (PingResponse);

  // Propose a transfer (Phase 1)
  rpc ProposeTransfer(ProposeRequest) returns (ProposeResponse);
  
  // Reveal secret to finalize (Phase 2)
  rpc FulfillTransfer(FulfillRequest) returns (FulfillResponse);
}

Current Implementation

  • We have a basic Ping and service skeleton.
  • The HTLC logic is currently being moved from design/ to actual Rust code in core/gateway.

Released under the Apache 2.0 License.