A Telegram bot that enables users to send Bitcoin SV (BSV) tips to each other directly through Telegram messages.
- 💰 Create a BSV wallet automatically when users start the bot
- 📥 Deposit BSV to your bot wallet
- 💸 Tip other Telegram users with BSV
- 💳 Withdraw BSV to external addresses
- 📊 Check your balance
- 🔐 Secure storage of private keys
telegram-bsv-tipbot/
├── src/
│ ├── bot/
│ │ └── TipBot.ts # Main Telegram bot logic
│ ├── blockchain/
│ │ └── BSVWallet.ts # BSV blockchain integration
│ ├── database/
│ │ └── Database.ts # SQLite database handler
│ ├── utils/
│ │ └── formatters.ts # Utility functions
│ └── index.ts # Entry point
├── config/
├── .env.example # Environment variables template
├── package.json
└── tsconfig.json
- Node.js (v18 or higher)
- npm or yarn
- A Telegram Bot Token (get from @BotFather)
- Clone the repository:
git clone <your-repo-url>
cd telegram-bsv-tipbot- Install dependencies:
npm install- Create your
.envfile:
cp .env.example .env- Edit
.envand add your configuration:
TELEGRAM_BOT_TOKEN=your_bot_token_from_botfather
BSV_NETWORK=testnetDevelopment mode (with auto-reload):
npm run devProduction build:
npm run build
npm start/start- Initialize your account and create a wallet/help- Show all available commands/balance- Check your current balance/deposit- Get your deposit address/address- View your BSV address/tip @username amount- Send a tip to another user/withdraw address amount- Withdraw BSV to an external address
- Project structure
- Telegram bot commands
- Database schema
- Wallet generation
- Implement UTXO fetching from WhatsOnChain API
- Implement transaction creation and signing
- Implement transaction broadcasting
- Add balance checking from blockchain
- Add deposit monitoring
- Transaction history command
- Fee estimation
- Multi-signature support
- Rain tips (tip multiple users at once)
- Leaderboard
- Admin panel
For BSV blockchain interaction, you'll need to integrate with a blockchain API service:
WhatsOnChain API (Recommended):
- Testnet:
https://api.whatsonchain.com/v1/bsv/test - Mainnet:
https://api.whatsonchain.com/v1/bsv/main
Key endpoints:
- Get UTXOs:
GET /address/{address}/unspent - Get balance:
GET /address/{address}/balance - Broadcast TX:
POST /tx/raw
-
Private Keys: This bot stores private keys in the database. In production:
- Encrypt private keys at rest
- Use HSM or secure key management service
- Consider using HD wallets
-
Database:
- Secure your database file with proper permissions
- Regular backups
- Consider using encryption at rest
-
Environment Variables:
- Never commit
.envto version control - Use secure secret management in production
- Never commit
-
Network:
- Start on testnet first
- Test thoroughly before mainnet deployment
Run tests:
npm testLint code:
npm run lintContributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
For issues and questions, please open an issue on GitHub.
This bot handles real cryptocurrency. Use at your own risk. Always test thoroughly on testnet before deploying to mainnet. The developers are not responsible for any loss of funds.
Q: What type of project do you want to build? A: telegram chat tip bot that uses bitcoin satoshi vision blockchain as it backend in order to create, sign and broadcast transactions (tips) between telegram users
What's your experience level with JS/TS? A: Intermediate - know the basics5 Great project idea! A Telegram tip bot with Bitcoin SV is a solid intermediate challenge. Let me set you up with a well-structured TypeScript project. Perfect! 🎉 I've created your Telegram BSV Tip Bot project with a solid TypeScript structure. Here's what you have:
📁 Project Structure Core Files:
src/bot/TipBot.ts - All Telegram commands and bot logic src/blockchain/BSVWallet.ts - BSV wallet management (address generation, transactions) src/database/Database.ts - SQLite database for users, transactions, and deposits src/utils/formatters.ts - Helper functions for formatting satoshis/BSV amounts
Key Features Implemented: ✅ All Telegram commands (/start, /balance, /tip, /deposit, /withdraw) ✅ User account creation with automatic BSV wallet generation ✅ Database schema for users, transactions, and deposits ✅ Type-safe TypeScript throughout ✅ Clean separation of concerns (bot, blockchain, database) 🚀 Next Steps
Set up your environment:
Get a bot token from @BotFather Copy .env.example to .env and add your token Run npm install
Implement the blockchain integration (marked with TODOs):
UTXO fetching from WhatsOnChain API Transaction creation and signing Transaction broadcasting Deposit monitoring
Test on testnet first!