Trustless savings circles on Stellar. EsusuChain digitizes the traditional African Ajo/Esusu practice — groups of members pool USDC contributions each cycle and rotate payouts, enforced by a Soroban smart contract with no admin custody of funds.
# EsusuChain
Trustless savings circles on Stellar. EsusuChain digitizes the traditional African Ajo/Esusu practice — groups of members pool USDC contributions each cycle and rotate payouts, enforced by a Soroban smart contract with no admin custody of funds.
## How it works
1. A creator deploys a circle with a fixed contribution amount, cycle length, and member cap
2. Members join via invite link and stake a deposit to the smart contract
3. Each cycle, all members contribute USDC; the contract automatically pays out to the designated member
4. Payout order is either fixed (join order) or randomized at circle activation
5. Deposits are returned to members who complete all cycles without defaulting
## Stack
| Layer | Tech |
|-------|------|
| Frontend | Next.js 14, Tailwind CSS, Freighter wallet |
| Backend | Node.js, Express, PostgreSQL |
| Smart Contract | Rust, Soroban SDK 20 (Stellar) |
| Notifications | Twilio SMS |
| Testing | Jest + fast-check (API), proptest (contract) |
## Project structure
```
esusu-chain/
├── frontend/ # Next.js web app
├── backend/ # Express REST API
│ └── migrations/ # PostgreSQL schema migrations
└── esusu-contract/ # Soroban smart contract (Rust)
```
## Prerequisites
- Node.js 20+
- Rust + `soroban-cli`
- PostgreSQL
- A Freighter wallet (for testing)
## Getting started
### 1. Smart contract
```bash
cd esusu-contract
cargo build --target wasm32-unknown-unknown --release
```
To run contract tests:
```bash
cargo test
```
### 2. Backend
```bash
cd backend
cp .env.example .env # fill in your values
npm install
npm run dev
```
Run migrations:
```bash
npm run migrate # applies SQL files in backend/migrations/
```
Run tests:
```bash
npm test
```
### 3. Frontend
```bash
cd frontend
cp .env.example .env.local
npm install
npm run dev #
localhost
```
## Environment variables
See `backend/.env.example` and `frontend/.env.example` for all required variables. Key ones: …