free · 0% fees · 60sclaim your page
merchant guides/ 9 min read

crypto payment gateway architecture

the components behind a production crypto checkout — order engine, address handling, chain watchers, confirmation logic and signed webhooks.

Crypto Payment Gateway Architecture
share whatsapp post

A crypto payment gateway is simpler than it looks and harder than it sounds: at its core it turns "charge $49" into "watch address X for exactly 0.00051 BTC and tell the store when it arrives." This guide walks through the reference architecture of a non-custodial gateway — the same shape crypt.pe runs in production — so developers can evaluate gateways honestly or reason about building one.

the five components every gateway needs

Strip away branding and every crypto gateway is five subsystems working in a loop:

componentjobfailure mode if done badly
order enginelocks amount, asset, network and price at creationstale quotes, disputed totals
address layerassigns the receiving address (merchant-owned in non-custodial designs)wrong-network payments, address reuse
chain watchersone monitor per network, polling nodes/RPCs for matching transfersmissed or double-counted payments
confirmation logicwaits for depth proportional to amount before marking paidreorg-faked settlements
webhook dispatchersigns and delivers payment events to the merchant backendspoofable or silently dropped events

In a custodial gateway the address layer points at the processor's own hot wallets and a payout system is bolted on. In a non-custodial gateway like crypt.pe, the address layer points at wallets the merchant configured — settlement and custody collapse into the same step, which is why there is no payout schedule to build or trust.

the life of one order

A production flow looks like this: 1) the store POSTs an order with a fiat amount and gets back an order id plus a hosted checkout URL; 2) the gateway locks the crypto amount from a fresh rate quote and shows the payer one address with its network labelled; 3) chain watchers poll for a transfer matching the exact amount, correct asset and correct address, postdating the order; 4) small amounts confirm on first inclusion, larger ones wait for confirmation depth; 5) a signed webhook fires and the store fulfils. Every step is stateless enough to retry, and one on-chain transaction can only ever satisfy one order — the property that stops replay tricks.

Exact-amount matching is the subtle part. Two simultaneous invoices for the same merchant must never resolve to the same expected amount on the same address — gateways solve this with unique addresses per order, tiny amount offsets, or both.

webhooks: sign them or they're decoration

A webhook that isn't verifiable is a security hole: anyone who learns the endpoint can mark orders paid. The standard design — which crypt.pe implements — is an HMAC SHA-256 signature over a timestamp plus the raw body, delivered in a header (crypt.pe uses X-Cryptpe-Signature with t=<unix-ts>,v1=<hex>). The merchant recomputes the HMAC with their webhook secret, compares in constant time, and rejects stale timestamps to kill replays. Idempotency keys on the merchant side handle redelivery.

what you'd have to run yourself

Self-hosting this stack (the BTCPay Server route) means operating nodes or paid RPC endpoints per chain, keeping watchers alive 24/7, handling chain reorgs, rotating addresses, and monitoring it all. That's the honest cost behind "free and open source". A hosted non-custodial gateway keeps the same trust model — funds still settle only to your wallets — while someone else runs the watchers. Evaluate any gateway by asking: who holds keys, how are exact amounts matched, how are webhooks signed, and what happens during a reorg.

frequently asked

What is the architecture of a crypto payment gateway?

Five subsystems: an order engine that locks amount and asset at creation, an address layer that assigns the receiving address, per-network chain watchers, confirmation-depth logic, and a signed webhook dispatcher. In a non-custodial design the addresses belong to the merchant, so settlement and custody are the same step.

How does a gateway know an invoice was paid?

Chain watchers poll each network for a transfer matching the exact expected amount, the correct asset and the locked address, postdating the order. Larger amounts additionally wait for confirmation depth so a chain reorg can't fake a settlement, and one transaction can only ever satisfy one order.

How should crypto payment webhooks be secured?

With an HMAC SHA-256 signature over a timestamp and the raw request body, verified against the merchant's webhook secret in constant time, plus timestamp freshness checks against replays. crypt.pe delivers this as X-Cryptpe-Signature: t=<timestamp>,v1=<hex>.

Should I build a gateway or use one?

Building means running per-chain nodes or RPCs, 24/7 watchers, reorg handling and address management. Self-host with BTCPay Server if you want full control and accept the ops cost; use a hosted non-custodial gateway like crypt.pe if you want the same custody model — funds settle only to your wallets — without operating the infrastructure.

the product this guide supports
crypto payment gateway →
0% transaction fee · non-custodial
ready to accept crypto?
free page, 0% fees, live in 60 seconds — non-custodial by design.
create your free page
new guides by email
one email when a new merchant guide ships.
no drip sequences, no promos — unsubscribe anytime.

about crypt.pe

01

non-custodial by design

Payments settle wallet-to-wallet on-chain, straight from the payer to your own wallet. crypt.pe never holds, freezes or forwards funds — there is no platform balance and no withdrawal step, and every payment gets a verifiable on-chain receipt.

02

0% transaction fees

Plans are flat subscriptions with a free tier — compare that with the 1–2% charged by custodial processors. One page accepts Bitcoin, USDT, Ethereum, Solana and 24 coins across 13 chains, with simple pricing and no payout schedule.

03

tools merchants actually use

Exact-amount invoices with live tracking, product links, printable QR standees, HMAC-signed webhooks, CSV exports and a Stripe-style API — see the merchant guides or create your free page in about a minute.

04

how a payment works

You add wallet addresses you already own, share your crypt.pe link or QR code, and the customer pays from their own wallet. crypt.pe locks the amount at invoice time, watches the chain, matches the transaction and issues a receipt both sides can verify on a block explorer — software around the payment, never in the money flow.

05

available wherever wallet-to-wallet payments are permitted

Because settlement is on-chain to your own wallet, there is no bank partnership gating access and no account that can be closed over geography — local crypto rules still apply. Merchants use crypt.pe across India, the UAE, Nigeria, the Philippines, Brazil and 100+ other markets — see the country guides.

06

stablecoin-first, volatility optional

Accept USDT or USDC and a $100 invoice is still worth $100 when it is paid — no price risk in between. Prefer BTC, ETH or SOL? Amounts are locked at invoice time either way, and your dashboard records the USD value of every payment for clean bookkeeping. Questions? Start with the FAQ or payment help.