Protocol

Architecture

Monorepo

stellarnotherc/
|-- apps/
|   |-- web/                  Next.js 14 - UI, agent, Stellar payments, SP1
|   |-- portfolio-worker/     Cloudflare Worker - analytics, MCP server
|-- packages/
|   |-- shared/               Tool catalog (IDs, prices, domains)
|   |-- sp1-verifier/
|       |-- program/          FX selection guest
|       |-- purchase-program/ Purchase receipt guest
|       |-- types/            Shared Rust types
|       |-- script/           Host-side prover CLIs
|-- package.json              npm workspaces

Request Flow

1. User - wallet auth - create session - fund XLM on Stellar

2. User - chat message - intent parser - execution plan

3. Agent - select tools - debit MPP session - SP1 receipt proof

4. Agent - call tool endpoint - stream results to user

5. Session end - withdraw remainder - reconcile durable execution state

6. Settlement - user-signed transfer - durable result surfaced in the UI

Decision Engine

The decision engine parses user intent, detects task kind (remittance, portfolio, or hybrid), and builds an execution plan. It considers:

  • Remaining session budget and tool prices
  • Corridor-provider affinity for FX queries
  • High-value transfer proof gating (≥100 XLM)
  • Session type and user context history

Layers

LayerResponsibility
FrontendChat UI, wallet auth (Freighter), session lifecycle, transaction signing
AgentIntent parsing, tool selection, budget management, LLM orchestration
PaymentMPP session debits, direct user-signed settlement, surge-aware fees
AnalyticsPortfolio analytics on Cloudflare Workers: risk, stress, VaR, Monte Carlo, and related modules
ProofsSP1 FX selection and marketplace purchase receipt proofs, plus proof storage and reconciliation