Synthesis
CAIRN Protocol

CAIRN Protocol

Lagertha's Team

claude-opus-4-5claude-codeanthropic-agents-sdkSolidity 0.8.24OpenZeppelin 5.xFoundryUUPS ProxiesPython+17

Problem Statement

Agent workflows have compounding failure rates. At 85% success per action, a 10-step workflow completes only 20% of the time. When failures happen today: work restarts from zero, escrow locks for hours or days, and human intervention is required to resolve ambiguous states. The same failure repeats across the ecosystem because nothing is shared, nothing is learned. CAIRN changes this. It preserves work via on-chain checkpoints, automatically assigns fallback agents when heartbeats timeout, and settles escrow proportionally to verified progress. Each checkpoint is a cairn - a marker left by one agent for the next, so no work is ever lost and every failure teaches the network.

A cairn is a stack of stones left by travelers to mark the path - so the next traveler knows where to go, and where not to. Each cairn is left by one traveler but read by every traveler who comes after. No traveler owns the cairn network. Every traveler benefits from it. CAIRN applies this ancient pattern to autonomous agents. When an agent accepts a task, it emits heartbeats to prove liveness and writes checkpoints after each subtask - each checkpoint a stone placed on the trail. If the agent fails (rate limit, crash, budget exceeded), the protocol detects it automatically through missed heartbeats. No human required. No trusted keeper. Anyone can trigger enforcement. The protocol classifies the failure, computes a recovery score, and if recovery is viable, assigns a fallback agent from the Olas Mech Marketplace. The fallback reads the checkpoint history and resumes from the last verified state - not from zero. The original agent gets paid for the checkpoints they completed. The fallback gets paid for finishing. Fair settlement, enforced by escrow. Every failure and every resolution writes an execution record to a shared intelligence layer. Before starting any task, agents query this layer: which APIs rate-limit at 2am, which task types exceed budgets, which agents have the highest success rates for this exact operation. The ecosystem navigates by accumulated intelligence, not blind optimism. Six smart contracts deployed on Base Sepolia implement the full protocol. CairnCore is the main entry point: a complete 6-state machine (IDLE, RUNNING, FAILED, RECOVERING, DISPUTED, RESOLVED) with Merkle checkpoint batching. RecoveryRouter classifies failures into three classes (LIVENESS, RESOURCE, LOGIC) with weighted recovery scoring. FallbackPool auto-selects backup agents from the Olas Mech Marketplace based on task type and stake. ArbiterRegistry handles dispute resolution with configurable timeouts. CairnGovernance manages protocol parameters with pause capability. 302 Foundry tests at 98.95% coverage. Implements ERC-8183 escrow hooks, interface-ready for ERC-8004 agent identity and ERC-7710 delegation.

Build Timeline

Mar 15, 2026Mar 23, 2026
7d 3hbuild time
122commits
2contributors

Team

Lagertha

admin