Payments
Shipping a stablecoin payment flow: the parts nobody demos
- Written by
- Maitreya Kulkarni, Co-Founder and CTO
- Published
- Reading time
- 5 min
The demo is always the same. A wallet sends 25 USDC, the merchant's dashboard updates a couple of seconds later, and everyone agrees that stablecoins are the future of payments. They may well be. But the transfer is the smallest part of a payment system, and the parts nobody demos are the ones that decide whether finance, compliance and support can live with it.
This is the checklist we work through when we build a stablecoin flow for checkout, payouts or cross-border settlement. It is written for the engineers who will run it, and for the people who will sign off on it.
1. Decide what "paid" means, per chain
Every chain has its own idea of when a transaction is settled, and "I saw it in a block" is not one of them.
- Solana exposes commitment levels. In the Anza documentation, a block is confirmed once more than two thirds of stake has voted on it, and finalized under TowerBFT once 31 or more confirmed blocks are built on top. Under Alpenglow, confirmed and finalized mean the same thing.
- Ethereum finalizes through checkpoints at epoch boundaries, where an epoch is 32 slots of 12 seconds, as the ethereum.org proof-of-stake page explains. Finality takes minutes, not seconds.
- Ethereum L2s give a fast confirmation from their sequencer, and settle on Ethereum later.
So write the rule down, per chain and per amount. A typical one: credit small payments on confirmation, credit large ones on finality, and never release goods that cannot be recovered before the stricter level. Then make the rule a configuration value, not a constant buried in a handler.
2. Give every payment an identity
A transfer of 25 USDC to your address says nothing about which invoice it pays. If two customers pay the same amount in the same minute, someone in finance will spend an afternoon on it.
Give each payment a unique handle before it is made: a fresh deposit address per invoice, or a reference key or memo that the transaction must carry. Expire the handle when the invoice expires. Decide in advance what happens to underpayments, overpayments and payments that arrive after expiry, because all three will happen in the first week.
3. Credit exactly once
Indexers replay. Webhooks retry. RPC providers occasionally disagree. Your crediting logic will see the same transfer more than once, and on chains that can reorganise before finality it may see a transfer that later disappears.
Key every credit on the chain, the transaction signature or hash and the instruction or log index, and make the write idempotent. Keep a status per payment (seen, confirmed, final, credited, reversed) and only move it forward. When something moves backwards, page a person.
4. Reconcile every day
Once a month is too late. Every day, match every onchain mint, burn and transfer that touches your addresses against your ledger and your payment records. Report the breaks with their age. A break that is a day old is a bug; one that is a month old is an audit finding.
Reconciliation is also where you notice that a hot wallet's balance does not match what the ledger says it should hold. That is the earliest warning you will get of a key problem.
5. Design the refund before the checkout
There are no chargebacks onchain. A refund is a new payment, and it needs the same care as the original: a reference back to the payment it reverses, a destination you have checked (customers change wallets, and exchange deposit addresses are not always safe to send back to), limits, and an approval for anything large.
If you design checkout first and refunds later, refunds become a manual process run from somebody's wallet. That is where errors and fraud live.
6. Screen at the edges, and keep the evidence
Sanctions and risk screening belongs at every edge: when an address is first seen, when a payment arrives, and before a payout leaves. Record every decision with its inputs, so that when someone asks why a payment was held or released, the answer is a record rather than a recollection.
The US now has a federal framework for payment stablecoins, the GENIUS Act, signed into law in July 2025. Issuers carry most of its weight, but businesses that move stablecoins inherit AML, sanctions and record-keeping expectations from their partners and their own status. We cover the engineering side in the GENIUS Act turns stablecoin compliance into an engineering problem. None of this is legal advice; your counsel decides what applies to you.
7. Treat chains and ramps as replaceable
Payment systems outlive the choices made at launch. Keep chain-specific code behind one interface (watch an address, read a transfer, send a payment, report finality) so adding a chain is a module, not a rewrite. Prefer native USDC over bridged copies: Circle's Cross-Chain Transfer Protocol burns on one chain and mints on another rather than wrapping.
The same goes for on and off ramps. One licensed partner going down should slow payouts, not stop them. Route through at least two where the volume justifies it, and make the fallback something you test, not something you hope works.
8. Run the hot wallet as a policy
The wallet that sends payouts is the most attacked part of the system. Keep only a working float in it, swept to colder storage on a schedule. Give it limits per transaction, per hour and per destination, enforced by a smart account or a policy engine rather than by the application that asks it to sign. Use a multisig or MPC setup for anything above the float, and make sure the people who approve large movements can read what they approve, which is the lesson of most of the money lost onchain.
9. Price the whole flow, not the transfer
A stablecoin transfer can cost a fraction of a cent. The flow costs more: ramp fees, screening, gas sponsorship, the float you hold, and the people who handle exceptions. Compare that total with card and wire costs for your actual mix of amounts and countries. For cross-border payouts and high-volume small payments the case is usually strong. For a domestic checkout with card-loving customers, it may not be.
What to measure
- Time to credit, from payment sent to customer credited, by chain and amount band.
- Reconciliation breaks per day, and the age of the oldest.
- Screening coverage, the share of payments screened before settlement.
- Exception rate, the share of payments that needed a person: underpaid, late, wrong reference, refund.
- All-in cost per payment, against your current rails.
Where we start
We usually start with one corridor or one checkout, two chains at most, a written finality rule and a reconciliation job on day one. Machine payments come next: once the flow is solid, an x402 paywall lets APIs and agents pay per request through the same ledger, and our research on settling agent payments against proof covers what to add for them. If you are planning a stablecoin flow, our payments use case and stablecoin payment service set out how we build it.
Read next
Related pages.
Use case: stablecoin and cross-border payments
The GENIUS Act turns stablecoin compliance into an engineering problem
Stablecoin and crypto payments
- Tokenization
Tokenizing real-world assets without a liquidity trap
Many tokenized assets only move through mint and redeem. Seven decisions to make before you choose a chain, so your token can actually trade.5 min read - Engineering
What an audit-ready codebase looks like
An audit buys a fixed amount of expert attention. The checklist we use so reviewers spend it on your logic, not on setup, guesswork and stale code.5 min read
Start a build
Bring us the contract you're not sure about.
What happens next
- 01Tell us what you are buildingA short note or a 30-minute call: the product, the chain if you know it, and where the money sits.
- 02Hear back within 48 hoursEvery message is read by the team, not a filter.
- 03A first working sessionWe walk through the threat model and the admin powers with you, then propose a scope and a plan.