Skip to content

HitsukiMok/ComiSure

Repository files navigation

Main index

🎨 ComiSure

Trustless USDC escrow for freelance digital art commissions on the Stellar Network.

ComiSure replaces informal, trust-based payment channels with a decentralized Soroban smart contract. Protect yourself from chargeback scams and ghost artists using instant, on-chain settlements.

image

πŸ“– Project Description

Freelance digital artists and their clients face rampant fraud. Artists suffer severe income loss from malicious PayPal chargebacks after delivering unwatermarked artwork, while clients risk sending upfront e-wallet payments (like Paypal) to "artists" who ghost them.

ComiSure is a decentralized web application that acts as a trustless escrow middleman. Clients initiate a commission by depositing USDC into a custom Soroban smart contract. The funds are securely locked on-chain, proving to the artist that the money is guaranteed. Once the artist delivers the final piece, the client approves the release, and the funds are instantly routed to the artist's wallet. By utilizing the Stellar network, ComiSure leverages 5-second settlement times and sub-cent transaction fees, making smart contract escrows economically viable even for small, everyday art commissions (β‚±500 - β‚±5,000).


✨ Core Features

  • Trustless USDC Escrow: Lock commission funds upfront in a stablecoin, protecting both parties from crypto volatility and payment fraud.
  • Client-Driven Approval: Funds are only released to the artist when the client reviews and approves the final delivered artwork.
  • Admin Dispute Resolution: A built-in fallback mechanism. If a client maliciously withholds approval after delivery, or if an artist fails to deliver, the platform Admin can step in to force-release or refund the USDC.
  • Dynamic Contract Generation: Every single commission gets its own physically isolated Soroban smart contract generated on the fly, preventing centralized contract bottlenecks.
  • Micro-transaction Optimized: Powered by Stellar, ensuring gas fees do not eat into the artist's hard-earned commission profits.

πŸ”— Deployed Contract Details

  • Network: Stellar Testnet
  • Smart Contract Environment: Soroban
  • Deployed Factory Contract ID: CAWAKGBTHWFMTB6O74CDJ5WOVLLFZ5WMKTBKOP2FNB5BUMTQPZYQZN3J
  • Supported Asset: USDC (Stellar Asset Contract)

πŸ–₯️ UI / Screenshots

Home Interface

Main index

Wallet Connect using Stellar Wallet Kit

Wallet Connect

Client Dashboard (Contains contracts from artists)

Client Dashboard

Client Creating New Contract

New Contract

Contract Preview

Contract Preview

The client has to confirm the deposit first for the set amount of USDC they specified and would be able to approve the release of funds if the artist delivered the commission. Just in case a dispute happened, the admin with the admin wallet would be able to interfere by refunding/releasing the funds depending on the case.

Transactions Status Preview

Successful Refunded

πŸš€ True Dynamic Pipeline Structure

Unlike traditional DApps that rely on a single, massive monolithic smart contract to track all users, ComiSure creates a unique, physically isolated Smart Contract for every single commission.

  1. Frontend Request: The UI requests a new Escrow.
  2. Backend Engine: The FastAPI server connects to the Stellar CLI natively.
  3. On-the-fly Compilation: The backend drops a pre-compiled comi_sure.wasm bytecode payload directly onto the Stellar Network.
  4. Initialization: The backend initializes the contract exclusively with the specific Client and Artist addresses, mapping itself as the irrevocable admin.

πŸ›  Tech Stack

  • Smart Contract Level: Soroban SDK (Rust), wasm32-unknown-unknown
  • Backend API Layer: Python 3, FastAPI, SQLModel, Uvicorn
  • Frontend App: Frontend React 18, Vite, Tailwind CSS, Framer Motion
  • Stellar SDK: @stellar/stellar-sdk, @creit-tech/stellar-wallets-kit

☁️ Deployment Architecture (Vercel + Railway)

Because of the dynamic compilation pipeline, ComiSure requires a specialized deployment setup.

1. Frontend (Deploy to Vercel)

The React Frontend is extremely portable and optimized for Vercel. Ensure your Vercel Project points the Root Directory to frontend/.

Required Vercel Environment Variables:

  • VITE_SOROBAN_RPC: https://soroban-testnet.stellar.org
  • VITE_API_URL: <YOUR_RAILWAY_URL> (e.g., https://comisure-backend.up.railway.app)

2. Backend (Deploy to Railway)

The strict requirement for the Stellar CLI and persistent database connections makes Railway the best host for the Python layer.

  1. Create a new service on Railway.app.
  2. Link this GitHub repo and set the Root Directory to /backend.
  3. Railway will instantly detect our custom Dockerfile and install the Linux Stellar CLI implicitly!

Required Railway Environment Variables:

  • DATABASE_URL: Let Railway auto-provision a PostgreSQL database, or leave blank to fall back to a volatile SQLite file.
  • DEPLOYER_SECRET_KEY: S... The Secret Key that funds gas fees for dynamically spinning up Escrows. This will be automatically injected into the Railway environment on boot!

πŸƒ Local Development Quickstart

If you are running the system locally for development, run both services side-by-side:

1. Fast API Backend

cd backend
python -m venv venv
.\venv\Scripts\activate   # Use `source venv/bin/activate` on Mac/Linux
pip install -r requirements.txt
uvicorn main:app --reload

The API will run at http://127.0.0.1:8000.

2. React Frontend

cd frontend
npm install
npm run dev

The web app will run at http://localhost:5173. You must have the Freighter browser extension installed to connect your wallet!


βš™οΈ Smart Contract Development

πŸ“– Note: For a comprehensive breakdown of the smart contract's internal logic, data structures, and function signatures, please refer to the smart contract documentation..

Prerequisites

  • Rust toolchain target wasm32v1-none
  • Stellar CLI 22.0.0+

Build & Test

# Compile the contract to an optimised Wasm binary
stellar contract build

# Run cargo tests
cargo test

πŸ“‚ Project Structure

ComiSure/
β”œβ”€β”€ frontend/           # React + Vite application & Wallet SDK integration
β”œβ”€β”€ backend/            # Python FastAPI dynamic deployer & SQLite tracker
β”œβ”€β”€ Cargo.toml          # Soroban package dependencies
└── src/
    β”œβ”€β”€ lib.rs          # Soroban Escrow Smart Contract code
    └── test.rs         # Local testings for happy path & unauthorized calls

License

MIT License

Copyright (c) 2026 ComiSure Contributors

About

A trustless, Soroban-powered escrow web app protecting digital artists and clients from commission fraud using Stellar USDC.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages