Skip to content
salihtorePublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WorkSeal

Decentralized Freelance Work Management on the Sui Blockchain

Sui Network Move Next.js Expo License: MIT

Try the App Β· View Docs Β· Report a Bug


πŸ“‹ Table of Contents


πŸš€ About the Project

WorkSeal is a fully decentralized work management platform that secures agreements between freelancers and clients using blockchain technology. Powered by smart contracts written on the Sui blockchain, it provides payment security, transparent job tracking, and independent dispute resolution β€” with no intermediaries required.

Why WorkSeal?

Traditional Platforms WorkSeal
5–20% commission fee Zero platform commission
Subject to platform rules Contract rules are immutable
Payments can be delayed Instant, automatic payment upon approval
Platform acts as arbitrator Independent, on-chain arbitration system
Data stored on central servers All data lives on the Sui blockchain

✨ Features

πŸ” Smart Contract-Based Escrow

  • The client locks payment into the contract; no payment is released until the freelancer delivers.
  • Separate approval and payment flow for each milestone.
  • All transactions are recorded immutably on-chain.

πŸ“Œ Milestone-Based Payments

  • Contracts can be created with multiple milestones.
  • Each milestone has its own title and SUI amount.
  • Freelancers can attach a proof link and notes for each milestone.
  • If the client approves, payment is released instantly; if rejected, the freelancer can resubmit.

βš–οΈ Independent Arbitration System

  • When a dispute is raised, an arbitrator is automatically assigned from the on-chain arbitrator pool.
  • The arbitrator has separate private messaging channels with both the client and freelancer.
  • Upon resolution, the arbitrator receives a 2% commission; the remainder goes to the winning party.
  • Either the admin or the assigned arbitrator can finalize the dispute.

πŸ’¬ On-Chain Messaging

  • A group chat accessible to all parties.
  • Private channel between the arbitrator and the client.
  • Private channel between the arbitrator and the freelancer.
  • All messages are stored on-chain with timestamps.

πŸ“± Mobile App (iOS & Android)

  • zkLogin with Google β€” no wallet required, sign in with one tap.
  • Real-time balance display and SUI transfers.
  • Full dark mode and multi-language support.

🌐 Web Application

  • Connect with any Sui wallet via dapp-kit.
  • Create and manage contracts.
  • Live job listing and discovery page.
  • Escrow, invoice, and dispute management panels.

πŸ—οΈ Architecture

WorkSeal
β”œβ”€β”€ contracts/          # Sui Move smart contracts
β”‚   β”œβ”€β”€ sources/
β”‚   β”‚   └── contracts.move   # Main WorkSeal module
β”‚   └── tests/
β”‚       └── contracts_tests.move
β”‚
β”œβ”€β”€ frontend/           # Next.js 16 web application
β”‚   └── src/
β”‚       β”œβ”€β”€ app/        # App Router pages
β”‚       β”‚   β”œβ”€β”€ (app)/  # Dashboard, contracts, escrow, disputes...
β”‚       β”‚   └── connect/
β”‚       β”œβ”€β”€ components/ # Reusable UI components
β”‚       β”œβ”€β”€ hooks/      # useContracts, useContractDetails...
β”‚       β”œβ”€β”€ contexts/   # Notifications and global state
β”‚       β”œβ”€β”€ config/     # Constants and network settings
β”‚       └── types/      # TypeScript type definitions
β”‚
└── mobile/             # Expo React Native application
    β”œβ”€β”€ app/
    β”‚   β”œβ”€β”€ (tabs)/     # Main tabs (dashboard, wallet, profile...)
    β”‚   β”œβ”€β”€ contracts/  # Contract detail screens
    β”‚   └── wallet/     # Wallet operations
    β”œβ”€β”€ components/     # AppBackground, ContractCard, TabBar...
    β”œβ”€β”€ constants/      # config.ts, theme.ts, translations.ts
    β”œβ”€β”€ lib/            # zklogin, wallet-store, sui-tx, sui-client
    └── hooks/          # Custom React hooks

