All projects
active GoMicroservicesPostgreSQLCrypto

OpenPay

crypto in, Sri Lankan rupees out

The itch

If a Sri Lankan merchant wants to accept crypto and end up with rupees in the bank, there is no rail for that. International processors settle in dollars, and local gateways do not touch crypto at all. OpenPay is my attempt at the missing piece: a customer pays in BTC, ETH, USDT or one of about fifty other coins, and the merchant receives LKR. As a bonus, crypto transactions are irreversible, so chargebacks simply stop being a category of problem.

How it works

Nine Go services sit behind an API gateway: payment, merchant, settlement, webhook, exchange rates, subscriptions, notifications and admin, each with its own PostgreSQL database, all talking over NATS JetStream. The merchant API is signed with HMAC-SHA256. Webhooks are signed with ED25519 instead, so merchants can verify payloads with a public key rather than a shared secret. Every monetary value goes through shopspring/decimal, because floats and money should never meet, and all SQL is generated by sqlc so queries are checked at compile time. A provider layer abstracts Bybit, Binance Pay and KuCoin, which keeps any single exchange from owning the platform.

Status

Twelve of the fifteen build phases are done, including the merchant portal, the admin dashboard and the checkout flow. Smart contracts for on-chain subscriptions, the WooCommerce plugin and a final hardening pass are still ahead. The longer story, including why one person chose to run nine services, is in the case study.