Architecture
v4.1 · full stack · tri-QPUNWO-ASM's full stack, end to end. A user writes process-matrix code at the top; signed USDC settlement comes out at the bottom. Each layer below is independent and replaceable — the language and runtime are MIT-licensed; only the substrate connectors that touch live external compute carry per-call fees. The vertical flow makes the boundaries obvious.
The full vertical stack
Read top to bottom — source becomes signed settlement. Solid white lines are live data paths; dashed lines are designed/roadmap.
Nine layers, top to bottom
Source
The NWO-ASM language itself. Process matrices and causal coherence as first-class primitives. MIT-licensed, no platform lock-in. Files are .nwo; modules, types, and routing directives compose like ordinary code.
Parser & AST
A Rust parser using a tree-sitter grammar produces a typed AST. Diagnostics are user-friendly; errors come with source spans and suggested fixes.
Process-Matrix IR
The AST is lowered into .pmx, a substrate-agnostic algebraic form. Every operation in the IR is a well-defined algebraic transformation — the IR is human-readable and inspectable.
MetaState optimizer
Places each IR block on the substrate that minimises a free-energy bound across substrate cost models. Optional manual mode pins targets explicitly. Output: optimized IR plus a placement map.
Runtime & dispatcher
Async dispatcher with health-aware retries, fallback substrates, and live metric collection (what Portals visualise). Every dispatch is signed before it leaves the runtime.
Substrate connectors
One small adapter per substrate. Live · classical: CPU (LLVM), GPU (CUDA/ROCm/Metal + nwo-agi mesh). Live · QPU triad: qpu.ibm (IBM Quantum via Qiskit Runtime SamplerV2), qpu.origin (Origin Wukong 72q · Wukong-180 via QPanda3), qpu.osaka (Osaka University QIQB ¹⁷¹Yb⁺ ion-trap via OQTOPUS Cloud — single-qubit-live @ 94% fidelity today, hybrid-routed for ≥ 2q). Beta: ECG hive + BCI/EEG mapping. Roadmap: photonic (Jiuzhang-class), neuromorphic (Loihi/Lava), DNA (strand displacement), crystalline (quantum-dot lattice). Each connector is replaceable without touching the language above it. All three QPUs are reachable through the shared metastate-quantum worker on Render — regular users via /route, CHAINSTATE AGI via /chainstate/route for its self-referential compute.
Verification
MetaState independently re-fits the inference and emits a Proof of Inference, signed with CRYSTALS-Dilithium (post-quantum). A Groth16 zero-knowledge variant is available when the data must stay private.
Settlement
The signed proof becomes calldata into the deployed MetaStateSplitter at 0x93a7…1BE4 on Base. The split is 35% guardian · 35% savings · 30% operations, with an optional +15% affiliate payout when a referrer is attached. No new contract is deployed for NWO-ASM — we reuse what's already audited.
Delivered
The caller receives: the computed result, the signed proof, and the on-chain transaction hash. Every step from source to delivered is auditable; every boundary in the diagram is inspectable.
What each layer is built on
| Layer | Tech | Status |
|---|---|---|
| 01 · Source | NWO-ASM grammar · process matrices · causal coherence · MIT | Live |
| 02 · Parser | Rust · tree-sitter · ariadne diagnostics | Live |
| 03 · IR | Process-Matrix IR · .pmx · serde | Live |
| 04 · Optimizer | MetaState kernel · free-energy bound · causal-coherence scheduler | Live |
| 05 · Runtime | tokio · health probes · sparkline collectors (what Portals show) | Live |
| 06 · CPU | LLVM 17 · x86 / ARM / RISC-V | Live |
| 06 · GPU | CUDA · ROCm · Metal · nwo-agi distributed mesh | Live |
| 06 · QPU · IBM | Qiskit Runtime · SamplerV2 (US · superconducting) · backend=ibm | Live |
| 06 · QPU · Origin Wukong | QPanda3 · Origin Cloud (China · USTC · 72q Wukong · Wukong-180) · backend=origin | Live |
| 06 · QPU · Osaka QIQB | OQTOPUS Cloud · QURI Parts · quri-parts-oqtopus · ¹⁷¹Yb⁺ ion-trap (Japan) · backend=osaka · 1q live @ 94% fidelity · hybrid ≥ 2q | Live |
| 06 · ECG Hive · BCI | OpenBCI / Muse / LSL · CRYSTALS-Dilithium identity hive · neural-state encoder | Beta |
| 06 · Photonic | Linear-optical · Gaussian Boson Sampling adapters (Jiuzhang-class) | Roadmap |
| 06 · Neuromorphic | Intel Loihi · Lava SDK · spiking-net IR lowering | Roadmap |
| 06 · DNA | Strand-displacement compiler · Oxford Nanopore I/O | Roadmap |
| 06 · Crystalline | Quantum-dot lattice · custom backend (long-horizon) | Roadmap |
| 07 · Verification | CRYSTALS-Dilithium · liboqs · Groth16 zk (snarkjs/arkworks) | Live |
| 08 · Settlement | MetaStateSplitter · Base 8453 · USDC (0x8335…2913) | Live · existing audited contract |
| Side · EVM target | EVM bytecode emission for cross-chain invocation | Design-complete |
| Side · Cross-chain bridge | Quantum-secured message relay between chains and NWO-ASM | Roadmap |
Two ways in — same three QPUs
The same three quantum backends are reachable through two independent code paths with different authorisation and different pre-processing. The distinction matters because CHAINSTATE AGI's self-referential compute (theory-of-mind loop, ontological delta ledger, Iida AOM/PIM memory tick, swarm-coupling free-energy) has already passed the on-chain Deontic guardrails and does not need another anomaly-check hop.
| Path | Who uses it | Route | Gate |
|---|---|---|---|
| METASTATE-mediated | All non-CHAINSTATE users, agents, and services (default) | agent → NWO-ASM → METASTATE /v1/quantum/route → metastate-quantum /route → QPU |
METASTATE api_key + WORKER_SHARED_SECRET (server-injected) |
| CHAINSTATE-direct | Only CHAINSTATE AGI (self-referential compute) | CHAINSTATE worker → /agi/quantum/route → metastate-quantum /chainstate/route → QPU |
Both WORKER_SHARED_SECRET AND CHAINSTATE_SHARED_SECRET; also accepts Cardiac capability.qpu.route credentials |
Why it's shaped this way
One language, many substrates
Source code never names a backend. The optimizer at layer 04 picks; replacing a substrate (or adding a new one) does not change a single line of user code.
Every layer is inspectable
You can dump the AST, the IR, the optimizer's placement, the runtime's metrics, the proof, and the calldata. No hidden state, no opaque steps.
Honesty is structural
Roadmap substrates can't be silently dispatched to; the runtime refuses. The diagrams use dashed lines for the same paths the code refuses to traverse.
No new on-chain contract
Settlement reuses the audited MetaStateSplitter. No new ABI, no new audit, no new attack surface for NWO-ASM specifically.