Bolt Payment Gateway is a comprehensive payment solution built on Bitcoin L2 (Stacks) powered by the Bolt Protocol. It enables instant-confirmed sBTC payments with fees paid in sBTC (no STX). Issue invoices and payment links/QRs with real-time quotes and optional USD-locked settlement at pay time. Ships with an OpenAPI and a lightweight dashboard to create and track charges, integrating with Stacks-compatible wallets.
- 🚀 Try it now on Testnet: https://test.boltproto.org/tools/payment-gateway/
- 📹 Video Demo: Watch the solution in action
- Instant sBTC Payments: Lightning-fast transactions powered by Bolt Protocol
- Multi-Asset Support: Accept payments in sBTC and USDT
- USD Settlement: Lock in USD prices at invoice creation time
- Real-time Quotes: Dynamic BTC/USD pricing with configurable spreads
- Web Dashboard: User-friendly interface for invoice management
- Wallet Integration: Compatible with Stacks ecosystem wallets
- MongoDB Storage: Reliable data persistence
This repository contains two main components:
- Language: Rust
- Framework: Axum web framework
- Database: MongoDB
- Features: RESTful API, real-time quotes, payment processing
- Language: TypeScript
- Framework: Angular 20
- Features: Invoice management, payment tracking, merchant dashboard
Complete API documentation is available at: Postman Documentation
https://test.boltproto.org/apipaymentgateway/v1
| Method | Endpoint | Description |
|---|---|---|
POST |
/merchants/{wallet_address}/invoices |
Create a new invoice |
GET |
/merchants/{wallet_address}/invoices |
List merchant invoices |
GET |
/invoices/{invoice_id} |
Retrieve specific invoice |
POST |
/invoices/{invoice_id}/payments/submit |
Submit payment |
GET |
/quotes |
Get BTC/USD conversion quote |
- Rust (latest stable version)
- Node.js (v18+ for frontend)
- Docker (optional, for containerization)
- MongoDB (for data persistence)
-
Clone the repository:
git clone <repository-url> cd bolt-payment-gateway/bolt-payment-gateway-server
-
Set environment variables:
export MONGODB_URI="mongodb://localhost:27017" export DATABASE_NAME="bolt_payment_gateway"
-
Build and run:
cargo build cargo run
The server will start on http://localhost:3000
-
Navigate to frontend directory:
cd bolt-payment-gateway-ux -
Install dependencies:
npm install
-
Start development server:
npm start
The dashboard will be available at http://localhost:4200
| Variable | Description | Default |
|---|---|---|
MONGODB_URI |
MongoDB connection string | mongodb://localhost:27017 |
DATABASE_NAME |
Database name | bolt_payment_gateway |
PORT |
Server port | 3000 |
LOG_LEVEL |
Logging level | info |
- Payment Assets:
sBTC,USDT - Settlement Assets:
USD,BRL
- Create invoices with USD/BRL settlement
- Automatic expiration (2 minutes default)
- Status tracking:
created,paid,expired,settled - Merchant order ID for reconciliation
- Multi-asset payment support
- Real-time payment validation
- Automatic underpayment detection
- Transaction broadcasting
- Real-time BTC/USD pricing
- Configurable spread (1% default)
- Satoshi-precision calculations
- Price refresh timestamps
# Backend tests
cd bolt-payment-gateway-server
cargo test
# Frontend tests
cd bolt-payment-gateway-ux
npm test# Rust formatting and linting
cargo fmt
cargo clippy
# Angular linting
cd bolt-payment-gateway-ux
ng lintThis project is licensed under the MIT License - see the LICENSE file for details.
- 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
For questions and support:
- API Documentation: Postman Collection
- Issues: GitHub Issues
- Community: Stacks Discord