A decentralized savings and group management platform with 100% gasless transactions. Users can register, create groups, and manage funds without ever paying gas fees or signing blockchain transactions.
- No gas fees ever - Backend pays all blockchain costs
- No transaction signing - Seamless Web2-like experience
- No crypto needed - Just an email address to get started
- Backend-subsidized - All smart contract interactions are free for users
- Email Registration - Passwordless authentication via Thirdweb
- Wallet Registration - Connect with existing EOA wallets
- Automatic Wallets - Get 2 smart contract wallets (main + savings)
- Balance Tracking - Real-time balance updates
- Create Groups - Start savings groups with pool addresses
- Join Groups - One-click join with role-based access
- Pool Management - Smart contract-managed group funds
- Member Management - Admin/member roles with permissions
- Smart Contract Wallets - Non-custodial user wallets
- Private Key Encryption - Secure storage of credentials
- JWT Authentication - Industry-standard auth
- Rate Limiting - Protection against abuse
Saiv/
├── backend/ # Node.js Express API
│ ├── src/
│ │ ├── controllers/ # Request handlers
│ │ ├── models/ # MongoDB schemas
│ │ ├── routes/ # API endpoints
│ │ ├── services/ # Business logic
│ │ │ └── gaslessService.js # 🌟 Gasless transaction handler
│ │ └── middleware/ # Auth & validation
│ ├── README.md # Backend documentation
│ └── GASLESS_TRANSACTIONS.md # Gasless guide
│
├── contract/ # Smart Contracts (Solidity)
│ ├── contracts/
│ │ ├── AddressManager.sol # Main contract
│ │ ├── UserWallet.sol # User wallet contract
│ │ └── GroupPool.sol # Group pool contract
│ ├── scripts/
│ │ └── deploy.js # Deployment script
│ ├── hardhat.config.js # Network configuration
│ └── DEPLOYMENT.md # Deployment guide
│
└── frontend/ # Frontend (TBD)
- Node.js v18+ and npm
- MongoDB (local or Atlas)
- Git
git clone <repository-url>
cd Saivcd contract
npm install
# Create .env file
cp .env.example .env
# Generate a deployer wallet
node -e "const ethers = require('ethers'); const w = ethers.Wallet.createRandom(); console.log('Address:', w.address, '\nPrivate Key:', w.privateKey);"
# Add private key to .env
# PRIVATE_KEY=0x...
# Get testnet funds from faucet
# Visit: https://sepolia-faucet.lisk.com
# Deploy to Lisk Sepolia testnet
npx hardhat run scripts/deploy.js --network liskSepoliaCopy the deployed contract address!
cd ../backend
npm install
# Create .env file
cp .env.example .env
# Edit .env with your values:
# - MongoDB connection string
# - JWT secret (random 32+ character string)
# - RPC_URL (use Lisk Sepolia: https://rpc.sepolia-api.lisk.com)
# - ADMIN_PRIVATE_KEY (generate a NEW wallet for backend)
# - ADDRESS_MANAGER_CONTRACT (from step 2)Generate Backend Wallet:
node -e "const ethers = require('ethers'); const w = ethers.Wallet.createRandom(); console.log('Backend Wallet\nAddress:', w.address, '\nPrivate Key:', w.privateKey);"Fund Backend Wallet:
- Visit: https://sepolia-faucet.lisk.com
- Send testnet LSK to your backend wallet address
# Start MongoDB (if local)
mongod
# In another terminal, start backend
npm run devYou should see:
✅ GASLESS SERVICE ENABLED - Users pay NO gas fees
- Registration: FREE (backend pays gas)
- Create Group: FREE (backend pays gas)
- Join Group: FREE (backend pays gas)
Backend wallet balance: 5.0 LSK
Server is running on port 3001
# Check health
curl http://localhost:3001/api/health
# Check gasless status
curl http://localhost:3001/api/gas/status
# Register a user (GASLESS!)
curl -X POST http://localhost:3001/api/auth/register/email \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'# Register with Email (FREE - Backend pays gas)
POST /api/auth/register/email
Body: { "email": "[email protected]" }
# Register with Wallet (FREE - Backend pays gas)
POST /api/auth/register/wallet
Body: { "eoaAddress": "0x..." }
# Get Profile
GET /api/auth/profile
Headers: { "Authorization": "Bearer <token>" }# Create Group (FREE - Backend pays gas)
POST /api/groups
Headers: { "Authorization": "Bearer <token>" }
Body: {
"name": "Monthly Savings",
"description": "Save $100/month",
"paymentWindowDuration": 2592000
}
# Get User's Groups
GET /api/groups
Headers: { "Authorization": "Bearer <token>" }
# Get Group Details
GET /api/groups/:groupId
Headers: { "Authorization": "Bearer <token>" }
# Join Group (FREE - Backend pays gas)
POST /api/groups/:groupId/join
Headers: { "Authorization": "Bearer <token>" }# Get Balance
GET /api/wallet/balance
Headers: { "Authorization": "Bearer <token>" }
# Send ETH
POST /api/wallet/send-eth
Headers: { "Authorization": "Bearer <token>" }
Body: { "to": "0x...", "amount": "0.1" }
# Get Token Balance
GET /api/wallet/token-balance?tokenAddress=0x...
Headers: { "Authorization": "Bearer <token>" }# Check Gasless Status (Public)
GET /api/gas/status
# Get Backend Wallet Balance (Auth Required)
GET /api/gas/backend-wallet
Headers: { "Authorization": "Bearer <token>" }
# Get Gas Estimates (Public)
GET /api/gas/estimates┌─────────────┐
│ User │
│ (Email Only)│
└──────┬──────┘
│ 1. Register/Create Group
▼
┌─────────────────┐
│ Backend API │
│ (Express.js) │
└──────┬──────────┘
│ 2. Validate Request
▼
┌─────────────────┐
│ Gasless Service │ ← Backend Wallet
│ (Backend Pays) │ (Pays Gas)
└──────┬──────────┘
│ 3. Execute Transaction
▼
┌─────────────────┐
│ Smart Contract │
│ (AddressManager)│
└──────┬──────────┘
│ 4. Create Wallet/Pool
▼
┌─────────────────┐
│ Blockchain │
│ (Lisk Network) │
└─────────────────┘
- User registers with email → Backend creates 2 smart contract wallets
- Backend pays gas for wallet deployment
- User creates group → Backend deploys pool contract
- Backend pays gas again
- User never pays or signs anything!
- Free testnet tokens from faucet
- Perfect for development and testing
- Same functionality as mainnet
| Operation | Gas Cost | USD Cost* |
|---|---|---|
| User Registration | ~0.0005 LSK | ~$0.0006 |
| Create Group | ~0.001 LSK | ~$0.0012 |
| Join Group | ~0.0002 LSK | ~$0.0002 |
*Based on LSK = $1.20
Monthly Cost Examples:
- 1,000 users register: ~$0.60
- 500 groups created: ~$0.60
- 5,000 joins: ~$1.00
- Total: ~$2.20/month for 1,000+ active users
| Network | User Registration | Group Creation | Monthly Cost (1K users) |
|---|---|---|---|
| Lisk | $0.0006 | $0.0012 | $2.20 ✅ |
| Polygon | $0.01 | $0.02 | $30 |
| Ethereum | $40 | $67 | $40,000 ❌ |
Winner: Lisk! 🏆
- Framework: Express.js
- Database: MongoDB + Mongoose
- Authentication: JWT + Web3Auth
- Blockchain: Ethers.js v6
- Security: Helmet, CORS, Express-validator
- Language: Solidity 0.8.19
- Framework: Hardhat
- Network: Lisk (Sepolia & Mainnet)
- Pattern: Minimal Proxy (Clones) for gas optimization
- React.js / Next.js
- Web3Auth integration
- TailwindCSS
- ✅ Minimal proxy pattern for gas efficiency
- ✅ Owner-based access control
- ✅ Event logging for transparency
- ✅ Tested and audited code
- ✅ JWT authentication
- ✅ Private key encryption
- ✅ Input validation
- ✅ Rate limiting ready
- ✅ Environment variable security
- ✅ Non-custodial (users own their wallets)
- ✅ Smart contract wallets with recovery
- ✅ Main + Savings wallet separation
- ✅ Multi-token support
- Backend README - Backend API documentation
- Gasless Transactions Guide - How gasless works
- Deployment Guide - Smart contract deployment
- Hardhat Config - Network configurations
Groups use a unique identifier format:
{userMainWalletAddress}_{timestamp}
Example:
0x742d35Cc6634C0532925a3b8D0Ed62FDa2c0e7A6_1697123456789
Benefits:
- ✅ Globally unique
- ✅ Traceable to creator
- ✅ Time-ordered
- ✅ Query-friendly
- ✅ Lisk Sepolia (Testnet) - Chain ID: 4202
- ✅ Lisk Mainnet - Chain ID: 1135
- ⚡ Polygon Mumbai (Testnet) - Chain ID: 80001
- ⚡ Polygon Mainnet - Chain ID: 137
- ❌ Ethereum Mainnet (too expensive)
# Terminal 1: MongoDB
mongod
# Terminal 2: Backend
cd backend
npm run dev
# Terminal 3: Test API
curl http://localhost:3001/api/healthcd contract
npx hardhat run scripts/deploy.js --network liskSepolia# Update backend/.env with contract address
ADDRESS_MANAGER_CONTRACT=0xYourDeployedAddress# Register user (FREE)
curl -X POST http://localhost:3001/api/auth/register/email \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'
# Create group (FREE)
curl -X POST http://localhost:3001/api/groups \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "Test Group"}'- Check
ADMIN_PRIVATE_KEYin backend.env - Ensure backend wallet has LSK balance
- Verify
ADDRESS_MANAGER_CONTRACTis correct
- Backend wallet needs LSK tokens
- Get from: https://sepolia-faucet.lisk.com (testnet)
- Check balance:
GET /api/gas/backend-wallet
- Verify
RPC_URLin backend.env - Check internet connection
- Try alternative RPC endpoint
- Check deployer wallet balance
- Verify network in hardhat.config.js
- Compile contracts:
npx hardhat compile
curl http://localhost:3001/api/gas/backend-wallet \
-H "Authorization: Bearer <token>"curl http://localhost:3001/api/gas/estimatescurl http://localhost:3001/api/gas/status- Docs: https://docs.lisk.com
- Faucet: https://sepolia-faucet.lisk.com
- Explorer: https://sepolia-blockscout.lisk.com
- RPC: https://rpc.sepolia-api.lisk.com
- Hardhat: https://hardhat.org
- Ethers.js: https://docs.ethers.org
- Express: https://expressjs.com
- MongoDB: https://mongodb.com
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
ISC
Built with:
- ❤️ Love for Web3
- ⚡ Powered by Lisk
- 🚀 Express.js
- 📦 Hardhat
- 🔐 Ethers.js
- Create savings goals
- Track progress
- Automated deposits
- Community savings circles
- Rotating savings
- Social accountability
- Joint savings accounts
- Emergency funds
- Goal-based savings
- Pool resources
- Collective investing
- Transparent management
- Backend API with gasless transactions
- Smart contract deployment to Lisk
- User registration (email & wallet)
- Group creation and management
- Frontend application
- Mobile app (React Native)
- Advanced savings features
- Analytics dashboard
- Multi-currency support
- Automated contributions
- Issues: GitHub Issues
- Docs: See
/backendand/contractfolders - Community: Coming soon
Built for the people, powered by Lisk 🌍
Made with 💚 by the Saiv Team