Data Flow

[User]
    β”‚
    β”œβ”€β”€β”€ Web (Next.js) ──► @mysten/dapp-kit ──► Sui RPC
    β”‚
    └─── Mobile (Expo) ──► zkLogin (Google) ──► Sui RPC
                                β”‚
                         Enoki Prover API
                         (ZK Proof generation)
                                β”‚
                    [WorkSeal Move Contract]
                    Sui Testnet Blockchain

πŸ› οΈ Tech Stack

Smart Contract

Technology Version Description
Move 2024 Edition Sui's native smart contract language
Sui Framework latest Object model, coin, and event system

Frontend

Technology Version Description
Next.js 16.2.4 React-based full-stack framework
React 19.2.4 UI library
TypeScript ^5 Type-safe development
TailwindCSS ^4 Utility-first CSS
@mysten/dapp-kit ^1.0.4 Sui wallet integration
@mysten/sui ^2.16.0 Sui SDK
TanStack Query ^5.99.0 Server state management
shadcn/ui ^4.3.0 Component library
React Hook Form ^7.72.1 Form management
Zod ^4.3.6 Schema validation
Lucide React ^1.8.0 Icon set

Mobile

Technology Version Description
Expo ~54.0.0 React Native development platform
React Native 0.81.5 Cross-platform mobile framework
Expo Router ~6.0.23 File-based routing
@mysten/enoki ^1.0.8 Enoki service for zkLogin
@mysten/sui ^1.3.0 Sui SDK
Zustand ^4.5.2 Global state management
i18next ^23.10.1 Multi-language support
React Native Reanimated ~4.1.1 Animation engine
WalletConnect ^2.23.9 Sui wallet connection infrastructure
Expo Secure Store ~15.0.8 Secure local storage

πŸ“œ Smart Contract

The WorkSeal contract is deployed on Sui Testnet at 0x347761a22dd046d6c4b34b17a35fe388c644c8315bf5830d28bcf9429c4c4e86.

Contract States

[0] Created ──► [1] Active (Funded) ──► [2] Completed
                      β”‚
                      β”œβ”€β”€β–Ί [3] Disputed ──► [2] Resolved
                      β”‚
                      └──► [4] Cancelled

Core Functions

Function Authorized By Description
create_contract Anyone Creates a new work contract
fund_contract Client Funds the contract (escrow)
take_job Freelancer Claims the job
submit_milestone Freelancer Submits milestone proof
approve_and_release_funds Client Approves and releases payment
reject_milestone Client Rejects proof; allows resubmission
raise_dispute Either party Opens a dispute; arbitrator is assigned
resolve_dispute_arbitrator Arbitrator Finalizes the dispute
resolve_dispute_admin Admin Finalizes the dispute with admin authority
cancel_contract Client Cancels an unfunded or unassigned contract
send_message All parties Sends a group message
send_private_message Arbitrator / Parties Sends a private message
resume_contract_arbitrator Arbitrator Resumes a paused contract
register_arbitrator Admin Registers a new arbitrator

Events

Event Triggered When
ContractCreatedEvent A contract is created
ContractFundedEvent Escrow is funded
PaymentReleasedEvent A milestone payment is released
MilestoneRejectedEvent A milestone is rejected
DisputeRaisedEvent A dispute is opened
DisputeResolvedEvent A dispute is resolved
ArbitratorAssignedEvent An arbitrator is assigned
ContractCancelledEvent A contract is cancelled
ContractResumedEvent A contract is resumed

🌐 Frontend

A web application built with Next.js 16 using the App Router. Connects to Sui wallets via @mysten/dapp-kit.

Pages

