A metagraph on Constellation Network for creating automated workflow contracts using JSON-encoded state machines and script oracles.
OttoChain turns JSON into executable workflows on a distributed ledger. Define state machines with guards, effects, and transitions — all in JSON Logic — and deploy them without writing application code.
graph LR
A["📋 JSON Definition"] -->|deploy| B["🔗 On-Chain Fiber"]
B -->|events| C["⚙️ Guard → Effect → Transition"]
C -->|triggers| D["📋 Other Fibers"]
C -->|oracle calls| E["🔮 Script Oracles"]
- JSON-Encoded State Machines — Define workflows as states, transitions, guards, and effects in JSON
- Script Oracles — Stateful computation units callable by state machines
- Cross-Machine Triggers — One machine's transition fires events on other machines
- Parent-Child Spawning — Dynamically create child machines at runtime
- Broadcast Triggers — Fan out events to many machines simultaneously
- Gas Metering — Bounded computation with cycle detection
- AI-Friendly — LLMs read, write, and reason about JSON Logic natively
| Example | Machines | What It Demonstrates |
|---|---|---|
| Tic-Tac-Toe | 1 + oracle | Oracle-centric architecture pattern |
| Fuel Logistics | 4 | Cross-machine triggers, GPS tracking |
| Clinical Trial | 6 | Multiple guards, bi-directional transitions |
| Real Estate | 8 | Self-transitions, lifecycle management |
| Riverdale Economy | 17 instances | Broadcast triggers, parent-child spawning, full ecosystem |
- 📖 Introduction — What OttoChain is and how it works
- 📚 Documentation Hub — All documentation
- 💡 Examples — Real-world state machine examples
- 🏗️ State Machine Design Guide — How to write state machines
- 🚀 Deployment Guide — Deploy your metagraph
- 🧪 Testing Terminal — Interactive CLI for testing
OttoChain runs three layers on each node, built on Constellation's Tessellation framework:
| Layer | Port | Purpose |
|---|---|---|
| Data L1 | 9300 | Fiber processing — events, oracle calls, validation |
| Currency L1 | 9200 | Token transfers and balances |
| Metagraph L0 | 9100 | Consensus, snapshots, state management |
See Architecture Details for the full technical breakdown.
- Scala 2.13 with cats-effect, fs2, circe
- Tessellation metagraph SDK
- JSON Logic with OttoChain extensions (_oracleCall, _trigger, _spawn, _emit)
- sbt multi-module build
Apache License 2.0