What is the Gateway?
The ChaosChain Gateway is an off-chain orchestration service that executes workflows between the SDK and on-chain contracts. It handles evidence storage, transaction serialization, and protocol isolation bridging.Key Principle: The Gateway is economically powerless. All authoritative decisions occur on-chain.
Why a Gateway?
| Without Gateway | With Gateway |
|---|---|
| SDK manages nonces directly | TX serialization per signer |
| Manual evidence archival | Automatic Arweave uploads |
| No crash recovery | Resumable workflows |
| Direct contract calls | Protocol isolation bridging |
| SDK computes DKG | Server-side DKG (pure function) |
Core Responsibilities
Workflow Execution
Execute multi-step workflows as state machines with idempotency and crash recovery
TX Serialization
One nonce stream per signer prevents races and stuck transactions
Evidence Storage
Automatic upload to Arweave with confirmation tracking
Protocol Bridging
Orchestrates handoff between StudioProxy and RewardsDistributor
Gateway Design Invariants
These rules are non-negotiable and define the hard boundaries of the Gateway:| # | Invariant | Meaning |
|---|---|---|
| 1 | Contracts are Authority | On-chain state is always truth; Gateway reconciles |
| 2 | DKG is Pure | Same evidence → same DAG → same weights (no randomness) |
| 3 | TX Serialization | One signer = one nonce stream (no parallel submission) |
| 4 | Crash Resilient | Workflows resume from last committed state |
| 5 | Protocol Isolation | Gateway bridges StudioProxy ↔ RewardsDistributor |
| 6 | Orchestration Only | No protocol logic, no economic decisions |
| 7 | Idempotent Actions | Running an action twice has the same result |
Workflow Types
| Workflow | Purpose | Steps |
|---|---|---|
| WorkSubmission | Submit work to Studio | Upload → Submit → Register |
| ScoreSubmission | Submit verifier scores | Score → Confirm → Register Validator |
| CloseEpoch | Close epoch, distribute rewards | Check → Submit → Confirm |