Show HN: ZeroPay – Open-source crypto payment and subscription solutions

4 weeks ago 4

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.

  • 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)
  • Secure: HMAC-based webhook authentication
  • Easy Integration: RESTful API with comprehensive documentation
  • Docker Ready: One-command deployment with Docker

Using Docker (Recommended)

# Pull the latest image docker pull zeropaydev/zeropay:latest # Create configuration cp .env-template .env # Edit .env with your settings # Run the container docker run -d \ --name zeropay \ -p 9000:9000 \ --env-file .env \ -v $(pwd)/config.toml:/app/config.toml \ zeropaydev/zeropay:latest
# Start all services (PostgreSQL, Redis, ZeroPay) docker-compose up -d

See DEPLOYMENT.md for detailed setup instructions.

For a hassle-free experience, use our managed platform at zeropay.dev:

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:

  1. Register your merchant account at zeropay.dev
  2. Use https://api.zeropay.dev as your API endpoint
  3. Start accepting payments immediately

Note: The platform charges a small commission for gas fees and hosting.

┌─────────────┐ │ Client │ │ Application │ └──────┬──────┘ │ REST API ▼ ┌─────────────┐ │ ZeroPay │◄──────┐ │ API │ │ └──────┬──────┘ │ │ │ ├──────────────┤ │ │ ▼ ▼ ┌──────────┐ ┌──────────┐ │PostgreSQL│ │ Redis │ └──────────┘ └──────────┘ │ │ Scanner ▼ ┌─────────────────┐ │ Blockchain │ │ (Ethereum, │ │ Polygon, etc) │ └─────────────────┘
  • Create unique payment addresses for each transaction
  • Support for multiple stablecoins (USDT, USDC, DAI, etc.)
  • Automatic payment detection and confirmation
  • Configurable confirmation blocks for security
  • EVM-Compatible Chains: Ethereum, Polygon, BSC, Arbitrum, Optimism, Avalanche, etc.
  • Extensible: Easy to add new chains via configuration
  • Multi-Token: Support any ERC-20 token
  • session.paid - Customer completed payment
  • session.settled - Funds transferred to merchant
  • unknow.paid - Unlinked payment received
  • unknow.settled - Unlinked payment settled
  • HMAC-SHA256 webhook signatures
  • API key authentication
  • HD wallet derivation for payment addresses
  • Configurable confirmation requirements

Create a .env file from the template:

Key configuration options:

PORT=9000 # API server port DATABASE_URL=postgres://user:pass@localhost/zeropay # PostgreSQL connection REDIS=redis://127.0.0.1:6379 # Redis connection MNEMONICS="your twelve or twenty-four word phrase" # BIP39 seed phrase WALLET=0xa0..00 # Settlement wallet address APIKEY=your-secure-api-key # API authentication key WEBHOOK=https://your-app.com/webhook # Webhook endpoint URL SCANNER_CONFIG=config.toml # Chain config file path

Configure supported blockchains in config.toml:

[[chains]] chain_type = "evm" chain_name = "ethereum" latency = 6 # Confirmation blocks estimation = 72 # Seconds to confirm commission = 5 # 5% commission commission_min = 50 # $0.50 minimum commission_max = 200 # $2.00 maximum admin = "0xYourPrivateKey" # Gas payment account rpc = "https://eth-mainnet.g.alchemy.com/v2/YOUR-KEY" tokens = [ "USDT:0xdAC17F958D2ee523a2206206994597C13D831ec7", "USDC:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ]

See DEPLOYMENT.md for complete configuration details.

curl -X POST "http://localhost:9000/sessions?apikey=your-api-key" \ -H "Content-Type: application/json" \ -d '{ "customer": "user123", "amount": 1000 }'
curl "http://localhost:9000/sessions/12345?apikey=your-api-key"

See API.md for complete API documentation.

  • 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/api
zeropay/ ├── api/ # REST API server ├── scanner/ # Blockchain scanner ├── config.toml # Chain configuration ├── Dockerfile # Container build file └── .env-template # Environment template

We welcome contributions!

Reporting Vulnerabilities

If you discover a security vulnerability, please email [email protected] instead of using the issue tracker.

  • Never commit .env files 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.

Read Entire Article