Documentation chevron_right Architecture Specs

Mesa Protocol Architecture & Technical Specifications

Mesa Protocol provides a type-safe, durable state machine runtime for complex financial transactions on Stellar and Soroban. It replaces imperative SDK boilerplate with declarative workflow definitions that survive server restarts, network congestion, and compliance delays.

lightbulb Technical Core: Why Durable Orchestration Matters

Web3 payment pipelines combine synchronous blockchain operations with asynchronous external dependencies (e.g., SEP-24 Anchor deposit callbacks, KYC manual sign-offs, and Soroban WASM contract execution). If a Node.js process crashes or experiences HTTP timeouts mid-pipeline, traditional in-memory try/catch blocks leave user funds stuck in inconsistent states.

close Raw Stellar SDK (Imperative)
  • State lost on process crash or restart
  • Sequence number collisions on retry
  • No built-in compensation / refund mechanism
  • Requires 150+ lines of custom glue code per endpoint
check Mesa Protocol Runtime (Durable)
  • Every step transition checkpointed to database
  • Resumes seamlessly at exact step after server reboot
  • Automated Saga pattern compensating refunds
  • Declarative JSON AST generated from TypeScript SDK

layers 3-Tier System Architecture Blueprint

Tier 1: Developer SDK & Studio Canvas (@mesaprotocol/sdk & @mesaprotocol/codegen)

Fluent method-chaining builder that validates steps against canonical Zod schemas and generates immutable JSON Flow Definitions.

โ†“ JSON AST Flow Definition (id, version, steps) โ†“
Tier 2: Durable Runtime Engine & Store (@mesaprotocol/runtime)

Postgres / InMemoryPool state store, 2-second polling scheduler, webhook HMAC verification, and Saga rollback compensator.

โ†“ Signed Transactions & RPC Payloads โ†“
Tier 3: Stellar Blockchain Infrastructure

Stellar Horizon RPC (on-chain XLM / token payments), Soroban RPC (WASM smart contracts), SEP-10 Auth, and SEP-24 Anchors.

check_circle Copied to Clipboard!