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
- Prepare (Lock):
- Sender generates a secret
Sand hashH = sha256(S). - Sender locks funds on Ledger A conditioned on
H. - Gateway communicates
Hto Receiver.
- Sender generates a secret
- Fulfill (Claim):
- Receiver sees the lock on Ledger A (via proof).
- Receiver reveals
Sto claim the funds on Ledger B (or creates a mirrored lock). - Once
Sis 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
Pingand service skeleton. - The HTLC logic is currently being moved from
design/to actual Rust code incore/gateway.