Why I Built mx20022: A Production Rust Toolkit for ISO 20022
The ISO 20022 migration deadline is November 2026. I needed production-grade Rust tooling. Nothing existed. So I built it.
In November 2026, US banks must originate and process native ISO 20022 (MX) messages under strict validation rules. The old SWIFT MT format sunsets. For anyone building payments infrastructure, this is not optional — it is a hard deadline with real consequences.
I needed to build on top of ISO 20022 in Rust. The ecosystem had nothing worth using. Java has solid options. Python has decent libraries. Rust had gaps and partial implementations that weren’t production-ready.
So I built mx20022.
What it does
mx20022 is a production-grade Rust crate that handles the full lifecycle of ISO 20022 financial messages:
- Strongly-typed message models generated from official XSD schemas — 13 message types across pacs, pain, camt, and head families
- Built-in validation for FedNow, SEPA, and CBPR+ payment rails
- Bidirectional SWIFT MT ↔ MX translation — MT103 ↔ pacs.008, MT202 ↔ pacs.009, MT940 ↔ camt.053
- XML round-trip via quick-xml + serde
- XSD constraint validation at construction time via
TryFrom<String>and theValidatabletrait
Every element, attribute, and enum variant is a named Rust type. If it compiles, it’s structurally valid.
Why Rust
ISO 20022 message processing sits in the critical path of financial transactions. You want:
- Memory safety without garbage collection pauses
- Compile-time guarantees that malformed messages can’t be constructed
- Performance that doesn’t become a bottleneck at scale
- A type system expressive enough to model complex financial schemas
Rust gives you all of that. The type-state patterns that feel like overhead in other domains are genuinely useful here — a pacs.008 message that fails IBAN validation simply cannot be constructed.
The runtime
mx20022 is the parsing and validation layer. The orchestration layer — receiving messages from inbound channels, executing participant pipelines, persisting state transitions, routing to destinations — lives in k2payments, the runtime built on top of it.
Between the two, you have everything you need to build a production ISO 20022 payment gateway in Rust: pluggable transports (HTTP, gRPC, Kafka, NATS, AMQP), pluggable state stores (SQLite, PostgreSQL, RocksDB), and a deterministic participant pipeline model with full audit trails.
The deadline
November 14, 2026. If your bank or fintech hasn’t sorted out ISO 20022 compliance, the clock is running. mx20022 is Apache 2.0 licensed and on crates.io. The runtime has a dual license — AGPL for open source use, commercial license available at licensing@k2payments.com for organizations that need it.
If you’re building payments infrastructure in Rust and run into questions, open an issue. I read them.
cargo add mx20022
James Ray is a serial entrepreneur and CTO building payments infrastructure and AI-native platforms. He’s based in Medellín, Colombia.