Skip to content
Getting Started

System Architecture

x0x1 system architecture: 6 design principles, 7-layer topology from on-chain reads to user interface, 4-database model, and the 12-stage side-effect pipeline for every blockchain interaction.

The overview introduced what x0x1 does. This page covers how it's built: the constraints that govern every design decision, the layer topology, and the pipeline that processes every blockchain interaction.

Design principles

Every design decision traces back to these. They are enforced in code, not in documentation:

01
Agent as unreliable center
Deterministic shell wraps non-deterministic agent. The agent orchestrates — code enforces.
02
Hard rules in code
Business constraints enforced programmatically. The agent cannot bypass TVL floors, exploit checks, or approval limits.
03
Intent staging
Natural intent → typed proposal → executable action. Every transformation is auditable.
04
Halt over guess
Uncertainty = hard stop with reason code. No fallback heuristics.
05
Determinism ratchet
Capabilities migrate unidirectionally from agent to deterministic code. One-way evolution.
06
Defense in depth
Multiple independent validation layers. No single point of failure in the security model.

7-Layer Topology

Seven layers, strict responsibility boundaries:

L7 User Interface — state diffs, approval prompts L6 Agent Orchestration — intent parsing, recovery L5 Validation & Simulation — Anvil fork, state diff L4 Calldata Assembly — recipe lookup, parameter binding L3 Protocol Intelligence — SDK adapters, exploit DB L2 Data Layer — raw.db, tx.db, portfolio.db, journal.db L1 On-chain Layer — RPC, Etherscan, contract reads AGENT DETERMINISTIC ON-CHAIN

4-Database Architecture

All state is stored in SQLite databases, each with a single responsibility:

raw.db
Protocol docs, ABIs, raw TXs

docs, abis, raw_txs

tx.db
Contracts, selectors, recipes

contracts, selectors, recipes, recipe_params

portfolio.db
Wallets, positions, NAV

wallets, positions, nav_history

journal.db
Scenarios, execution log

scenarios, journal, outcomes

Databases are append-mostly. Recipes accumulate over time through the self-healing loop — every failed transaction teaches the system a new pattern.

12-Stage Side-Effect Pipeline

Every action that touches the blockchain goes through a 12-stage pipeline. No shortcuts, no skipping.

RESEARCH & VALIDATE ASSEMBLE HUMAN ACTION 1 Intent 2 Proposal 3 Validate 4 Risk check 5 Simulate 6 Assemble 7 Approve 8 Sign POST-EXECUTION 9 Post-verify 10 Broadcast 11 Confirm 12 Journal Stages 1–4: research · 5–6: assembly · 7–8: human · 9–12: verification

Stages 1–4 are research and validation. Stages 5–6 are deterministic assembly. Stages 7–8 require human action. Stages 9–12 are post-execution verification and record-keeping.