Skip to content

Protocol Reference — Overview

This reference explains how a Calimero cluster works and why it is built that way. It follows one call from the client that makes it to the log entry that records it, rather than touring the crates. The crates are merod (the node binary), calimero-node (everything the node does), calimero-log (the replicated log), calimero-sealed (the encrypted transport), calimero-identity (passkeys, sessions, API keys) and calimero-client (the Rust client, whose attestation check every client and peer shares). Apps run on calimero-app-host over calimero-app-engine-wasmtime; the node fetches its storage key with calimero-kms-client and makes its quotes with calimero-tee-attestation.

A Calimero app is a calimero:app WASM component whose state lives on a cluster of attested Intel TDX nodes. Each app instance has its own Raft log, replicated on several nodes (three by default). The log’s leader runs every call against the app’s current state and appends the call together with what it produced: the result, the exact storage writes (the diff) and the events. Every replica applies the diff in log order. Nobody runs the call a second time.

A second Raft log, the system group, is shared by the whole cluster. It holds who exists and who may do what: nodes, accounts and their passkeys, sessions and API keys, organizations and teams, installed packages and the directory of app instances. Every command in it names the actor it acts for, and the state machine checks that actor’s authority when the command applies, so the log alone decides every outcome.

Nothing a node holds leaves it in the clear. Clients and peers verify a node’s TDX quote before they send it anything, then speak to it only through a sealed channel bound to the key that quote attests. Everything a node writes to disk is sealed under the cluster’s key, which it keeps wrapped under a storage key it receives from mero-kms only after proving its own image; the same key release carries a counter that refuses a disk restored from an older copy.

Hold onto that: one log per app, one log for the cluster, the leader runs and everyone applies, and nothing crosses a trust boundary unsealed. Every chapter is a detail of it.

A cluster of attested nodes can afford coordination. With one leader per app and a log every replica applies in the same order:

  • Calls are linearized. Two writes to one instance never race; the second runs against the state the first left. The SDK’s collections are plain data structures with nothing to merge (only Text stays a sequence CRDT, for edits typed against a stale view).
  • Authorization is one verdict. A command is checked against the state it applies to, which is the same state on every replica.
  • Execution need not be deterministic for convergence. Followers apply the leader’s diff, so time_now and random_bytes are read once, on the leader.
  • Confidentiality comes from the hardware and the channel, not from a key per scope delivered to each member. A member’s client never holds app state; it reads through the node.

Every request, a client’s or a peer’s, enters through the same listener and crosses the same layers. Only the outer layers answer in the clear; everything below the sealed envelope sees the inner request, as if it had come directly.

one node: merod → calimero-nodeHTTP on one listener (--listen)clients, browsers, peers and mdma; TLS, if any, ends outside the TDouter layers, in the clearCORS · app frontends {label}.apps-domain · consent page · /attestation · /healthsealed envelope (calimero-sealed)Noise NK (clients) / IK (peers) · opens the inner request · seals response framesAPI router (api.rs, api/<area>.rs)credential and access judged on fresh system state · /auth /apps /orgs /ops /internalNode (node.rs, node/*)route to leaders · propose · reconcile · receipts · blobs and files · compute runssystem group (1)SystemMachine, in memoryaccounts, orgs, directory,packages, fleetapp groups (one per instance)AppMachine: Head in memory, rows on diskleader runs: calimero-app-hoston calimero-app-engine-wasmtimecalimero-log: one openraft Engine, one Group per logpropose · append · commit · apply in order · snapshots · Raft RPCs over internal/raft<data-dir>: one RocksDB store, sealed under K_ccolumns log · meta · state · blobs; snapshots/ · components/cluster-key and signing-key, wrapped under K_r--backup-dir and --recovery-dir sit beside itcalimero-kms-clientK_r from mero-kms,rollback countertee-attestationTDX quotes overtransport/receipt keyscalimero-identitypasskeys, sessions,API keys, consentspeersinternal/* over anidentified sealedchannel to eachattested peer

The layers map to the chapters: the outer layers and the envelope are Networking & sealed channels; the router’s judgement is The write path and Reads; the groups are The system group and Replication; the engine is App execution; the store is Storage schema and Encryption.

The client half (attest, handshake, seal) is in Networking & sealed channels and Attestation & receipts. The node half (authenticate, check access, route, run, append, apply) is in The write path, App execution and Replication.

  1. The model. Concepts, The system group, Replication.
  2. The call path. App execution, The write path, Reads, views & events.
  3. Trust. Networking & sealed channels, Attestation & receipts, Encryption, Keys & their lifetimes, Security & threat model.
  4. People and authority. Accounts, passkeys & sessions, Sessions & authority, Who a run acts as, Organizations, teams & access, Deployment governance, The consent page, The operator & the Ops API.
  5. Apps. Packages & frontends, App instance lifecycle, Upgrades & migrations, Event handlers & cross-app calls, Blobs, Compute actions, Presence.
  6. Reference. Storage schema, Limits, Glossary.

Apps are built with calimero-sdk into calimero:app components, which run on calimero-app-engine-wasmtime. What they do inside a run is described only as far as the node depends on it.