Introduction
Welcome to the **ChainPay** developer documentation. ChainPay is an advanced, developer-first cryptocurrency payment gateway and state processing engine. It allows merchants to receive non-custodial crypto payments directly into their own wallets, monitor transactions in real time, and trigger durable automated workflows upon confirmation.
Core Architecture
ChainPay is designed around three decoupled, high-performance systems:
- Express REST API: The core server coordinating payment request creation, state querying, rate computations, and webhook registrations.
- Blockchain Watcher: A lightweight background service that scans target EVM blockchains (such as Base, Ethereum, and local testnets) for incoming transactions matching active payment IDs, posting events upon detection.
- Durable State Machine Workflows (Inngest): A resilient event-driven execution coordinator that orchestrates payment lifecycles, waits for confirmations, logs telemetry, and executes merchant webhook deliveries with exponential backoffs.
Key Features
- Cyberpunk Merchant Dashboard: Real-time confirmation progress visualizer with block telemetry logs.
- Embeddable Checkout Widget: Light overlay iframe loader supporting standard JS, React hooks, and mobile React Native client views.
- Signed Webhook Notifications: Webhooks signed with cryptographic HMAC-SHA256 headers to verify payload authenticity.
- Self-Hosted Infrastructure: Zero cloud dependencies, fully containerized under Docker Compose and Caddy.
💡 Developer-First Philosophy
ChainPay operates entirely non-custodially. Funds transfer directly from the customer's wallet to the merchant's wallet on-chain. ChainPay never holds, manages, or intercepts your assets.