Skip to content

Architecture: ISO 20022 Adapter

Status: MVP Implemented Component: core/iso20022

The Problem

Banks speak XML (pacs.008, camt.053). Blockchains and modern ledgers speak binary (Protobuf, SSZ, RLP). Bridging this gap usually involves "Enterprise Service Buses" (ESB) which are slow, expensive, and fragile.

The Qazna Solution ("Trojan Horse")

We embed the ISO 20022 understanding inside the kernel, but keep the execution binary.

Data Flow

mermaid
graph LR
    Bank[Bank System] -->|XML pacs.008| Adapter[core/iso20022]
    Adapter -->|Parse & Validate| Structs[Rust Structs]
    Structs -->|Convert| Proto[IsoBinaryMessage]
    Proto -->|Embed| Tx[Qazna Transaction]
    Tx -->|Execute| Ledger[core/ledger]

Implementation Details

  1. Parsing: We use quick-xml for zero-copy parsing where possible.
  2. Mapping: We implemented a semantic mapping from Document/FIToFICrdtTrf to our internal IsoBinaryMessage.
  3. Storage: The original XML is discarded after extraction. Only the semantic data (Who, Whom, How Much, Remittance Info) is stored in the efficient Protobuf format within the transaction log.
  4. Export: If a regulator needs XML, we can re-hydrate the pacs.008 from the binary data (Future Work).

Key Rust Crates

  • iso20022: Standalone crate with no IO dependencies. Pure data transformation.
  • qazna-ledger: Depends on iso20022 to enrich its transaction model.

Released under the Apache 2.0 License.