Mezo Hackathon Submission - Enabling Bitcoin holders to transact with USD stability using Mezo's smart account abstraction
MUSD is a stablecoin payment system built on Mezo that enables Bitcoin holders to transact with USD-pegged tokens without leaving the Bitcoin ecosystem. Users sign transactions with their Bitcoin wallet through Mezo Passport, while smart accounts execute ERC-20 token transfers on Matsnet.
- Bitcoin's volatility makes it impractical for everyday payments
- Merchants need price stability but want Bitcoin exposure
- Converting BTC to stablecoins requires leaving the Bitcoin ecosystem
- Traditional stablecoins don't integrate with Bitcoin wallets natively
MUSD leverages Mezo's account abstraction to bridge Bitcoin wallets with stablecoin functionality:
- Connect with Bitcoin Wallet - Users authenticate using their existing Bitcoin wallet via Mezo Passport
- Smart Account Abstraction - Mezo creates a smart account that executes transactions on behalf of the Bitcoin wallet
- Sign with Bitcoin, Transact with Stablecoins - Users sign with their Bitcoin wallet, smart account executes MUSD transfers
- Merchant Integration - Payment service enables easy merchant adoption with USD-stable settlement
- ERC-20 MUSD token contract deployed on Matsnet
- Comprehensive test suite with Hardhat
- Deployment scripts for Matsnet network
- Located in
/soliditydirectory
- Modern React 19 + TypeScript + Vite application
- Mezo Passport Integration (
@mezo-org/passport@0.12.0)useBitcoinAccount()- Bitcoin wallet connection and balanceuseSendTransaction()- Transaction signing and executionuseWalletInfo()- Unified wallet information display
- Wagmi + Viem for Ethereum interactions
- Tailwind CSS for responsive UI
- Custom hooks for MUSD transfers (
useSendMUSD)
- Node.js + Express API for merchant integration
- Transaction monitoring and webhook support
- Payment link generation
- Invoice management
- π Complete deployment guides (Vercel, Railway, Boar Network, Spectrum)
- π Quick start guide (5-minute local setup)
- π Troubleshooting documentation
- π System architecture overview in
/docs
- Vercel deployment configuration
- Railway backend hosting setup
- Environment variable management
- CI/CD pipeline ready
Mezo Integration:
// Bitcoin wallet authentication
const { btcAddress, btcBalance } = useBitcoinAccount()
// Send MUSD with Bitcoin wallet signature
const { sendTransaction } = useSendTransaction()
const hash = await sendTransaction(
MUSD_TOKEN_ADDRESS, // to
0n, // value
encodedTransferData // data
)Key Features:
- β Bitcoin wallet-based authentication (no seed phrases!)
- β Smart account abstraction for gasless transactions
- β ERC-20 token transfers signed by Bitcoin wallets
- β Real-time balance tracking (Bitcoin + Matsnet)
- β Merchant payment integration
- β Production deployment infrastructure
- Node.js 18+ and pnpm
- Bitcoin wallet (for testing with Mezo Passport)
- Matsnet testnet access
# Install dependencies
pnpm install --frozen-lockfile
# Install smart contract dependencies
cd solidity
pnpm install --frozen-lockfile
cd ..
# Set up environment variables
cp .env.example .env
# Edit .env with your configuration
# Run development server
pnpm devVisit http://localhost:5173 to see the dApp.
cd solidity
cp .env.example .env
# Add your private key and RPC URL
pnpm run deploy --network matsnetβββββββββββββββββββ
β Bitcoin Wallet β (User's existing wallet)
ββββββββββ¬βββββββββ
β Signs transactions
βΌ
βββββββββββββββββββ
β Mezo Passport β (Account abstraction SDK)
ββββββββββ¬βββββββββ
β Creates & manages
βΌ
βββββββββββββββββββ
β Smart Account β (On Matsnet)
ββββββββββ¬βββββββββ
β Executes
βΌ
βββββββββββββββββββ
β MUSD Contract β (ERC-20 on Matsnet)
βββββββββββββββββββ
Flow:
- User connects Bitcoin wallet via Mezo Passport
- Mezo creates a smart account on Matsnet
- User initiates MUSD transfer in dApp
- dApp encodes ERC-20 transfer call
- User signs with Bitcoin wallet
- Smart account executes transfer on Matsnet
- MUSD tokens transferred, transaction confirmed
- Solidity - Smart contract development
- Hardhat - Development environment
- OpenZeppelin - Contract libraries
- Matsnet - Mezo testnet deployment
- React 19 - UI framework
- TypeScript - Type safety
- Vite - Build tool & dev server
- Mezo Passport SDK - Bitcoin wallet integration
- Wagmi - Ethereum interactions
- Viem 2.22.8 - Ethereum utilities
- Tailwind CSS - Styling
- Node.js - Runtime
- Express - API framework
- TypeScript - Type safety
- Vercel - Frontend hosting
- Railway - Backend hosting
- pnpm - Package management
- ESLint + Prettier - Code quality
- π Bitcoin Wallet Authentication - Use your existing Bitcoin wallet, no new accounts
- π° USD Stability - Transact with price-stable MUSD tokens
- β‘ Instant Transfers - Fast transactions on Matsnet
- π Self-Custody - Maintain control of your Bitcoin wallet
- π± Simple UX - Connect wallet, send MUSD, done
- π΅ USD Settlement - Accept Bitcoin-backed payments with no volatility
- π Easy Integration - REST API and payment links
- π Real-Time Tracking - Monitor transactions and balances
- π Global Reach - Accept payments from Bitcoin holders worldwide
- πΈ Low Fees - Cheaper than traditional payment processors
- π Comprehensive Docs - Detailed guides and API documentation
- π οΈ Modern Stack - React, TypeScript, Vite, Mezo SDK
- π§ͺ Test Suite - Smart contract tests with Hardhat
- π Easy Deployment - One-click Vercel + Railway setup
- π§ Extensible - Clean architecture for adding features
- Smart contracts deployed on Matsnet
- Mezo Passport integration (Bitcoin wallet auth)
- React dApp with MUSD transfer functionality
- Payment service backend
- Comprehensive deployment documentation
- Production deployment infrastructure
- Custom hooks for wallet and transaction management
- Responsive UI with Tailwind CSS
- Vercel production deployment (build in progress)
- Merchant dashboard
- Payment plugin integrations (WooCommerce, Shopify)
Q1 2025 - MVP Launch
- Complete production deployment
- Onboard 10-20 beta merchants
- Process first $10K in transactions
- User feedback and UX iteration
Q2 2025 - Mainnet & Growth
- Deploy to Mezo mainnet
- Onboard 100+ merchants
- Multi-currency support (MEUR, MGBP)
- Reach $100K monthly volume
Q3 2025 - Scale & Features
- Recurring payments & subscriptions
- Mobile app (React Native)
- Point-of-sale integrations
- 1,000+ merchants, $1M monthly volume
Q4 2025 - Enterprise
- Enterprise API
- Multi-signature support
- Compliance & reporting tools
- 10,000+ merchants, $10M monthly volume
MUSD is the first stablecoin that lets you sign transactions with a Bitcoin wallet.
Thanks to Mezo's account abstraction:
- β No seed phrase management
- β No new wallet setup
- β No leaving the Bitcoin ecosystem
- β Just your existing Bitcoin wallet controlling USD-stable value
For Bitcoin Holders: Spend with USD stability while maintaining Bitcoin wallet custody
For Merchants: Accept Bitcoin-backed payments with USD price stability and instant settlement
For the Ecosystem: Brings Bitcoin liquidity to stablecoin use cases, enabling Bitcoin to compete with traditional payment rails
- π Deployment Quick Reference
- π Vercel Deployment Guide
- π» Quick Start Guide
- π Troubleshooting Guide
- π Complete Documentation Index
- ποΈ System Architecture
- Vercel + Railway: $0-5/month (dev), $40-70/month (prod)
- Boar Network: $5/month + custom pricing (premium)
- Spectrum Enterprise: $250-400/month (99.9% SLA)
cd solidity
pnpm testpnpm testWe welcome contributions! Please see our contributing guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Install pre-commit
brew install pre-commit
# Install hooks
pre-commit install
# Run manually
pre-commit run --all-filesThis project is licensed under the MIT License - see the LICENSE file for details.
- Repository: https://github.com/fapulito/musd
- Mezo: https://mezo.org/
- Matsnet Explorer: https://matsnet.mezo.org/
- Documentation: docs/
This project was built for the Mezo Hackathon, demonstrating:
- Deep Mezo Integration - Extensive use of Mezo Passport SDK for Bitcoin wallet authentication and smart account transactions
- Production-Ready Code - Comprehensive testing, documentation, and deployment infrastructure
- Real-World Use Case - Solving actual problems for Bitcoin holders and merchants
- Technical Excellence - Modern stack, clean architecture, type safety, and best practices
- Complete Solution - Smart contracts, frontend, backend, and deployment all working together
- β Bitcoin wallet authentication via Mezo Passport
- β Smart account abstraction for gasless transactions
- β
Custom hooks leveraging Mezo SDK (
useBitcoinAccount,useSendTransaction) - β Matsnet deployment with comprehensive guides
- β Bitcoin-native UX (sign with BTC wallet, execute on Matsnet)
Built with β€οΈ for the Mezo ecosystem
Enabling Bitcoin to power the future of payments