An open-source, self-hosted payment gateway for stablecoins and cryptocurrency payments.
Features • Quick Start • Documentation • Platform • Contributing
ZeroPay is a lightweight, self-hosted payment gateway that enables merchants to accept stablecoin and cryptocurrency payments with minimal setup. Built with Rust for performance and reliability, it supports multiple EVM-compatible blockchains and provides real-time webhook notifications for payment events.
New in v1.x: ZeroPay now supports the x402 Agent-to-Agent (A2A) payment protocol, enabling AI agents and autonomous systems to programmatically discover, authorize, and settle payments using EIP-3009 gasless transfers.
- Self-Hosted: Full control over your payment infrastructure
- Multi-Chain Support: Compatible with Ethereum, Polygon, BSC, and other EVM chains
- Stablecoin Focused: Built for USDT, USDC, and other stablecoins
- Real-Time Notifications: Webhook integration for payment events
- Automatic Settlement: Funds automatically transferred to your wallet (minus commission)
- x402 Protocol Support: Agent-to-Agent (A2A) payment protocol for AI-powered integrations
- Secure: HMAC-based webhook authentication and EIP-712 signatures
- Easy Integration: RESTful API with comprehensive documentation
- Docker Ready: One-command deployment with Docker
The easiest way to run ZeroPay with all dependencies:
-
Configure your settings:
Edit
docker-compose.ymlenvironment variables:environment: - MNEMONICS=your twelve or twenty four word mnemonic phrase - WALLET=0xYourWalletAddress - APIKEY=your-secure-api-key - WEBHOOK=https://your-webhook-url.com
-
Configure blockchain:
Edit
config.tomlwith your chain settings (RPC URL, tokens, etc.) -
Start all services:
docker-compose up -d
-
Check logs:
docker-compose logs -f zeropay
See DEPLOYMENT.md for detailed setup instructions.
- Deployment Guide - Complete setup instructions for Docker and source builds
- API Reference - REST API endpoints, webhook events, and usage examples
- x402 Protocol Integration - Agent-to-Agent (A2A) payment protocol integration guide
- AI Integration Guide - Prompt and guide for AI agents to integrate with ZeroPay API
- Configuration Guide - Environment and chain configuration
For a hassle-free experience, use our managed platform at zpaynow.com:
Benefits:
- No infrastructure management required
- Automatic updates and security patches
- Public payment UI for customers
- Multiple chain support out of the box
- Enterprise-grade reliability
Setup:
- Register your merchant account at zpaynow.com
- Use
https://api.zpaynow.comas your API endpoint - Start accepting payments immediately
Note: The platform charges a small commission for gas fees and hosting.
┌─────────────┐ ┌─────────────┐
│ Client │ │ AI Agent │
│ Application │ │ (x402) │
└──────┬──────┘ └──────┬──────┘
│ REST API │ x402 Protocol
│ │ (EIP-3009)
▼ ▼
┌──────────────────────────────────┐
│ ZeroPay API │
│ /sessions /x402/* │◄──────┐
└──────┬───────────────────────────┘ │
│ │
├───────────────────────────────────┤
│ │
▼ ▼
┌──────────┐ ┌──────────┐
│PostgreSQL│ │ Redis │
└──────────┘ └──────────┘
│
│ Scanner + x402 Facilitator
▼
┌─────────────────────────────────────┐
│ Blockchain │
│ (Ethereum, Polygon, Base, etc) │
│ EIP-3009 transferWithAuthorization │
└─────────────────────────────────────┘
- Rust 1.75 or higher
- PostgreSQL 12+
- Redis 6+
# Clone the repository
git clone https://github.com/ZeroPayDev/zeropay.git
cd zeropay
# Build
cargo build --release
# Run
./target/release/apizeropay/
├── api/ # REST API server
├── scanner/ # Blockchain scanner
├── config.toml # Chain configuration
├── Dockerfile # Container build file
└── .env-template # Environment template
We welcome contributions!
If you discover a security vulnerability, please email hi@zpaynow.com instead of using the issue tracker.
- Never commit
.envfiles or private keys - Use strong, randomly generated API keys
- Verify webhook HMAC signatures
- Keep dependencies updated
- Use secure RPC endpoints
- Enable firewall rules
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.