AjoChain is a decentralized protocol digitizing the traditional African rotating savings and credit association (ROSCA) modelβcommonly known as Esusu or Ajoβusing Stellar and Soroban smart contracts.
Across Africa, informal cooperative savings groups empower communities to pool capital and access lump sums of cash. However, these systems rely entirely on a central human coordinator. This creates a single point of failure: coordinators can mismanage funds, abscond, or make human errors, breaking the foundational chain of trust.
AjoChain removes the need for a central coordinator by replacing them with a trustless Soroban smart contract.
- π Transparent: Every cycle and contribution is fully verifiable on-chain.
- β‘ Automated: The smart contract auto-distributes the pot to the designated member per round.
- π Inclusive: Built on Stellar to ensure near-zero micro-transaction fees, making it genuinely accessible to everyday users.
- π‘οΈ Secure: Collateral vault prevents rational defaults; governance timelock prevents admin abuse.
- β Merit-Based: On-chain reputation system rewards consistent participation with access to premium pools.
AjoChain is a modular protocol composed of 5 Soroban smart contracts:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js 15) β
β Dashboard β Pool Explorer β Create Pool β Profile β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ
β Stellar / Soroban β
β β
β ββββββββββββ ββββββββββββ ββββββββββββββββ β
β β Factory ββββ Pool ββββ Collateral β β
β β Registry β β Lifecycleβ β Vault β β
β ββββββββββββ ββββββ¬ββββββ ββββββββββββββββ β
β β β
β βββββββββββ΄βββββββββββ β
β β β β
β ββββββββββ΄ββββ βββββββββββββ΄βββ β
β β Reputation β β Governance β β
β β Oracle β β + Timelock β β
β ββββββββββββββ ββββββββββββββββ β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββ
β Backend (Go) β
β Event Indexer β REST API β WebSocket β PostgreSQL β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Contract | Purpose |
|---|---|
| ajo-pool | Core ROSCA lifecycle β creation, contributions, 3 payout modes, round advancement |
| ajo-factory | Pool deployer + global registry with token allowlisting |
| ajo-collateral | Collateral vault with deposit, slash, and release mechanics |
| ajo-reputation | On-chain trust scoring with tiered pool access (Bronze β Diamond) |
| ajo-governance | Proposal + Vote + 48h Timelock + Emergency Circuit Breaker |
- Fixed Rotation β Members receive payouts in join order
- Random Rotation β Deterministic pseudo-random selection using ledger entropy
- Auction β Members bid for priority; highest bidder pays a premium to the pool
| Layer | Technology |
|---|---|
| Smart Contracts | Rust / Soroban SDK v22 |
| Frontend | Next.js 15, React, TypeScript |
| Backend | Go (Indexer + REST API) |
| Database | PostgreSQL |
| Blockchain | Stellar Network |
| Wallet | Freighter |
AjoChain/
βββ Cargo.toml # Workspace root
βββ contracts/
β βββ ajo-pool/ # Core ROSCA lifecycle
β β βββ src/
β β βββ lib.rs # Contract entry-point
β β βββ cycle.rs # State machine
β β βββ payout.rs # 3-mode payout engine
β β βββ members.rs # Member management
β β βββ errors.rs # Error codes (1-99)
β β βββ events.rs # Event emissions
β β βββ storage.rs # Data types & keys
β β βββ test.rs # Unit tests
β βββ ajo-factory/ # Pool deployer + registry
β βββ ajo-collateral/ # Collateral vault
β βββ ajo-reputation/ # Trust scoring oracle
β βββ ajo-governance/ # Governance + timelock
βββ docs/
β βββ architecture.md
β βββ events.md
β βββ security.md
β βββ deployment.md
βββ scripts/
β βββ build.sh
β βββ test.sh
β βββ deploy.sh
β βββ generate-bindings.sh
βββ frontend/ # Next.js 15 app (coming soon)
βββ backend/ # Go indexer + API (coming soon)
- Rust (latest stable)
- Stellar CLI v22+
# Add WASM target
rustup target add wasm32-unknown-unknown
# Install Stellar CLI
cargo install --locked stellar-cli# Build all contracts
stellar contract build
# Run all tests
cargo testcargo test -p ajo-pool -- --nocaptureSee docs/deployment.md for the full deployment guide.
- Cargo workspace with 5 modular contracts
- Core ROSCA pool lifecycle (create β join β contribute β payout)
- Three payout modes (Fixed, Random, Auction)
- Collateral vault with slash/release mechanics
- Reputation oracle with tiered scoring
- Governance with timelock and emergency controls
- Unit tests for core pool lifecycle
- Next.js 15 app with premium dark-mode UI
- Freighter wallet connect/disconnect
- Dashboard with portfolio overview
- Pool explorer with filters and live data
- Multi-step pool creation wizard
- Reputation profile visualization
- Go-based event indexer subscribing to contract events
- REST API with pagination
- WebSocket for real-time updates
- PostgreSQL for historical data
- Full end-to-end deployment on Stellar testnet
- TypeScript binding generation
- Integration testing with Freighter
- Professional security audit
- Mainnet deployment
- Stellar Community Fund (SCF) submission
- B2B white-labeling features
AjoChain is built with security-first principles:
#![no_std]on all contracts- Checked arithmetic β all math uses
checked_*operations - Bounded iterations β no unbounded loops
- Auth-gated mutations β
require_auth()on all state changes - Storage segregation β Instance / Persistent / Temporary
- Collateral protection β 150% collateralization prevents rational defaults
- Governance timelock β 48-hour delay on protocol changes
- Security Council veto β Multi-party oversight
- Emergency circuit breaker β Instant pause capability
See docs/security.md for the full threat model.
AjoChain is open-source, and community contributions are highly encouraged!
- Fork the repository.
- Clone your fork locally.
- Create a feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Please review our Issues tab and look for the good first issue tags if you want to jump in. Ensure all tests pass (cargo test) before submitting PRs.
Distributed under the MIT License.