No middlemen. No trust required. Just code.
FairDeal is a trustless escrow platform built on the Stellar blockchain. Clients lock funds in a Soroban smart contract, freelancers deliver work securely via encrypted IPFS uploads, and payments are released automatically β all without a central authority.
Freelancing platforms today take significant cuts, hold funds, and act as gatekeepers. FairDeal removes all of that.
Here's how it works in plain English:
- A client posts a job and locks the payment into a smart contract on the Stellar blockchain. The money is held by code β not a company.
- A freelancer picks up the job and uploads their completed work. Files are automatically encrypted with AES-256 before being stored on IPFS (a decentralized file network).
- The client reviews a watermarked preview of the work to verify quality without receiving the full file.
- The client approves, and the smart contract instantly releases the funds to the freelancer. The original, unencrypted file becomes available for download.
- If something's wrong, the client can request a revision or cancel for a full refund β all enforced by the contract, not a support ticket.
No platform fees. No payment delays. No disputes with a helpdesk.
- Client funds are locked in a Soroban smart contract on Stellar β not held by FairDeal
- Payments are released only when the client explicitly approves the work
- Cancellations trigger an automatic on-chain refund to the client
- All fund movements require a Freighter wallet signature β the platform can never move your money
- Submitted work is encrypted with AES-256-CBC before leaving the freelancer's machine
- Encrypted files are pinned to IPFS via Pinata β no central server holds your files
- Encryption keys are only released after client approval
- Even if someone gets the IPFS link, they cannot read the file without the key
- When a freelancer submits, a watermarked preview is generated automatically
- Clients can verify the work is real and complete before releasing payment
- The clean, watermark-free file is only accessible after funds are released
- Prevents unauthorized use of deliverables before payment
- Connect your Stellar Freighter wallet in one click β no account creation needed
- Wallet signatures are only required for fund movements (create, approve, cancel)
- Submitting work and requesting revisions require zero wallet popups
- Works on Stellar Testnet for safe experimentation
The smart contract enforces a complete, tamper-proof workflow:
Created β Submitted β Approved β
β Revision Requested π
β Rejected β
The FairDeal escrow contract is live on Stellar Testnet.
| Network | Stellar Testnet |
| Language | Rust (Soroban SDK) |
| Deploy Tx | 286021c7... |
π View on Stellar Expert
π Interact on Stellar Lab
| Function | What it does | Requires Wallet? |
|---|---|---|
create_job |
Locks client funds in escrow, creates the job | β Yes |
submit_work |
Records the IPFS CID of submitted work on-chain | β No |
approve_work |
Releases escrowed funds to the freelancer | β Yes |
cancel_deal |
Refunds the client and cancels the job | β Yes |
request_revision |
Marks job for revision without touching funds | β No |
flag_fraud |
Records a fraud flag against a freelancer | β Yes |
get_job |
Returns full job details by ID | β No |
get_job_count |
Returns total number of jobs created | β No |
| Layer | Technology |
|---|---|
| Frontend | Next.js 14 (App Router), React 18, TypeScript |
| Blockchain | Stellar Testnet, Soroban Smart Contracts (Rust) |
| Wallet | Stellar Freighter |
| File Storage | IPFS via Pinata |
| Encryption | AES-256-CBC (Node.js crypto) |
| Watermarking | Jimp |
| Stellar SDK | @stellar/stellar-sdk v14 |
FairDeal(stellar)/
βββ app/ # Next.js App Router pages & API routes
β βββ api/
β β βββ jobs/ # Create, fetch, and manage jobs
β β βββ ipfs/ # IPFS upload & CID tracking
β β βββ decrypt-file/ # Decrypt & deliver files post-approval
β β βββ escrow-address/ # Escrow account helper
β β βββ freelancers/ # Fraud flag endpoints
β βββ create-job/ # Client: post a new job
β βββ jobs/[jobId]/ # Job detail & action page
β βββ submit-work/[jobId]/ # Freelancer: upload work
β βββ login/ # Wallet connect page
β βββ profile/ # User profile page
βββ contract/
β βββ src/lib.rs # Soroban smart contract (Rust)
β βββ Cargo.toml
βββ components/
β βββ WalletProvider.tsx # Freighter wallet context
βββ utils/
β βββ contract-utils.ts # Contract interaction helpers
β βββ stellar-utils.ts # Stellar SDK utilities
βββ lib/
β βββ ipfs-utils.ts # Pinata upload/download
β βββ stellar-utils.ts # Server-side Stellar helpers
β βββ storage.ts # JSON file-based data store
βββ data/ # Local job & IPFS metadata storage
- Node.js 18+
- Rust & Cargo
- Stellar CLI
- Freighter Wallet browser extension
- A free Pinata account for IPFS
git clone https://github.com/yourusername/fairdeal.git
cd fairdeal
npm installCreate a .env.local file in the root:
# Stellar
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_CONTRACT_ID=your_ContractID
# Escrow account (Stellar keypair for the platform escrow)
ESCROW_SECRET_KEY=your_escrow_secret_key
# IPFS via Pinata
PINATA_API_KEY=your_pinata_api_key
PINATA_SECRET_API_KEY=your_pinata_secret
PINATA_JWT=your_pinata_jwtπ‘ Tip: Get free Pinata API keys at pinata.cloud. For the escrow key, generate a Stellar keypair at laboratory.stellar.org and fund it on Testnet.
npm run devOpen http://localhost:3000 in your browser.
cd contract
cargo build --target wasm32-unknown-unknown --release
stellar contract optimize --wasm target/wasm32-unknown-unknown/release/fairdeal_escrow.wasm
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/fairdeal_escrow.optimized.wasm \
--source-account default \
--network testnetThen update NEXT_PUBLIC_CONTRACT_ID in .env.local with your new contract address.
- Open the app and click Connect Wallet β approve the Freighter popup
- Click Post a Job, fill in the details and payment amount
- Confirm the transaction β your XLM is now locked in the smart contract
- Wait for a freelancer to submit work
- Review the watermarked preview
- Approve to pay and unlock the file, Request Revision if changes are needed, or Cancel for a refund
- Connect Wallet with Freighter
- Browse open jobs and pick one
- Upload your work on the Submit Work page β files are encrypted automatically
- Wait for the client to review your watermarked preview
- Once approved, payment lands in your Stellar wallet automatically
Client deposits payment
β
Smart Contract holds funds (trustless)
β
Freelancer uploads work
β AES-256-CBC encryption
IPFS stores encrypted file (Pinata)
β
Client sees watermarked preview
β
Client approves β Contract releases funds
β
Decryption key released β Client downloads clean file
- No single point of failure β Funds are on-chain, files are on IPFS
- Platform cannot steal funds β Smart contract enforces all rules
- Files are private β Encrypted before upload; key only released on approval
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_STELLAR_NETWORK |
testnet or mainnet |
β |
NEXT_PUBLIC_CONTRACT_ID |
Deployed Soroban contract address | β |
ESCROW_SECRET_KEY |
Stellar secret key for platform escrow account | β |
PINATA_API_KEY |
Pinata API key | β |
PINATA_SECRET_API_KEY |
Pinata secret API key | β |
PINATA_JWT |
Pinata JWT for uploads | β |
- USDC payment support (Stellar anchor assets)
- On-chain dispute resolution with arbitration
- Freelancer reputation & review system
- Multi-milestone payment schedules
- Mainnet deployment
Contributions are welcome!
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'Add your feature' - Push to the branch:
git push origin feature/your-feature - Open a Pull Request
- Stellar Development Foundation β Blockchain infrastructure
- Soroban β Smart contract platform for Stellar
- Pinata β IPFS pinning service
- Freighter β Stellar browser wallet