Phase 1 (Wallet System) ✅ and Phase 2 (Smart Contracts) ✅ have been successfully implemented. The platform now provides a complete blockchain infrastructure for DAO creation, management, and treasury operations.
- Automatic Wallet Generation: Each Telegram user gets a unique Web3 wallet
- Secure Storage: Private keys encrypted with AES-256 and stored in Firebase Firestore
- Transaction Signing: Ready for on-chain interactions
- Telegram Integration: Seamless bot commands for wallet management
- DAOFactory Contract: Create and manage DAO instances with vault registry
- DAO Contract: Full proposal and voting system with member management
- Vault System: Modular treasury management with multi-signature support
- VaultFactory Contract: Automated vault creation with configurable parameters
- Deployment Infrastructure: Complete deployment and verification system
- Security Framework: OpenZeppelin integration with comprehensive protections
/start- Create your Web3 wallet (< 2s creation time)/wallet- View your wallet information/help- Show available commands
Telegram Bot (Telegraf.js)
↓
Wallet Service (ethers.js) ←→ Smart Contracts (Arbitrum)
↓ ↓
Firebase Firestore DAOFactory & VaultFactory
(Encrypted Storage) ↓
DAO & Vault Instances
-
TelegramBotService (
src/services/TelegramBotService.ts)- Handles all Telegram interactions
- Command processing and user management
- Integration with wallet and Firebase services
-
WalletService (
src/services/WalletService.ts)- Web3 wallet creation and management
- Secure transaction signing
- Integration with ethers.js
-
FirebaseService (
src/services/FirebaseService.ts)- Encrypted data storage and retrieval
- User wallet mapping
- Secure key management
-
DAOFactory Contract (
contracts/DAOFactory.sol)- DAO creation and management
- Vault registry system
- User DAO tracking
-
DAO Contract (
contracts/DAO.sol)- Proposal and voting system
- Member management
- Vault attachment capabilities
-
Vault System (
contracts/Vault.sol+VaultFactory.sol)- Treasury management
- Multi-signature operations
- Spending proposals
-
Contract Configuration (
src/config/contracts.ts)- Contract addresses and ABIs
- Network configurations
- Integration constants
src/
├── services/
│ ├── WalletService.ts # Web3 wallet creation & management
│ ├── FirebaseService.ts # Firestore database operations
│ └── TelegramBotService.ts # Telegram bot interactions
├── config/
│ └── contracts.ts # Smart contract configurations
└── index.ts # Main application entry point
contracts/
├── DAOFactory.sol # DAO creation and management
├── DAO.sol # Proposal and voting system
├── Vault.sol # Treasury management
└── VaultFactory.sol # Vault creation system
- Node.js 18+ and npm
- Firebase project with Firestore enabled
- Telegram Bot Token from @BotFather
-
Clone and install dependencies:
cd /Users/ibitcoinist/Documents/Blockchain/deffy npm install -
Configure environment variables:
cp .env.example .env
Edit
.envwith your configuration:# Telegram Bot Configuration TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here # Firebase Configuration FIREBASE_PROJECT_ID=your_firebase_project_id FIREBASE_PRIVATE_KEY=your_firebase_private_key FIREBASE_CLIENT_EMAIL=your_firebase_client_email # Security ENCRYPTION_SALT=your_encryption_salt_here
-
Build and run:
npm run build npm start
Or for development:
npm run dev
- AES-256 Encryption: Private keys encrypted using industry-standard encryption
- Key Derivation: Encryption key derived from Telegram ID + application salt
- No Plaintext Storage: Private keys never stored in plaintext
- One-time Backup: Private key shown only once during wallet creation
- Firebase Security Rules: Firestore configured with proper access controls
- Environment Variables: Sensitive data stored in environment variables
- Error Handling: Comprehensive error handling without exposing sensitive data
- ✅ Wallet Creation: < 2 seconds
- ✅ Bot Response Time: < 1 second for most commands
- ✅ Secure Storage: Encrypted data storage in Firestore
- ✅ Error Recovery: Graceful error handling and user feedback
- Node.js 18+
- npm or yarn
- Telegram Bot Token
- Firebase Project
- Alchemy API Key
- Deployer wallet with ETH for gas
-
Clone and Install
git clone <repository-url> cd telegram-dao-platform npm install
-
Environment Setup
cp .env.example .env # Edit .env with your configuration -
Compile Smart Contracts
npm run compile
-
Run Tests
npm run test -
Deploy Contracts
# Deploy to Arbitrum Mainnet npm run deploy:arbitrum # Deploy to Arbitrum Sepolia (testnet) npm run deploy:arbitrum-sepolia # Deploy to Ethereum Sepolia (testnet) npm run deploy:ethereum-sepolia # Deploy to local Hardhat network npm run deploy:local
-
Build and Start Bot
npm run build npm run start
- Advanced command routing
- Group vs private chat handling
- Command validation and permissions
/create_daocommand implementation/proposecommand for proposal creation- Inline voting with callback handlers
- Vault attachment and management
npm run dev # Start development server with hot reload
npm run build # Build TypeScript to JavaScript
npm start # Start production server
npm run compile # Compile smart contracts
npm run deploy:arbitrum # Deploy contracts to Arbitrum Mainnet
npm run deploy:arbitrum-sepolia # Deploy contracts to Arbitrum Sepolia
npm run deploy:ethereum-sepolia # Deploy contracts to Ethereum Sepolia
npm run deploy:local # Deploy contracts to local Hardhat network
npm test # Run tests.
├── src/ # TypeScript source code
│ ├── services/ # Core services
│ └── index.ts # Application entry point
├── contracts/ # Solidity contracts (Phase 2)
├── scripts/ # Deployment scripts (Phase 2)
├── test/ # Test files
├── .env.example # Environment variables template
├── hardhat.config.ts # Hardhat configuration
├── package.json # Dependencies and scripts
└── tsconfig.json # TypeScript configuration
- Arbitrum Mainnet: Production deployment
- Arbitrum Sepolia: Arbitrum testnet for testing
- Ethereum Sepolia: Ethereum testnet for testing
- Hardhat Local: Local development network
- RPC Provider: Alchemy
- Database: Firebase Firestore
- Bot Framework: Telegraf.js
- ✅ Wallet created < 2s and securely stored
- ✅ AES-256 encryption implementation
- ✅ Firebase Firestore integration
- ✅ Telegram bot fully functional
- ✅ Transaction signing capability ready
- ✅ Error handling and user feedback
- ✅ Graceful application lifecycle management
This project follows a phased development approach. Currently in Phase 1 (Wallet System). Each phase builds upon the previous one to create a comprehensive DAO platform.
MIT License - see LICENSE file for details.
Next Phase: Smart contract development and deployment (Phase 2)
Contact: For support or questions about the Telegram DAO Platform