How staking-facilities-gmbh/tidal works
Project Type and Purpose
• Tidal is a full-stack decentralized asset trading platform (dApp) built on the Sui blockchain.
• Core functions: encrypted file storage/trading, on-chain asset registration, subscription/access control.
File Structure & README
• Frontend (React + Vite + Typescript + Supabase client + Seal/Walrus SDKs)
• Smart contracts in Move (sources under move/sources) plus tests
• Supabase migrations for metadata
• No traditional “backend” server: business logic split between on-chain Move contracts and off-chain services (Supabase, Walrus, Seal).
Main Components
a. Frontend Client
• React/Vite app (frontend/src)
• Pages: asset creation, store, user purchases
• Uses Seal SDK, Walrus SDK, Supabase client, Sui RPC (via networkConfig.ts)
b. Sui Blockchain (On-chain Layer)
• Move contracts for assets, allowlists, payments, subscriptions
• Invoked via Sui RPC from frontend
c. Encryption Layer (Seal)
• Seal SDK running in frontend (gif.worker.js) for encrypt/decrypt
• Key servers for session key management (external service)
d. Storage Layer (Walrus)
• Encrypted blob storage providers (via Walrus SDK)
• Returns content-addressed URLs
e. Database Layer (Supabase)
• PostgreSQL metadata tables (assets, purchases) via Supabase migrations
• Stores file references & user records
f. External Services & Infrastructure
• Supabase instance (hosted)
• Sui node/RPC endpoint
• Key servers for Seal
• Walrus storage providers
• Vercel (or similar) hosting for frontend
Relationships & Data Flows
• Asset Creation Flow:
User → Frontend → Seal SDK (Encrypt) → Walrus Store → Frontend → Sui RPC (Move.create_asset) → Frontend → Supabase (insert metadata)
• Asset Purchase Flow:
User → Frontend → Sui RPC (Move.payment) → Frontend → Seal SDK (verify access + session key) → Frontend → Walrus (get encrypted blob) → Seal SDK (decrypt) → User
• Metadata Queries: Frontend ↔ Supabase (list assets, purchases)
• On-chain State: Move contracts maintain allowlists and ownership.
Architectural Patterns & Design Principles
• Layered Separation:
• Presentation (React)
• Business Logic (Move contracts)
• Off-chain Services (Supabase, Seal, Walrus)
• Security by Design:
• End-to-end encryption (Seal)
• On-chain access control (allowlists)
• Content addressing & redundancy (Walrus)
• Micro-integrations: each service has a single responsibility and is consumed directly by the frontend.
Final Checklist
[ ] All major components represented with clear labels