The most advanced platform for continuous Bitcoin payments. Built on Stacks for secure, programmable money flows.
BitPay revolutionizes how Bitcoin payments are made by introducing streaming payments - the ability to send Bitcoin continuously over time rather than in traditional lump sums. Think "Netflix for Money" - just as Netflix streams video content continuously, BitPay streams Bitcoin payments continuously.
BitPay leverages sBTC (Stacks Bitcoin), a 1:1 Bitcoin-pegged token on the Stacks blockchain, enabling:
- True Bitcoin streams with smart contract programmability
- Instant finality for payment calculations
- Lower fees compared to direct Bitcoin transactions
- Enterprise-grade security with Bitcoin's underlying security model
- Create Bitcoin Streams: Set up continuous payments over any time period
- Real-time Claiming: Recipients can claim available funds at any block
- Pause/Resume: Senders can pause and resume streams as needed
- Stream Cancellation: Early termination with automatic refunds
- Role-based Access Control: Multi-tiered permission system
- Emergency Controls: Circuit breakers for critical situations
- Audit Trail: Complete transaction history and event logging
- Chainhook Integration: Real-time blockchain event monitoring
- Fee Management: Configurable fee structures for sustainability
- Treasury Controls: Secure fee collection and management
- Analytics Integration: Comprehensive usage and performance metrics
- Multi-wallet Support: Connect and manage multiple Bitcoin wallets
┌─────────────────────────────────────────────────────────────┐
│ BitPay Smart Contracts │
├─────────────────────────────────────────────────────────────┤
│ 📋 Access Control │ 💰 Core Streams │ 🏛️ Treasury │
│ - Role management │ - Stream logic │ - Fee collection │
│ - Permissions │ - Calculations │ - Fund management│
│ - Admin controls │ - State tracking │ - Distribution │
├─────────────────────────────────────────────────────────────┤
│ 🚨 Emergency │ 📊 Analytics │ 🔗 sBTC Integra.│
│ - Circuit breakers │ - Usage metrics │ - Token interface│
│ - Emergency stops │ - Reporting │ - Balance checks │
│ - Recovery modes │ - Statistics │ - Transfers │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ BitPay Frontend │
├─────────────────────────────────────────────────────────────┤
│ 🏠 Landing Page │ 📊 Dashboard │ 👤 Auth System │
│ - Hero section │ - Stream overview │ - Wallet connect │
│ - Features showcase │ - Analytics view │ - User profiles │
│ - How it works │ - Create streams │ - Session mgmt │
├─────────────────────────────────────────────────────────────┤
│ 💳 Stream Management │ ⚙️ Settings │ 📱 Responsive UI │
│ - Create streams │ - Preferences │ - Mobile first │
│ - Claim payments │ - Wallet mgmt │ - Modern design │
│ - Pause/Resume │ - Security opts │ - Animations │
└─────────────────────────────────────────────────────────────┘
- Node.js 18+ and npm
- Clarinet CLI for smart contract development
- Stacks Wallet for blockchain interaction
git clone https://github.com/your-org/bitpay.git
cd bitpaycd contract
npm install
# Run tests
npm test
# Deploy to testnet (requires wallet setup)
clarinet deployments apply --testnetcd ../frontend
npm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your configuration
# Run development server
npm run dev- Frontend: http://localhost:3000
- Smart contracts: See deployment output for contract addresses
contracts/
├── bitpay-core.clar # Main streaming logic
├── bitpay-access-control.clar # Permission management
├── bitpay-treasury.clar # Fee and fund management
├── bitpay-emergency.clar # Emergency controls
├── bitpay-analytics.clar # Usage tracking
└── bitpay-sbtc-integration.clar # sBTC token interface
;; Create a new Bitcoin stream
(create-stream recipient total-amount duration-blocks start-delay metadata)
;; Claim available streaming funds
(claim-stream stream-id)
;; Pause/resume stream management
(pause-stream stream-id)
(resume-stream stream-id)
;; Cancel stream with refunds
(cancel-stream stream-id)# Run all smart contract tests
npm test
# Run specific contract tests
npm test -- tests/bitpay-core.test.ts
# Generate test coverage report
npm run test:report- Framework: Next.js 14 with App Router
- Styling: Tailwind CSS + Radix UI components
- State Management: React hooks + Context API
- Blockchain: Stacks.js for wallet integration
- Database: MongoDB with Mongoose ODM
- Authentication: NextAuth.js with wallet-based auth
// Stream creation
import { CreateStreamModal } from '@/components/dashboard/modals/CreateStreamModal'
// Stream management
import { StreamDetailsModal } from '@/components/dashboard/modals/StreamDetailsModal'
// Wallet integration
import { useAuth } from '@/hooks/use-auth'api/
├── auth/
│ ├── login/ # User authentication
│ ├── register/ # User registration
│ └── wallet/ # Wallet connection
├── streams/ # Stream CRUD operations
├── analytics/ # Usage statistics
└── wallets/ # Wallet management
- Access Control:
ST2F3J1PK46D6XVRBB9SQ66PY89P8G0EBDW5E05M7.bitpay-access-control - Core Streams:
ST2F3J1PK46D6XVRBB9SQ66PY89P8G0EBDW5E05M7.bitpay-core - Network: Stacks Testnet
- sBTC Integration: Connected to official sBTC testnet contracts
# Build for production
npm run build
# Deploy to Vercel (recommended)
vercel deploy
# Or deploy to any Node.js hosting platform
npm start# Stacks network configuration
STACKS_NETWORK=testnet
STACKS_API_URL=https://api.testnet.hiro.so
# Deployment wallet
DEPLOYER_KEY=your-wallet-private-key# Database
MONGODB_URI=mongodb://localhost:27017/bitpay
# NextAuth
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:3000
# Stacks configuration
NEXT_PUBLIC_STACKS_NETWORK=testnet
NEXT_PUBLIC_STACKS_API_URL=https://api.testnet.hiro.so
# Contract addresses
NEXT_PUBLIC_CORE_CONTRACT=ST2F3J1PK46D6XVRBB9SQ66PY89P8G0EBDW5E05M7.bitpay-core
NEXT_PUBLIC_ACCESS_CONTROL_CONTRACT=ST2F3J1PK46D6XVRBB9SQ66PY89P8G0EBDW5E05M7.bitpay-access-control// Frontend: Create a 6-month Bitcoin stream
const streamData = {
recipient: 'SP1234...ABCD',
totalAmount: 1000000, // 0.01 BTC in satoshis
durationBlocks: 26280, // ~6 months
startDelay: 0,
metadata: 'Salary stream for John Doe'
}
await createStream(streamData);; Smart Contract: Stream creation
(contract-call? .bitpay-core create-stream
'SP1234...ABCD ;; recipient
u1000000 ;; 0.01 BTC in satoshis
u26280 ;; ~6 months in blocks
u0 ;; start immediately
u"Salary stream" ;; metadata
)// Frontend: Claim available stream funds
const claimAmount = await claimStream(streamId)
console.log(`Claimed ${claimAmount} satoshis`);; Smart Contract: Claim stream
(contract-call? .bitpay-core claim-stream u1) ;; stream ID 1- Access Control: Role-based permissions with admin oversight
- Emergency Controls: Circuit breakers for critical situations
- Input Validation: Comprehensive parameter checking
- Reentrancy Protection: Proper state management patterns
- Overflow Protection: Safe arithmetic operations
- Wallet Integration: Secure wallet connection via Stacks.js
- Session Management: JWT-based authentication
- Input Sanitization: Protection against injection attacks
- HTTPS Enforcement: Secure communication protocols
- ✅ Smart contracts reviewed for common vulnerabilities
- ✅ Access control mechanisms tested
- ✅ Emergency procedures validated
- 🔄 External audit pending for mainnet deployment
- Smart contract development and testing
- Testnet deployment
- Frontend application with wallet integration
- Basic stream creation and management
- Advanced analytics dashboard
- Bulk stream operations
- Stream templates and presets
- Mobile application
- Multi-signature wallet support
- Advanced treasury management
- API for third-party integrations
- White-label solutions
- Security audit completion
- Mainnet smart contract deployment
- Production infrastructure scaling
- Marketing and user acquisition
We welcome contributions from the community! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
- Smart Contracts: Follow Clarity best practices
- Frontend: Use TypeScript with strict typing
- Testing: Maintain >90% test coverage
- Documentation: Update docs for new features
This project is licensed under the MIT License - see the LICENSE file for details.
- Stacks Foundation for the robust blockchain platform
- sBTC Team for the Bitcoin-pegged token innovation
- Clarity Language for smart contract security and clarity
- Next.js Team for the excellent frontend framework
- Bitcoin Community for the foundational technology
- Documentation: docs.bitpay.stream
- Discord: discord.gg/bitpay
- Twitter: @BitPayStream
- Email: support@bitpay.stream
"The most innovative Bitcoin streaming platform on Stacks blockchain"
Built with ❤️ by the BitPay Team | Powered by Bitcoin & Stacks