๐ Top 1 - SuiHub Discovery Mini-Hackathon | Solo-built
The Future of Secure P2P Transactions on Sui Blockchain
๐ Live Demo: Try TrustDeal
TrustDeal is a production-ready decentralized escrow platform built on Sui Blockchain that eliminates the need for intermediaries in P2P transactions. Users can securely buy and sell with automatic fund protection using Move smart contracts.
Problem: Traditional P2P transactions are risky - scams, chargebacks, trust issues.
Solution: TrustDeal uses blockchain escrow to automatically hold and release funds based on smart contract logic.
| Aspect | Details |
|---|---|
| ๐ Achievement | Top 1 at SuiHub Discovery Mini-Hackathon |
| ๐จโ๐ป Solo Development | Full-stack built entirely by one developer |
| ๐ Real Blockchain | Deployed on Sui Testnet with working smart contracts |
| ๐ Production-Ready | Live demo, responsive UI, complete user flows |
| ๐ Full-Stack Skills | Move (Smart Contracts) + Next.js 16 + TypeScript |
| ๐จ Modern UI/UX | Shadcn UI, Tailwind CSS, animations & charts |
- Smart Contract Escrow - Funds automatically locked on Sui blockchain
- On-Chain Verification - All transactions transparent and immutable
- Trust Scores - User reputation based on deal history
- No Intermediaries - Direct P2P with blockchain guarantees
- Real-Time Dashboard - Live analytics with Recharts visualizations
- Responsive Design - Mobile-first, works on all devices
- Beautiful UI - Shadcn UI + Tailwind CSS 4
- Instant Feedback - Confetti animations, toast notifications
- Type-Safe - Full TypeScript coverage
- Next.js 16 - App Router, Server Components, Server Actions
- Move Language - Secure smart contracts on Sui
- @mysten/dapp-kit - Official Sui wallet integration
- React Query - Optimized data fetching with caching
- Mobile Responsive - Seamless experience on all devices
| Technology | Purpose |
|---|---|
| Next.js 16 | React framework with App Router |
| React 19 | UI library |
| TypeScript | Type safety |
| Tailwind CSS | Styling |
| shadcn/ui | Component library |
| TanStack Query | Server state management |
| Technology | Purpose |
|---|---|
| Sui Move | Smart contracts |
| @mysten/dapp-kit | Sui integration |
| @mysten/sui | SDK |
- โ Node.js 18+ - Download
- โ npm or pnpm - Package manager
- โ Sui Wallet - Install extension
- โ Sui CLI (optional) - For deploying contracts
# 1. Clone repository
git clone https://github.com/kiettt23/trust-deal.git
cd trust-deal/web
# 2. Install dependencies
npm install
# 3. Create environment file
cp .env.example .env.local
# 4. Run development server
npm run dev
# ๐ Open http://localhost:3000# Option 1: Via CLI
sui client faucet
# Option 2: Via Discord
# Join Sui Discord โ #devnet-faucet โ !faucet <your-address>cd move
# Publish to devnet
sui client publish --gas-budget 100000000
# Copy Package ID from output:
# โ
Published PackageID: 0x...
# Add to web/.env.localThe application now fetches REAL blockchain data from Sui devnet:
- Deploy Contract: Publish the Move smart contract to get a Package ID
- Set Package ID: Add
NEXT_PUBLIC_PACKAGE_IDtoweb/.env.local - Connect Wallet: Use Slush Wallet or Suiet to interact
- View Real Data: All deals, stats, and transactions are fetched from blockchain
Note: If no deals exist on-chain yet, the dashboard will show 0 stats until you create deals.
trust-deal/
โโโ move/ # Smart Contracts (Sui Move)
โ โโโ sources/
โ โ โโโ escrow.move # Main escrow logic
โ โโโ Move.toml
โ
โโโ web/ # Frontend (Next.js)
โโโ app/
โ โโโ page.tsx # Homepage & Hero
โ โโโ deals/ # Browse deals page
โ โโโ dashboard/ # Analytics dashboard
โ โโโ profile/ # User profile
โ โโโ deal/[id]/ # Deal detail page
โ โโโ actions/ # Server Actions
โ
โโโ components/
โ โโโ ui/ # UI components
โ โโโ Dashboard.tsx # Analytics dashboard
โ โโโ DealList.tsx # Deal list view
โ โโโ Navbar.tsx # Navigation bar
โ
โโโ hooks/
โ โโโ useEscrow.ts # Escrow functions
โ โโโ useAuth.ts # Auth utilities
โ โโโ useDealStats.ts # Stats queries
โ
โโโ lib/
โโโ utils.ts # Utility functions
graph
A[Seller Creates Deal] --> B[Smart Contract Deployed]
B --> C[Buyer Deposits Funds]
C --> D[Funds Locked in Escrow]
D --> E[Seller Ships Item]
E --> F[Buyer Confirms Receipt]
F --> G[Funds Released to Seller]
| Status | Code | Description | Actions Available |
|---|---|---|---|
| Created | 0 | Deal initialized | Buyer: Deposit / Seller: Cancel |
| Locked | 1 | Funds escrowed | Buyer: Confirm Delivery |
| Completed | 2 | Funds released | None (final state) |
| Cancelled | 3 | Deal cancelled | None (final state) |
// 1. Create Deal (Seller)
public entry fun create_deal(price: u64, ctx: &mut TxContext)
// 2. Deposit Funds (Buyer)
public entry fun deposit(deal: &mut Deal, payment: Coin<SUI>, ctx: &mut TxContext)
// 3. Confirm Delivery (Buyer)
public entry fun confirm_delivery(deal: &mut Deal, ctx: &mut TxContext)
// 4. Cancel Deal (Seller, only if STATUS_CREATED)
public entry fun cancel_deal(deal: &mut Deal, ctx: &mut TxContext)- Hero section with gradient animations
- Quick deal creation form
- Feature showcase
- Live statistics
- Real-time deal listings from localStorage
- Search by ID or address
- Filter by status (Created, Locked, Completed, Cancelled)
- Sort by date or amount
- Responsive grid layout
- Platform-wide statistics
- Interactive charts (Recharts):
- Bar chart: 7-day transaction volume
- Pie chart: Deal status distribution
- Line chart: Daily activity
- Real blockchain data
- Auto-detects wallet address
- User statistics (deals created, completed, trust score)
- Deal history
- Performance metrics with progress bars
- Live deal status
- Timeline visualization
- Action buttons (context-aware)
- Transaction history
- Copy deal ID/addresses
LocalStorage-based:
- Deal IDs stored in browser
localStorage - Persists across page refreshes
- Device-specific (not synced)
// Deal IDs stored as:
localStorage.setItem(
"deal_ids",
JSON.stringify(["0xabc123...", "0xdef456..."])
);For production deployment, implement one of these:
-
Sui Indexer API (Recommended)
// Query all Deal objects globally const response = await indexer.getDynamicFields({ parentId: REGISTRY_OBJECT_ID, });
-
GraphQL Endpoint
query AllDeals { objects( filter: { type: "${PACKAGE_ID}::escrow::Deal" } ) { edges { node { ... } } } }
-
Backend + Database
- Index events via WebSocket
- Store in PostgreSQL/MongoDB
- Expose REST/GraphQL API
cd web
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel
# Add environment variables in Vercel dashboardNetlify:
netlify deploy --prodAWS Amplify:
amplify publishDevnet:
sui client publish --gas-budget 100000000Mainnet (requires sufficient SUI):
sui client switch --env mainnet
sui client publish --gas-budget 100000000- Smart contract escrow logic
- Next.js 16 frontend
- Wallet integration
- Real blockchain data
- Responsive design
- Dashboard analytics
- Profile pages
- Deal lifecycle management
- Sui Indexer integration (remove localStorage)
- WebSocket for real-time updates
- Push notifications
- Advanced search & filters
- Multi-signature deals
- Dispute resolution system
- Reputation NFTs
- Cross-chain bridges
- Mobile app (React Native)
- Mainnet deployment
This project is licensed under the MIT License - see LICENSE file.
- Sui Foundation - For the amazing blockchain platform
- Mysten Labs - For excellent developer tools
- Shadcn - For beautiful UI components
- Vercel - For seamless deployment
Built with โค๏ธ by the kiettt23
โญ Star this repo if you find it useful!
Last Updated: January 13, 2026 | Version: 1.1.0
