A decentralized freelancer marketplace built on Stellar (Soroban) that provides secure, trustless escrow services for freelance work agreements.
Live Demo ยท Documentation ยท Contributing ยท Open Issues
SecureFlow was built for and won the Stellar Scaffold Hackathon โ a global competition challenging builders to ship production-grade dApps using the Stellar Scaffold CLI toolchain on Soroban.
The project stood out for its complete end-to-end implementation: a Soroban smart contract handling real on-chain escrow logic, a React frontend auto-wired to contract clients via stellar-scaffold, and a gasless relay backend that makes blockchain interactions seamless for users.
"SecureFlow demonstrates exactly what Scaffold is meant to enable โ a full-stack Stellar dApp with contract, client, and UI wired together from day one." โ Hackathon Judges
SecureFlow solves the freelance trust problem. When you hire someone online today, you either pay upfront (and risk getting nothing) or pay after (and the freelancer risks getting stiffed). SecureFlow puts funds into a Soroban smart contract that neither party controls โ it releases payment automatically when milestones are approved, or triggers dispute resolution when they're not.
Key properties:
- Trustless โ no intermediary holds funds, the contract does
- Transparent โ all state is on-chain and auditable
- Fair โ multi-arbiter dispute resolution with on-chain reputation
- Fast & cheap โ Stellar settles in ~5 seconds for fractions of a cent
| Feature | Description |
|---|---|
| Smart Contract Escrow | Funds locked in Soroban until milestone approval |
| Milestone Payments | Break projects into chunks; each unlocks individually |
| Open Job Marketplace | Freelancers browse and apply; clients pick the best fit |
| Direct Contracts | Skip the marketplace and contract a known freelancer |
| Dispute Resolution | Multi-arbiter voting with admin oversight |
| Reputation System | On-chain star ratings and badge tiers (Beginner โ Expert) |
| Multi-Token Support | Native XLM or any whitelisted Stellar asset |
| Gasless Relay | Backend relay lets users transact without holding XLM |
| Rating Notifications | Real-time notification center for ratings and milestone events |
- All write operations require Stellar account authorization
- Token whitelist โ only approved assets accepted
- Arbiter authorization gating
- Configurable platform fees sent to designated collector
- Emergency deadline-based refunds built into contract
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SecureFlow โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Frontend โ Backend โ Soroban Contract โ
โ React 19 โ Express (Node) โ Rust / Soroban SDK โ
โ Vite โ Supabase โ โ
โ Zustand โ Groq AI โ Admin Module โ
โ Radix UI โ Gasless Relay โ Escrow Core โ
โ shadcn/ui โ โ Marketplace โ
โ โ โ Work Lifecycle โ
โ โ โ Refund System โ
โ โ โ Dispute Resolution โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
Stellar Wallets Kit Stellar SDK / Horizon
โ
Stellar Network
contracts/secureflow/src/
โโโ admin.rs # Platform config, pause, fee management
โโโ escrow_core.rs # Core data model and state machine
โโโ escrow_management.rs # Escrow creation and lifecycle
โโโ marketplace.rs # Job listings and applications
โโโ work_lifecycle.rs # Milestone submit/approve/reject
โโโ refund_system.rs # Refund and emergency mechanisms
โโโ storage_types.rs # All on-chain data structures
โโโ lib.rs # Contract entrypoint
| Layer | Technology |
|---|---|
| Smart Contract | Rust, Soroban SDK |
| Frontend Framework | React 19, TypeScript, Vite |
| UI | Tailwind CSS, Radix UI, shadcn/ui |
| State | Zustand |
| Routing | React Router v7 |
| Forms | React Hook Form + Zod |
| Backend | Node.js, Express, Supabase |
| AI | Groq (cover letter analysis) |
| Wallet | @creit.tech/stellar-wallets-kit |
| Toolchain | Stellar Scaffold CLI |
| CI/CD | GitHub Actions, Vercel, Railway |
# Rust toolchain
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32v1-none
# Node.js 22+
node --version # v22 or higher
# Stellar CLI + Scaffold plugin
cargo install stellar-scaffold-cli# 1. Clone
git clone https://github.com/HyperSafeD/SecureFlow-scaffold.git
cd SecureFlow-scaffold
# 2. Install frontend dependencies
npm install
# 3. Configure environment
cp .env.example .env
# Edit .env โ see Environment Variables section below
# 4. Start Stellar local network (Docker required)
docker run --rm -p 8000:8000 stellar/quickstart:testing --local
# 5. Build contract and auto-generate TypeScript clients
stellar scaffold build --build-clients
# 6. Start frontend
npm run dev
# โ http://localhost:5173
# 7. (Optional) Start backend
cd backend && npm install && npm run devFrontend (.env)
VITE_STELLAR_NETWORK=testnet # local | testnet | mainnet
VITE_SECUREFLOW_CONTRACT_ID= # deployed contract address
VITE_OWNER_ADDRESS= # admin stellar address
VITE_API_URL=http://localhost:3001 # backend URLBackend (backend/.env)
SUPABASE_URL=
SUPABASE_SERVICE_KEY=
GROQ_API_KEY=
PORT=3001npm run build # frontend โ dist/
cd backend && npm run build # backend โ backend/dist/Client creates job โ Funds locked in escrow contract
Freelancers apply โ Client selects best applicant
Freelancer starts โ start_work() changes status to InProgress
Milestone done โ submit_milestone() notifies client
Client reviews โ approve (pay) / reject (revise) / dispute
On dispute โ Arbiters vote โ Admin resolves โ XLM released
All done โ Contract marked Completed, reputation updated
Pending โโstart_workโโโถ InProgress โโall approvedโโโถ Released
โ โ
refund() dispute raised
โ โ
โผ โผ
Refunded Disputed โโadmin resolvesโโโถ Resolved
NotStarted โ Submitted โ Approved (payment released)
Submitted โ Rejected โ (freelancer resubmits)
Submitted โ Disputed โ Resolved
Core Functions (click to expand)
// Create a new escrow job
pub fn create_escrow(
depositor: Address,
beneficiary: Option<Address>, // None = open marketplace job
arbiters: Vec<Address>,
required_confirmations: u32,
milestones: Vec<(i128, String)>,
token: Option<Address>, // None = native XLM
total_amount: i128,
duration: u32,
project_title: String,
project_description: String,
) -> Result<u32, Error>
// Marketplace
pub fn apply_to_job(escrow_id: u32, cover_letter: String, proposed_timeline: u32, freelancer: Address) -> Result<(), Error>
pub fn accept_freelancer(escrow_id: u32, freelancer: Address, depositor: Address) -> Result<(), Error>
// Work lifecycle
pub fn start_work(escrow_id: u32, beneficiary: Address) -> Result<(), Error>
pub fn submit_milestone(escrow_id: u32, milestone_index: u32, description: String, beneficiary: Address) -> Result<(), Error>
pub fn approve_milestone(escrow_id: u32, milestone_index: u32, depositor: Address) -> Result<(), Error>
pub fn reject_milestone(escrow_id: u32, milestone_index: u32, reason: String, depositor: Address) -> Result<(), Error>
// Refunds
pub fn refund_escrow(escrow_id: u32, depositor: Address) -> Result<(), Error>
pub fn emergency_refund_after_deadline(escrow_id: u32, depositor: Address) -> Result<(), Error>
// Reputation
pub fn rate_freelancer(escrow_id: u32, rating: u32, review: String, depositor: Address) -> Result<(), Error>SecureFlow-scaffold/
โโโ contracts/
โ โโโ secureflow/ # Soroban smart contract (Rust)
โ โโโ src/
โโโ src/ # React frontend
โ โโโ components/
โ โ โโโ admin/
โ โ โโโ approvals/
โ โ โโโ chat/
โ โ โโโ create/
โ โ โโโ dashboard/
โ โ โโโ jobs/
โ โ โโโ ui/ # shadcn/ui components
โ โโโ contexts/ # Web3 + wallet context
โ โโโ contracts/ # Auto-generated Soroban clients
โ โโโ hooks/
โ โโโ lib/ # API client, utils
โ โโโ pages/
โ โโโ providers/
โโโ backend/ # Express API + Supabase
โ โโโ src/
โ โโโ routes/
โ โโโ lib/ # Supabase, Groq clients
โ โโโ middleware/
โโโ packages/ # npm workspace packages
โโโ supabase/ # DB migrations
โโโ environments.toml # Stellar network configs
โโโ Cargo.toml
โโโ package.json
SecureFlow is an open-source project growing beyond the hackathon. We welcome contributors at every level โ Rust contract devs, React engineers, and everything in between.
- Check the open issues โ they're labelled and scoped to be tackled solo
- Fork the repo and create a branch:
git checkout -b feat/your-feature - Make your changes (run
npm run lintandnpm testbefore pushing) - Open a PR against
main
| Label | Meaning |
|---|---|
good first issue |
Small, well-scoped โ great entry point |
contract |
Soroban / Rust smart contract work |
frontend |
React / TypeScript UI work |
backend |
Node.js / Express / Supabase work |
security |
Security-critical changes |
enhancement |
New features |
bug |
Something broken |
performance |
Speed / cost improvements |
testing |
Test coverage |
documentation |
Docs and guides |
Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md before submitting.
| Service | Purpose | Status |
|---|---|---|
| Vercel | Frontend hosting | |
| Railway | Backend API | Active |
| Stellar Testnet | Smart contract | Active |
MIT โ see LICENSE.
๐ Stellar Scaffold Hackathon Winner
Built with Rust, React, and the Stellar ecosystem.
Open source under HyperSafeD โ contributions welcome.
Stellar ยท Soroban Docs ยท Scaffold CLI ยท HyperSafeD