Project Info
This project did not submit a demo video on Devpost.
Inspiration
Our team has always enjoyed thrifting, whether it’s for personal style, sustainability, or the excitement of finding something truly original. But when we tried to bring that experience online, we encountered a different reality: listings buried by algorithms, paywalls for visibility, and platforms taking up to a third of every sale. What began as a shared hobby made us realize a larger issue—people who bring value to resale platforms do not control their earnings, audience, or data. ThriftChain was created to make online resale feel like in-person thrifting again: community-focused, accessible, and fair to the people who power it.
What it does
On-Chain Ownership & Zero-Fee Trading: Listings exist as smart contracts on Sui, eliminating intermediaries and fees so sellers keep 100% of earnings. On-Chain Negotiation & Bidding: Buyers and sellers negotiate directly through on-chain offers and counteroffers with a permanent, transparent audit trail. Semantic AI Search: Vector-based search enables discovery by style and aesthetic meaning, bypassing keyword limitations and paid promotion. Decentralized Image Storage (Walrus): Images are stored on a fault-tolerant decentralized network with permanent, tamper-proof links stored on-chain. Smart Contract Escrow: Payments are held in on-chain escrow until buyer confirmation, enabling trustless transactions with automated protection for both parties.
How we built it
Architecture ThriftChain is built on a four-layer decentralized architecture that eliminates traditional marketplace intermediaries. At the foundation, we deployed smart contracts written in Move language on the Sui blockchain to handle item listings, escrow transactions, and reputation management with fast finality and minimal gas costs. For storage, we integrated Walrus Protocol to host all item images as decentralized blobs, with their IDs stored directly in our on-chain objects, keeping the entire stack Web3-native without relying on centralized services. The frontend is a Next.js 16 application with React 19 and TypeScript, featuring dual authentication through both Suiet wallet extensions for crypto users and Enoki's zkLogin OAuth for seamless Google sign-in. To power intelligent discovery, we built a semantic search layer using Supabase's PostgreSQL with pgvector extension, storing 1536-dimensional OpenAI embeddings for item titles, descriptions, and images that enable users to search by meaning rather than keywords. All three layers—blockchain, decentralized storage, and AI search—communicate through the Mysten SDK ecosystem, creating a fully trustless marketplace where users can "find vintage jackets" instead of scrolling through generic keyword results. Project Workflow We started by designing and deploying the core Move smart contracts to Sui testnet, implementing marketplace primitives like item creation, bidding, and escrow mechanics that leverage Sui's object-oriented model for direct peer-to-peer transfers. Once the blockchain foundation was solid, we built the Next.js frontend with Tailwind CSS and shadcn/ui components, connecting it to Sui through the TypeScript SDK and implementing both wallet-based and OAuth authentication flows. In parallel, we set up the Supabase database with the pgvector extension and created an indexing pipeline that generates OpenAI embeddings whenever new items are listed on-chain, linking each vector to its corresponding Sui object ID for hybrid queries. The integration phase connected all components: when a user lists an item, images upload to Walrus and return blob IDs that get stored in the smart contract, which triggers our backend to generate embeddings and index them in Supabase for semantic search. We then implemented the search interface that queries the vector database for similar items and fetches complete blockchain data including Walrus image references, creating a seamless experience where AI discovery meets decentralized ownership. Throughout the 48-hour hackathon, we iterated rapidly on the UI to achieve a retro thrift aesthetic while ensuring the complex blockchain interactions remained intuitive for both crypto-native users and newcomers exploring Web3 for the first time.
Challenges we ran into
Our biggest technical hurdle emerged from Next.js 16's new turbopack bundler fundamentally changing how BCS (Binary Canonical Serialization) values are encoded when calling Sui smart contracts—a six-hour debugging marathon from 10PM to 4AM that forced us to deeply understand how tx.pure serialization works rather than relying on automatic type inference. We ultimately resolved this by explicitly typing every transaction parameter using methods like tx.pure.string(), tx.pure.u64(), and tx.pure.vector('string', tags) instead of letting the bundler serialize values automatically, which turbopack handled differently than webpack due to internal string handling optimizations. Walrus integration presented its own challenges when testnet endpoints changed mid-development and broke our entire image storage pipeline, prompting us to build a resilient solution with environment-based configuration for both publisher and aggregator URLs, comprehensive retry logic with detailed logging at each stage, validation functions to catch oversized files before upload, and health check endpoints to gracefully handle downtime. Perhaps the most frustrating limitation was the lack of mature end-to-end testing tools for Move smart contracts—we couldn't reliably test transaction flows locally, so we built our own TypeScript-based testing framework that signs transactions with exported keypairs, parses deployment IDs from config files, validates on-chain state changes, and provides colorized console output to debug complex multi-step flows like offer creation and escrow settlement. These workarounds, while time-consuming, taught us the bleeding edge of blockchain development isn't always polished, and sometimes the best path forward is building your own infrastructure when the ecosystem's tooling doesn't exist yet.
Accomplishments we're proud of
A lot of us have heard of blockchain and understood it as a scary piece of technical jargon, but literally 2 days ago we actual learned how to use it. . It was also our first hackathon as a team, and we spent long nights learning, experimenting, and building side by side. What started as a fun idea quickly became something meaningful, because it reflected our real interests and the kind of experiences we care about.
What we learned
Building ThriftChain taught us invaluable lessons about the realities of blockchain development beyond traditional web applications. We discovered that decentralization requires creative compromises—pure blockchain solutions can be too slow for modern UX expectations, necessitating hybrid architectures that preserve trustlessness while delivering speed. The fragility of emerging blockchain ecosystems became apparent when testnet endpoints changed unexpectedly and serialization libraries conflicted across languages. Most significantly, we learned that blockchain development tooling still lags behind traditional frameworks, requiring manual workarounds for basic features like end-to-end testing. These challenges reinforced that building on cutting-edge technology demands resilience, adaptability, and deep understanding of low-level protocols.
What's next
ThriftChain's roadmap focuses on expanding functionality while improving the developer and user experience. We plan to implement native mobile applications for iOS and Android, making sustainable shopping more accessible to mainstream consumers. Enhanced AI-powered recommendation systems will suggest items based on user preferences and sustainability metrics, while automated pricing suggestions will help sellers optimize their listings. We're exploring integration with additional blockchain networks beyond Sui to increase marketplace liquidity and reach. Finally, we aim to contribute back to the ecosystem by developing open-source testing frameworks for Move smart contracts and publishing our hybrid architecture patterns to help other builders navigate the decentralization-performance tradeoff.
ThriftChain
A decentralized marketplace built on Sui blockchain for peer-to-peer trading of thrift items with AI-powered personalization.
Project Structure
ThriftChain/
├── frontend/ # Next.js frontend application
│ ├── src/ # Source code
│ ├── public/ # Static assets
│ └── package.json # Frontend dependencies
├── contracts/ # Sui Move smart contracts (to be added)
├── tasks/ # Development task lists
├── docs/ # Documentation
└── package.json # Root workspace configuration
Getting Started
Prerequisites
- Node.js 18+
- npm or yarn
Installation
- Clone the repository
- Install frontend dependencies:
npm run install:frontend
# or
cd frontend && npm install
Development
Run the development server from the root:
npm run dev
# or navigate to frontend directory
cd frontend && npm run dev
Open http://localhost:3000 with your browser to see the result.
Available Scripts
From the root directory:
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
From the frontend/ directory:
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
Features
Wallet Integration
- Suiet Wallet Kit: Connect with Sui wallet extensions
- zkLogin (Enoki): Passwordless authentication via Google OAuth
- Routes:
GET /api/zklogin/enoki/start- Initiate OAuth flowPOST /api/zklogin/enoki/complete- Complete authenticationGET /auth/callback- OAuth callback handler
Environment Variables
Create a .env.local file in the frontend/ directory:
# Enoki (managed zkLogin)
ENOKI_API_KEY=your_enoki_api_key
ENOKI_OAUTH_CLIENT_ID=your_google_oauth_client_id
NEXT_PUBLIC_ZKLOGIN_REDIRECT_URL=http://localhost:3000/auth/callback
# Supabase (to be added)
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# Sui Network
NEXT_PUBLIC_SUI_NETWORK=testnet
NEXT_PUBLIC_RPC_URL=https://fullnode.testnet.sui.io:443
Tech Stack
- Frontend: Next.js 16, React 19, TypeScript
- Styling: Tailwind CSS, shadcn/ui
- Blockchain: Sui Network, @mysten/sui SDK
- Wallet: Suiet Wallet Kit, Enoki zkLogin
- Storage: Walrus
- Database: Supabase
Learn More
Deployment
The frontend can be deployed to Vercel. See Next.js deployment docs.
Docs Repos
Analysis
View
Metric
- 24
- 18
- 17
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- Google GeminiIn code
- HTMLIn code
- JavaScriptIn code
- Next.jsIn code
- ReactIn code
- SQLIn code
- SupabaseIn code
- Tailwind CSSIn code
- TypeScriptIn code
10 of 10 appear in the indexed code.
AI coding agents
- Claude CodeConfig
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
754 KB
Source files
114
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
rijulg06/ThriftChain
161 files · 1.1 MB · @ 3977b0d
Structure
Interface
23 files · 14%Screens, components and styles rendered to the user.
API & routing
11 files · 7%Request entry points: routes, handlers and controllers.
Application logic
65 files · 40%Domain rules, services and shared utilities.
Data & schema
5 files · 3%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- TypeScript41%
- Markdown37%
- Shell18%
- JavaScript2%
- SQL1%
- CSS1%
- Other (1)0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
frontend/package.json
npm · 32- @google/generative-ai
- @mysten/dapp-kit
- @mysten/enoki
- @mysten/sui
- @mysten/walrus
- @radix-ui/react-alert-dialog
- @radix-ui/react-dialog
- @radix-ui/react-slot
- @suiet/wallet-kit
- @supabase/realtime-js
- @supabase/ssr
- @supabase/supabase-js
- class-variance-authority
- clsx
- lucide-react
- next
- next-themes
- pixelarticons
- +14 more
package.json
npm · 32- @google/generative-ai
- @mysten/dapp-kit
- @mysten/enoki
- @mysten/sui
- @mysten/walrus
- @radix-ui/react-alert-dialog
- @radix-ui/react-dialog
- @radix-ui/react-slot
- @suiet/wallet-kit
- @supabase/realtime-js
- @supabase/ssr
- @supabase/supabase-js
- class-variance-authority
- clsx
- lucide-react
- next
- next-themes
- pixelarticons
- +14 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.