Architecture

Five guardians, one node

TSUNAGI is a from-scratch Zig implementation of the Cardano block-producer role. Its design is organized around five named subsystems. Each exists because a real failure demanded it — none of this is speculative architecture.

From slot to canonical block

TSUNAGI node ELECT VRF leader check · freshest sigma FORGE build · KES sign · opcert (pinned) SELF-VERIFY refuse if any gate fails PUBLISH two-phase atomic (.ready) PUSH contiguous walk to parked peer ≤300ms SERVE BlockFetch body → served_both unmodified cardano-node validates CANONICAL

The peer is an unmodified cardano-node. TSUNAGI speaks the standard node-to-node mini-protocols; nothing on the other side knows or cares that the block came from an independent implementation. That is the point.

KAGAMI — Observe

A node that cannot see itself cannot be trusted. KAGAMI is TSUNAGI's self-observation layer: every forged block enters an acceptance tracker that follows it through forged → pending → arrived → canonical (or unknown, honestly recorded when a block is lost). Internal belief is continuously cross-checked against external reality — a poller queries the public Koios API and compares the chain's view of the pool's blocks against the node's own.

forge acceptance tracker pending → arrived → canonical internal verdict (the node's belief) Koios cross-check (the chain's truth) must agree — or it's a signal

When the two disagree, that disagreement is itself a signal — the Zig 0.16 child-spawn regression (P5) was caught exactly this way: Koios said canonical, the internal verdict said unknown, and the gap became incident INC-013.

YAMORI — Protect

TSUNAGI refuses to broadcast any block it cannot prove valid to itself first. The forge path is a chain of gates, each born from a real incident:

A refused forge is logged with its reason — visible, attributable, recoverable. A bad broadcast would be none of those.

TATE — Recover

Failure is contained, never cascaded. The orphan watchdog distinguishes a genuinely diverged block (quarantine, probe, roll back state) from a slow confirmation (disarm, assume accepted). Artifact publication is two-phase — a .ready sentinel renamed into place only after the full artifact is written — so a reader can never observe a half-written block. Every deployed binary keeps a verified rollback chain on disk: any version can be restored by swapping one file, with the environment and state never touched.

rollback chain — each sha256-verified zig016-p5 ← live now zig016-p22 ★ p2.2 ★ p2.1 p2 p1 ★ = forged canonical blocks while live · swap one file to restore

MUSUBI — Reconnect

Producing a valid block is half the job; the network must fetch it before a competing block wins the slot race. MUSUBI is the propagation layer, hardened through four incidents (P1 → P2.2):

before P2.2 — push the tip, skipping blocks push N+3 (parent unseen) → peer disconnects no parked peer at forge ORPHAN after P2.2 — contiguous walk, one block at a time walk N+1,N+2… forged block pushed ≤300ms BlockFetch CANONICAL

The measurable result: connection churn went from ~140 disconnect cycles to zero, and a single parked connection has served multiple canonical blocks across many hours of uptime.

KINTSUGI — Learn

Kintsugi is the Japanese art of repairing broken pottery with gold — the repair is displayed, not hidden. TSUNAGI's failure-memory system works the same way: every incident that ever cost a block is recorded with its root cause, fix, regression test, and live closure evidence. The record is machine-readable; a recurring log signature can be matched against past incidents before anyone debugs from scratch.

The full story — every crack and every gold seam — is on the Kintsugi page.

Facts

Language

Zig 0.16

Single static binary. The whole 0.15-era codebase runs on 0.16 through one compatibility shim.

Tests

1508 / 1508

Including replay tests that reconstruct real on-chain failures, and tests that really fork child processes.

Protocols

ChainSync · BlockFetch

Standard node-to-node mini-protocols against an unmodified cardano-node.

Crypto

VRF · KES · ed25519

Praos leadership, evolving-key signatures, pinned operational certificate.