Synq
Skip to content
[ synq / docs ]Synq home

Architecture

How Synq's clients, services, Kernel, execution worker and Arc fit together.

Synq is a TypeScript monorepo (Node 22, pnpm workspaces) plus a Solidity contracts project. The design rule behind everything is a hard split between proposing and authorizing and signing: models and planners can propose; only deterministic code can authorize; only the execution worker holds keys that can sign.

System overview#

  iOS app / iMessage     Web hub (Next.js)       Telegram, WhatsApp
  (apps/ios-messages)    (apps/web)              (packages/channels)
          \                    |                        /
           \                   |                       /
            v                  v                      v
        +----------------------------------------------------+
        |  API service  (apps/api + apps/demo composition)   |
        |  /v1 /v2 /v3 routes, channel ingress, brain        |
        +----------------------------------------------------+
              |                    |                  |
              v                    v                  v
     +----------------+   +-----------------+  +----------------+
     | Workspaces     |   | Agents (planners)|  | Read model /   |
     | Postgres:      |   | agent-runtime,   |  | Arc indexer    |
     | members, leads,|   | brain, strategies|  | (events, chain |
     | invoices,      |   | propose only     |  |  projections)  |
     | ledger, events |   +--------+---------+  +----------------+
     +--------+-------+            |
              \                    v
               \          +------------------+
                `-------> |  Kernel          |  deterministic:
                          |  mandates, risk, |  allow / deny /
                          |  approvals,      |  owner approval
                          |  grants          |
                          +--------+---------+
                                   | signed, single-use grant
                                   v
                          +------------------+
                          | Execution worker |  the only signer;
                          | outbox, journal, |  simulate, sign once,
                          | verify receipts  |  broadcast, reconcile
                          +--------+---------+
                                   v
                          +------------------+
                          | Arc testnet      |  Safe vaults + policy,
                          | contracts        |  milestone escrow, Amane
                          +------------------+

The main moving parts#

LayerWhat it doesWhere
ClientsiOS app and iMessage extension (SwiftUI), the Next.js web hub, Telegram and WhatsApp botsapps/ios-messages, apps/web, packages/channels
APIFastify services that serve /v1, /v2 and the app contract /v3, plus chat webhooksapps/api, apps/demo
WorkspacesThe system of record in Postgres: principals, sessions, members, leads, offers, agreements, invoices, ledger, agent events, notificationspackages/workspaces, packages/ledger
AgentsModel-backed planners (sales agent, finance team, treasury strategies). They read untrusted input and produce proposalspackages/agent-runtime, packages/strategies, plugins/*
KernelDeterministic authorization with no model and no signer. Issues grantspackages/kernel
Execution workerHolds the signing keys, submits transactions exactly once, verifies resultsworkers/execution
WorkflowsTemporal workers for long-running flowsworkers/workflow
ChainArc testnet contracts and the registry that pins their codecontracts, packages/chain-registry

Principles#

  1. Agents propose, the Kernel authorizes, the worker signs. No planner package can reach a signing primitive, directly or through dependencies. A script enforces it in CI (Agent runtime boundaries).
  2. Humans approve with signatures. Chat buttons, votes and model output are not approvals. The only approval input is a recovered EIP-712 signature from the right wallet. Login never approves money.
  3. Fail closed. Unknown risk, stale data, unreachable screening or a mismatched code hash refuses the action.
  4. Exactly once. Signed bytes are recorded before they can reach the network, and grants and nonces are single use (Execution worker).
  5. Chain is the proof. A payment, funding or lease counts only after it is proven from a receipt or an indexed event, not because a server says so.
  6. Money is integer base units. Amounts are decimal strings of base units tied to a registry asset; floats never carry money.

Pages#

For concepts and guides see Concepts and Guides; for the security model see Security.

Edit this page on GitHub