Route Description
/ Landing page β€” project overview and live job counter
/connect Wallet connection
/(app)/dashboard User summary and overview
/(app)/contracts Contract list and management
/(app)/explore Open job listings and discovery
/(app)/escrow Escrow management
/(app)/disputes Disputes and arbitrator panel
/(app)/invoices Invoice and payment history
/(app)/arbitrator Arbitrator management panel
/(app)/profile User profile

Frontend Setup

cd frontend
npm install
npm run dev

The app starts at http://localhost:3000.


πŸ“± Mobile App

A mobile application built with Expo SDK ~54, supporting both iOS and Android.

Authentication

zkLogin (Sign in with Google)

Users can sign in with their Google account without needing a crypto wallet. Under the hood:

  1. An Ed25519 ephemeral keypair and nonce are generated.
  2. A JWT is obtained via Google OAuth.
  3. A ZK proof is requested from Mysten Labs' Enoki Prover.
  4. A deterministic Sui address is derived for the user.
  5. All session data is securely stored using expo-secure-store.

Mobile Screens

Screen Description
login.tsx Google zkLogin sign-in flow
dashboard.tsx Active contracts and summary cards
contracts.tsx Contract list, creation, and detail view
wallet.tsx Balance, transfers, and testnet faucet
explore.tsx Open job listings and job application
profile.tsx User profile and settings
invoices.tsx Invoice history
support.tsx Support and FAQ

Mobile Setup

cd mobile
npm install

# For Android
npm run android

# For iOS (requires macOS)
npm run ios

# Preview with Expo Go
npm start

Note: An expo-go.apk file is included in the project. Install it on your Android device to quickly test the app.


βš™οΈ Installation

Prerequisites

  • Node.js >= 18
  • Sui CLI (for contract deployment)
  • Expo CLI (for mobile)
  • Android Studio or Xcode (for emulator instead of physical device)

1. Clone the Repository

git clone https://github.com/salihtore/WorkSeal.git
cd WorkSeal

2. Build the Contracts (Optional)

cd contracts
sui move build
sui move test

To deploy the contract to Sui Testnet:

sui client publish --gas-budget 100000000

3. Start the Frontend

cd frontend
npm install
npm run dev

4. Start the Mobile App

cd mobile
npm install
npm start

πŸ—ΊοΈ Usage

Client Flow

  1. Connect β€” Link your wallet (web or mobile).
  2. Create a Contract β€” Define the job title, description, deadline, and milestones.
  3. Fund β€” Transfer the total budget to escrow (SUI).
  4. Review Milestones β€” Evaluate the proof submitted by the freelancer.
  5. Approve / Reject β€” Approving releases payment automatically; rejecting prompts a resubmission.
  6. Raise a Dispute β€” If there's a disagreement, an on-chain arbitrator steps in.

Freelancer Flow

  1. Explore β€” Browse and filter open jobs.
  2. Claim the Job β€” Call take_job on the contract of your choice.
  3. Submit Milestones β€” Add a proof link and notes for each phase.
  4. Get Paid β€” SUI is automatically transferred to your balance as the client approves each milestone.

Arbitrator Flow

  1. You are automatically assigned when a dispute is opened.
  2. You can communicate privately with each party in separate channels.
  3. After reviewing, determine the winner; a 2% commission is automatically sent to your account.

πŸ”’ Security

  • Escrow Guarantee: Payment is only released upon client approval; funds are never lost.
  • Authorization Checks: Every function verifies the sender's address (ENotAuthorized).
  • Double-Payment Protection: The is_paid flag prevents the same milestone from being paid twice.
  • Cancellation Rules: Only unfunded or unassigned contracts can be cancelled; otherwise cancellation is blocked (ECancelNotAllowed).
  • Nonce Verification: The Google JWT nonce is cryptographically verified during the zkLogin flow.
  • Secure Storage: Mobile session data is encrypted using expo-secure-store.

πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.


WorkSeal β€” Lock Your Freelance Work into the Chain πŸ”

Built on the power of the Sui blockchain

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages