The trusted oracle bridge that connects Web2 webhook events to on-chain Soroban escrow execution on Stellar.
Soroban smart contracts on Stellar are isolated; they cannot natively listen to shipping APIs, Stripe events, or database triggers.
The EpochSend Backend acts as our off-chain oracle bridge. It runs an Express server that:
- Listens for webhook trigger events from Web2 APIs (like shipping confirmations or transaction updates).
- Validates incoming request payloads.
- Builds and signs a Soroban transaction invoking
execute_intenton the smart contract. - Submits the signed transaction to the Stellar network, releasing the escrowed funds to the recipient automatically.
External API (Web2 Webhook)
│
│ POST /api/webhooks/trigger
▼
EpochSend Oracle Backend (Express + TypeScript)
│
├── API Key / Payload validation (Zod)
├── Build InvokeHostFunction transaction
├── Sign transaction with Oracle keypair
▼
Stellar Soroban Network (calls execute_intent() to pay recipient) ✅
| Feature | Description | Status |
|---|---|---|
| Express server bootstrap | Basic routing and middleware setup | ✅ Done |
| Security middlewares | CORS and Helmet configurations | ✅ Done |
| Health Check | GET /health service endpoint |
✅ Done |
| Ingestion Endpoint | POST /api/webhooks/trigger trigger stub |
✅ Done |
| Zod validation | Schema validation for triggers | 🔨 In Progress |
| Transaction builder | Constructing Soroban execution calls | 🔨 In Progress |
| Oracle signer | Signing transactions with oracle keys | 🔨 In Progress |
- Runtime: Node.js v20+
- Language: TypeScript
- Framework: Express
- Blockchain:
@stellar/stellar-sdk - Validation: Zod
- Runner: Nodemon + ts-node
EpochSend-backend/
├── docs/
│ ├── PRD.md # Product Requirements Document
│ └── ISSUES.md # Backend feature roadmap & issue tracker
│
├── backend/ # Node.js/Express application root
│ ├── src/
│ │ ├── index.ts # App entry point — Express bootstrap
│ │ ├── config/
│ │ │ └── stellar.ts # Soroban RPC client & oracle keypair init (pending)
│ │ ├── middlewares/
│ │ │ ├── auth.ts # API key auth middleware (pending)
│ │ │ └── validate.ts # Zod payload validation middleware (pending)
│ │ ├── routes/
│ │ │ └── webhookRoutes.ts # POST /api/webhooks route definitions (pending)
│ │ └── services/
│ │ └── stellarService.ts # Soroban tx builder, signer, submitter (pending)
│ ├── package.json # dependencies & scripts
│ ├── tsconfig.json # TypeScript compilation rules
│ └── package-lock.json # npm locks
│
├── README.md # This file
├── CONTRIBUTING.md # Contribution guidelines
├── CODE_OF_CONDUCT.md # Community standards
├── MAINTAINERS.md # Maintainer list
└── STYLE.md # TypeScript coding style guide
git clone https://github.com/StacksTrench/EpochSend-backend.git
cd EpochSend-backend/backend
npm installcp .env.example .envFill in the environment variables:
PORT=3000
STELLAR_NETWORK=TESTNET
ORACLE_SECRET_KEY=S... # Oracle keypair secret for signing transactionsnpm run devThe server will run on http://localhost:3000.