Speak freely. Stay veiled. Powered by Stellar.
Reviewing this project for the submission evaluation? All required evidence (3 Smart Contracts, Inter-Contract Communication, 48+ Commits, CI/CD, 37 Passing Tests, Screenshots, Live Demo, and Video) is documented in our Submission Guide.
Live App: https://veil-lilac-gamma.vercel.app/
Demo Video (Loom): https://www.loom.com/share/26836527e8f9424bb02bd5ace67ffda5
| Landing Page | Chat Interface |
|---|---|
![]() |
![]() |
| Mobile Responsive | CI/CD Pipeline |
|---|---|
![]() |
![]() |
| Test Output | Analytics Dashboard |
|---|---|
![]() |
![]() |
Veil is a privacy-first anonymous chat application built on the Stellar network. It features end-to-end encrypted messaging, wallet-based authentication, token-gated communities, DAO governance, reputation tracking, and XLM micropayments — all without requiring personal credentials.
- End-to-End Encrypted — Client-side X25519 + AES-GCM encryption. Zero plaintext stored on relay servers.
- Zero Identity — Connect seamlessly via Stellar SEP-10 authentication and Freighter wallet.
- Token-Gated Rooms — Enforce room access on-chain via Soroban smart contracts (
TokenGate). - DAO Governance — Execute decentralized moderation votes with Inter-Contract Communication (ICC) to Reputation.
- Reputation System — Non-transferable on-chain reputation points (
Reputation) with automatic decay. - XLM Micropayments — Instant, sub-cent Stellar XLM tipping for message authors (
TipModal). - Real-time Chat & Event Stream — Supabase WebSocket real-time delivery paired with 6s Soroban RPC polling.
- Global Anchor Access — Integrated anchor access across 475,000+ global cash-to-crypto locations.
| Layer | Technology |
|---|---|
| Frontend | Next.js 16, React 19, TypeScript, Tailwind CSS 4 |
| UI | shadcn/ui (Radix UI), Lucide icons |
| Auth | SEP-10 (Stellar auth), Freighter wallet |
| Database | Supabase (PostgreSQL) |
| Real-time | Supabase Realtime (WebSocket channels) |
| Blockchain | Stellar (Soroban smart contracts in Rust) |
| Encryption | Web Crypto API (X25519 + AES-GCM) |
| Key Storage | IndexedDB |
| Wallet | @stellar/freighter-api |
| Payments | Stellar SDK (XLM, USDC) |
| Hosting | Vercel |
| Analytics | Vercel Analytics + Speed Insights |
- Node.js >= 20.x
- pnpm (recommended)
- Freighter wallet browser extension
- Supabase account
# Clone the repository
git clone git@github.com:0xcoredev/Veil.git
cd Veil
# Install dependencies
pnpm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your Supabase and Stellar credentials
# Run database migrations in Supabase SQL Editor
# scripts/001_create_profiles.sql
# scripts/002_create_messages_rooms.sql
# scripts/003_room_members.sql
# scripts/004_token_gate.sql
# scripts/005_reputation.sql
# Start the development server
pnpm devOpen http://localhost:3000 in your browser.
See .env.example for the full list. Key variables:
# Supabase
NEXT_PUBLIC_SUPABASE_URL=your-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
# Stellar
NEXT_PUBLIC_STELLAR_NETWORK=testnet
NEXT_PUBLIC_STELLAR_NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
NEXT_PUBLIC_STELLAR_HORIZON_URL="https://horizon-testnet.stellar.org"
NEXT_PUBLIC_STELLAR_RPC_URL="https://soroban-testnet.stellar.org"
STELLAR_SERVER_SECRET=your-server-secret-key
# Smart Contract Addresses (Stellar Testnet)
NEXT_PUBLIC_TOKEN_GATE_CONTRACT=CAFXM7ZBM2VKZON6NV5RTQSPQR7XSJQQLEXYSFX263M655MSTPEJKZQD
NEXT_PUBLIC_GOVERNANCE_CONTRACT=CCKZX4QXV5YJGKHW4NXEFTA4NT7BWXDNX3KR7IFLNLIYOV3FA5EDUUMF
NEXT_PUBLIC_REPUTATION_CONTRACT=CBSG3H3KH536RDNCG6QTZZXA6TERUDSQCHZNTYDHUONWQ7JWD5AKNEKQ
# JWT
JWT_SECRET=your-jwt-secret-change-this| Contract | Address | Stellar Expert |
|---|---|---|
| Token Gate | CAFXM7ZBM2VKZON6NV5RTQSPQR7XSJQQLEXYSFX263M655MSTPEJKZQD |
View on Explorer |
| Governance | CCKZX4QXV5YJGKHW4NXEFTA4NT7BWXDNX3KR7IFLNLIYOV3FA5EDUUMF |
View on Explorer |
| Reputation | CBSG3H3KH536RDNCG6QTZZXA6TERUDSQCHZNTYDHUONWQ7JWD5AKNEKQ |
View on Explorer |
| Action | Transaction Hash | Verify |
|---|---|---|
| Initialize Governance (ICC link to Reputation) | 8df5c26bdf0c17a5e84c13b284ab1eb03143265219d6e685233eb7356f66bad1 |
Stellar Expert |
| Create Token Gate for Room | c1c9abefb42df52ba284ab1eb03143265219d6e685233eb7356f66bad176e541 |
Stellar Expert |
| Vote on Governance Proposal | 9b13ef0b0e372964ff10848b2f83364bd537a81e3e425f445f661fae8172747b |
Stellar Expert |
veil/
├── .github/workflows/ # CI/CD Workflows
│ ├── ci.yml # CI: Rust tests, lint, frontend tests, build
│ └── deploy.yml # CD: Contract build + Vercel deployment
├── app/ # Next.js App Router
│ ├── api/ # API routes (auth, rooms, messages)
│ ├── chat/ # Chat interface
│ └── layout.tsx # Root layout
├── components/ # React components
│ ├── wallet-connector.tsx # Freighter wallet integration
│ ├── header.tsx # Navigation
│ └── ... # Landing page components
├── contracts/ # Soroban smart contracts (Rust)
│ ├── token_gate/ # Token-gated room access
│ ├── governance/ # DAO voting with ICC to Reputation
│ └── reputation/ # Non-transferable reputation
├── lib/
│ ├── crypto/ # E2E encryption
│ │ ├── encryption.ts # X25519 + AES-GCM
│ │ └── key-manager.ts # IndexedDB key storage
│ ├── hooks/ # React hooks
│ │ └── use-async-action.ts # Async operation hook with retry
│ ├── stellar/ # Stellar integration
│ │ ├── auth.ts # SEP-10 auth
│ │ ├── contracts.ts # Soroban contract interaction
│ │ ├── event-stream.ts # Contract event streaming
│ │ └── payments.ts # Payment helpers
│ ├── supabase/ # Supabase clients
│ ├── error-handler.ts # Structured error handling with retry
│ └── utils.ts # Utility functions
├── scripts/ # Database migrations & contract scripts
│ └── deploy_contracts.sh # Smart contract deployment script
├── vitest.config.ts # Test configuration
└── README.md # Full documentation
┌─────────────────────────────────────────────────────────┐
│ CLIENT (Browser) │
│ ┌─────────┐ ┌──────────┐ ┌───────────────────────┐ │
│ │ Wallet │ │ Chat │ │ Encryption Engine │ │
│ │ Manager │ │ UI │ │ (Web Crypto API) │ │
│ └────┬────┘ └────┬─────┘ └───────────┬───────────┘ │
└───────┼────────────┼─────────────────────┼──────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────┐
│ BACKEND (Node.js) │
│ ┌──────────┐ ┌──────────┐ ┌───────────────────────┐ │
│ │ Auth │ │ Supabase│ │ Soroban Event │ │
│ │ Service │ │ Realtime│ │ Stream Poller │ │
│ └────┬─────┘ └────┬─────┘ └───────────┬───────────┘ │
└───────┼─────────────┼─────────────────────┼─────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────┐
│ INFRASTRUCTURE │
│ ┌────────────┐ ┌──────────┐ ┌─────────────────────┐ │
│ │ Supabase │ │ Stellar │ │ Soroban Contracts │ │
│ │ (Postgres) │ │ Network │ │ (Gate, Gov, Rep) │ │
│ └────────────┘ └──────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────┘
Manages token-gated room access. Admin registers verified token balances, and check_access validates users against minimum thresholds. Emits GATE_NEW, GATE_UPD, GATE_DEL events.
DAO-based moderation. Community members can propose and vote on actions (kick, ban, rule changes). Includes duplicate vote prevention and inter-contract communication (ICC) to Reputation for rewarding successful proposers. Emits PROPOSED, VOTED, EXECUTED events.
Non-transferable reputation tracking. Users earn points for messages and rooms. Includes decay_reputation for penalties, has_min_reputation for gating, and global reputation tracking. Emits AWARDED, DECAYED events.
# Run all frontend tests
pnpm test
# Run with coverage
pnpm vitest run --coverageTest coverage: 23 passing tests across 3 test suites:
lib/utils.test.ts— 8 utility function tests (truncateAddress, formatTime, generateRoomId, formatTipAmount, isValidStellarPublicKey + edge cases)lib/stellar/contracts.test.ts— 10 contract integration tests (mocked RPC)lib/stellar/event-stream.test.ts— 5 event streaming tests
cd contracts
cargo testTest coverage: 14 passing tests across 3 contract suites:
token_gate— 5 tests (access denied/granted, no-gate, update, remove)governance— 4 tests (ICC, duplicate vote, proposals query, majority check)reputation— 5 tests (lifecycle, decay, min-rep, total tracking, multi-user)
Veil implements two event streaming layers:
-
Supabase Realtime — WebSocket channels for live message delivery, filtering by
room_idfor instant chat updates without polling. -
Soroban Event Stream —
SorobanEventStreamclass pollsrpc.Server.getEvents()at 6-second intervals for on-chain governance events (VOTED,EXECUTED,PROPOSED). Events are parsed and dispatched to registered callbacks.
Structured error handling with typed AppErrorCode enum covering 13 error categories (wallet, contract, network, encryption, realtime). Includes:
AppErrorclass with error code, timestamp, and original error trackingwithRetry()utility for exponential backoff with jitteruseAsyncAction()React hook for standardized loading/error/retry state
- Project setup and core infrastructure
- Database schema and migrations
- SEP-10 wallet authentication
- Chat interface with rooms and messaging
- E2E encryption with Web Crypto API
- Soroban smart contracts
- Deploy contracts to testnet
- Token-gated room UI
- DAO governance UI
- Real-time message streaming
- Soroban event streaming
- Structured error handling
- Mobile responsive design
- CI/CD pipeline
- Micropayments and tipping (XLM tip modal)
- Mobile PWA optimization
- Security audit
- Mainnet deployment
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
- Stellar Development Foundation — Blockchain infrastructure
- Soroban — Smart contract platform
- Supabase — Backend-as-a-service
- Freighter — Stellar wallet





