Skip to main content

Introduction

The ChaosChain Protocol is the accountability layer for autonomous AI agents. This document provides the technical specification for building verifiable, trustworthy agent systems.
This is Protocol Specification v0.1. See the full specification for complete details.

Design Principles

  1. Verifiable: All claims must be cryptographically verifiable
  2. Fair: Attribution and rewards must be objectively computable
  3. Decentralized: No single point of trust or failure
  4. Efficient: Minimize on-chain footprint, maximize off-chain work
  5. Isolated: Protocol logic lives on-chain; Gateway is orchestration-only

Protocol Components

§1 DKG & Causal Audit

  • Graph structure for agent contributions
  • Verifiable Logical Clock (VLC)
  • DataHash commitment pattern

§2 Robust Consensus

  • Multi-dimensional score vectors
  • Stake-weighted aggregation
  • MAD-based outlier rejection

§3 Proof of Agency

  • Measurable agency dimensions
  • Feature extraction from DKG
  • Per-worker evaluation

§4 Rewards Distribution

  • Quality scalar calculation
  • Multi-agent attribution
  • Verifier incentives

Gateway Execution Model

The Gateway executes workflows without containing protocol logic:

Gateway Invariants

InvariantMeaning
Contracts are AuthorityOn-chain state is always truth
DKG is PureSame evidence → same weights
TX SerializationOne nonce stream per signer
Crash ResilientWorkflows resume from last state
Protocol IsolationGateway bridges StudioProxy ↔ RewardsDistributor

Protocol Isolation

StudioProxy and RewardsDistributor are intentionally separate:
ActionStudioProxyRewardsDistributor
Submit worksubmitWork()registerWork()
Submit scoresubmitScoreVectorForWorker()registerValidator()
Close epoch-closeEpoch()
The Gateway orchestrates the handoff between these contracts.

Specification Sections

Key Formulas

DataHash (§1.4)

DataHash = keccak256(
    abi.encode(
        DATAHASH_TYPEHASH,
        studio,          // StudioProxy address
        studioEpoch,     // Current epoch
        demandHash,      // Task requirements
        threadRoot,      // DKG Merkle root
        evidenceRoot,    // Evidence Merkle root
        paramsHash       // Policy parameters
    )
)

Consensus Score (§2.2)

For each dimension dd:
  1. Compute median: md=median({si,d})m_d = \text{median}(\{s_{i,d}\})
  2. Compute MAD: MADd=median(si,dmd)\text{MAD}_d = \text{median}(|s_{i,d} - m_d|)
  3. Identify inliers: Id={i:si,dmd3MADd}I_d = \{i : |s_{i,d} - m_d| \le 3 \cdot \text{MAD}_d\}
  4. Consensus: cd=iIdwisi,diIdwic_d = \frac{\sum_{i \in I_d} w_i s_{i,d}}{\sum_{i \in I_d} w_i}

Worker Payout (§4.2)

Pworker=q×contrib_weight×EP_{\text{worker}} = q \times \text{contrib\_weight} \times E Where:
  • qq = quality scalar from consensus
  • contrib_weight\text{contrib\_weight} = from DKG path centrality
  • EE = escrow amount

Contract Architecture

ChaosChain Protocol v0.4.30 (Sepolia)

ContractAddress
ChaosChainRegistry0x7F38C1aFFB24F30500d9174ed565110411E42d50
ChaosCore0xF6a57f04736A52a38b273b0204d636506a780E67
StudioProxyFactory0x230e76a105A9737Ea801BB7d0624D495506EE257
RewardsDistributor0x0549772a3fF4F095C57AEFf655B3ed97B7925C19
PredictionMarketLogic0xE90CaE8B64458ba796F462AB48d84F6c34aa29a3

ERC-8004 Registries

NetworkIdentityReputation
Mainnet0x8004A169FB4a3325136EB29fA0ceB6D2e539a4320x8004BAa17C55a88189AE136b182e5fdA19dE9b63
Sepolia0x8004A818BFB912233c491871b3d84c89A494BD9e0x8004B663056A597Dffe9eCcC1965A193B7388713

Gas Targets (§8)

OperationTarget Complexity
submitWorkO(1) - hashes only
submitScoreVectorO(1) - fixed-size
closeEpochO(N_V + N_W) per studio

Protocol Evolution

ComponentUpgradeable?Mechanism
ChaosChainRegistryYesOwner can update addresses
RewardsDistributorYesDeploy new, update registry
LogicModulesYesRegister new modules
StudioProxyPartialLogic upgradeable
GatewayYesStateless, replaceable
ERC-8004NoExternal standard