A transparent, fully-logged Discord Middleman Bot with real multi-chain crypto escrow.
Inspired by tip.cc and Halal MM β built cleaner, cheaper, and fully open source.
- Features
- Supported Cryptocurrencies
- Fee Structure
- Commands
- How a Deal Works
- Installation
- Configuration
- Self-Hosting
- Security
- Ticket Restoration
- Contributing
- Disclaimer
| Feature | Description |
|---|---|
| π¦ Real On-Chain Escrow | Every deal uses a freshly generated wallet. Funds live on-chain, not in a database. |
| π Both-Party Confirmation | Funds are only released when both the sender and receiver confirm the deal. |
| Either party can open a dispute. Staff can force-release funds to the correct party. | |
| π£ Staff Ping | One-click button to alert staff inside any ticket. |
| π Full Logging | Every action (payment received, confirmation, dispute, force-release) is logged to a Discord channel and the database. |
| π Transcripts | Full ticket transcripts are automatically posted to a transcript channel when a deal closes. |
| β»οΈ Ticket Restoration | If the bot or server is deleted, re-inviting the bot rebuilds all active tickets with full message history replayed via webhooks. |
| π Global Stats & Leaderboard | /stats and /leaderboard track deal counts and USD volume across every server. |
| π Auto Roles | Users automatically receive roles when they hit configurable USD volume thresholds (e.g. $1,000, $10,000). |
| π± 9 Crypto Assets | BTC, ETH, LTC, SOL, USDT & USDC across ERC-20, BEP-20, and Solana. |
| π° Lower Fees | Cheaper than the original β see fee table below. |
| Asset | Network | Symbol |
|---|---|---|
| Bitcoin | Bitcoin | BTC |
| Ethereum | Ethereum (ERC-20) | ETH |
| Litecoin | Litecoin | LTC |
| Solana | Solana | SOL |
| Tether | Ethereum (ERC-20) | USDT |
| USD Coin | Ethereum (ERC-20) | USDC |
| Tether | Solana (SPL) | USDT |
| USD Coin | Solana (SPL) | USDC |
| Tether | BNB Chain (BEP-20) | USDT |
Fees are lower than the original Halal MM Bot.
| Deal Size | Fee |
|---|---|
| $250 and above | 0.75% (original: 1%) |
| $50 β $249.99 | $1.50 flat (original: $2) |
| Under $50 | FREE |
| USDT / USDC | +$0.75 stablecoin surcharge on paid deals (original: $1) |
Example: A $500 ETH deal costs $3.75. A $100 USDT deal costs $1.50 + $0.75 = $2.25.
| Command | Description |
|---|---|
/mm |
Open a new middleman deal via crypto dropdown |
/stats [@user] |
View your total deals and USD volume (or another user's) |
/leaderboard |
Global top 10 traders ranked by USD volume |
/ticket info |
View details about the current ticket |
/ticket transcript |
Manually generate a transcript for the current ticket |
| Command | Description |
|---|---|
/setup |
Configure staff role, completed channel, log channel, and transcript channel |
/panel |
Post the crypto selection panel in the current channel |
/admin stats |
View bot-wide statistics (total deals, volume, active tickets, staff interventions) |
/admin forcerelease <ticket_id> <user> |
Force-release disputed funds to a specific user |
/admin cancel <ticket_id> |
Cancel a ticket |
1. Sender runs /mm or uses the panel dropdown
ββ Selects cryptocurrency
2. Modal appears β sender enters:
ββ Receiver's Discord User ID
ββ Amount to send
3. Bot creates a private ticket channel
ββ Only sender, receiver, and staff can see it
ββ Bot generates a fresh escrow wallet address
ββ Deposit instructions sent with the escrow address
4. Sender sends crypto to the escrow address
ββ Bot polls on-chain every 30 seconds
ββ Payment confirmed automatically
5. Both parties press β
Confirm Deal
ββ Funds are released to receiver on-chain
ββ Deal posted to #completed-deals channel (anonymised)
ββ Full transcript saved to #transcripts
ββ Ticket channel deleted after 30 seconds
ALTERNATIVELY β if something goes wrong:
ββ Either party opens a dispute β οΈ
ββ Staff are pinged automatically
ββ Staff review and use /admin forcerelease
- Node.js v18+ β Download
- A Discord Bot β Discord Developer Portal
- Alchemy or Infura account β for ETH/BSC RPC (free tier works)
- BlockCypher account β for BTC/LTC monitoring (free tier works)
git clone https://github.com/yourusername/Search-mm-bot.git
cd Search-mm-botnpm installcp .env.example .envThen open .env and fill in your values (see Configuration below).
npm startFor development with auto-restart:
npm run devAll configuration is done in .env. Here's what each variable does:
# ββ Discord ββββββββββββββββββββββββββββββββββββββββββ
DISCORD_TOKEN= # Your bot token from Discord Dev Portal
CLIENT_ID= # Your application/client ID
GUILD_ID= # (Optional) Set for instant dev commands in one server
# ββ Security βββββββββββββββββββββββββββββββββββββββββ
ENCRYPTION_KEY= # 32+ char random string β encrypts all private keys
# Generate: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
# ββ RPC Providers βββββββββββββββββββββββββββββββββββββ
ETH_RPC= # Alchemy or Infura Ethereum endpoint
BSC_RPC= # BNB Chain RPC (default: public Binance node)
SOL_RPC= # Solana RPC (default: public mainnet endpoint)
# ββ BTC / LTC Monitoring ββββββββββββββββββββββββββββββ
BLOCKCYPHER_TOKEN= # Free at blockcypher.com β used to check BTC/LTC balances
# ββ Network βββββββββββββββββββββββββββββββββββββββββββ
NETWORK=mainnet # mainnet or testnet| Key | Where to Get It |
|---|---|
DISCORD_TOKEN |
Discord Dev Portal β Your App β Bot β Reset Token |
CLIENT_ID |
Dev Portal β Your App β General Information β Application ID |
ETH_RPC |
Alchemy β Create App β Ethereum β Mainnet β API Key |
BLOCKCYPHER_TOKEN |
BlockCypher β Register free |
ENCRYPTION_KEY |
Run the command in the comment above β generate it yourself |
- Go to Discord Developer Portal
- Create a new application β go to Bot tab
- Enable Message Content Intent under Privileged Gateway Intents
- Go to OAuth2 β URL Generator
- Scopes:
bot,applications.commands - Bot Permissions:
Manage ChannelsManage WebhooksManage RolesSend MessagesEmbed LinksRead Message History
- Scopes:
- Copy the generated URL and invite the bot to your server
After inviting the bot, run in your server:
/setup
staff_role: @YourStaffRole
completed_channel: #completed-deals
log_channel: #mm-logs
transcript_channel: #transcripts
Then post the deal panel somewhere visible:
/panel
To grant roles based on deal volume, add entries to the role_thresholds table in data/mm.db:
INSERT INTO role_thresholds (guild_id, min_usd, role_id)
VALUES ('YOUR_GUILD_ID', 1000, 'ROLE_ID_FOR_1K'),
('YOUR_GUILD_ID', 10000, 'ROLE_ID_FOR_10K'),
('YOUR_GUILD_ID', 50000, 'ROLE_ID_FOR_50K');- Private keys are never stored in plaintext. Every escrow wallet's key is encrypted with AES-256-GCM before being written to the database.
- The
ENCRYPTION_KEYis your master secret. If it is lost, no escrow funds can be recovered. Store it somewhere safe (e.g. a password manager or secret vault). - Back up
data/mm.dbregularly. It contains all deal data, messages, and encrypted keys. - Escrow wallets are single-use. A fresh address is generated per deal β no address reuse.
- The bot never logs or prints private keys in plaintext under any condition.
β οΈ For production deployments with high volume, consider hardware key storage (HSM) or a secrets manager like HashiCorp Vault.
If your server is deleted or the bot is kicked and re-invited:
- Re-invite the bot with the same token (or a new bot pointed at the same database)
- The bot detects all active tickets on
guildCreate - It automatically creates a β»οΈ Restored Tickets category
- Each active ticket gets a new channel with all previous messages replayed via webhook β with original author names and avatars intact
- Deals continue exactly where they left off
This means no deal is ever lost due to a server or bot issue.
Search-mm-bot/
βββ src/
β βββ index.js # Bot entry point β client setup and interaction router
β βββ commands.js # All slash command definitions
β βββ database.js # SQLite schema and prepared statement queries
β βββ fees.js # Crypto definitions and fee calculator
β βββ prices.js # Live prices via CoinGecko (no API key needed)
β βββ wallets.js # Multi-chain address generation, balance checks, fund forwarding
β βββ monitor.js # On-chain payment polling for active tickets
β βββ ticketHandler.js # Full ticket lifecycle (create, confirm, dispute, force-release)
β βββ embeds.js # All Discord embed builders
β βββ logger.js # Event logging to DB + Discord channel
β βββ restore.js # Ticket channel restoration via webhooks
β βββ roles.js # Auto role assignment on volume milestones
βββ data/
β βββ mm.db # SQLite database (auto-created on first run)
βββ .env.example
βββ package.json
βββ README.md
Pull requests are welcome. For major changes, please open an issue first.
- Fork the repo
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m 'Add my feature' - Push:
git push origin feature/my-feature - Open a pull request
MIT β see LICENSE for details.
Read carefully before using this project.
This project is released as-is, for educational and personal use only.
- I will not help you set up this bot
- I will not help you configure it
- I will not provide support, troubleshooting, or guidance of any kind
- If you do not have the technical knowledge to run this independently, do not touch it
By cloning or running this software you acknowledge that you do so entirely at your own risk. I hold no liability for anything that happens to your Discord accounts, bots, servers, funds, or any third-party services as a result of using this project. This software handles real cryptocurrency β misconfiguration, misuse, or unexpected behaviour could result in financial loss or the permanent termination of your Discord account.
Do not open issues asking for help. They will be closed without response.
Built with β€οΈ for transparent, trustless trading.
If this helped you, consider starring the repo β
