Overview
Content Manager
Categories
AdSense
Settings
View site
Edit post
1 min read · published
Live preview
Save post
Title
Slug
/blog/accepting-crypto-payments
Excerpt
Custodial gateway or self-hosted node? Confirmation depths, webhook idempotency and the reconciliation details nobody warns you about.
Content (Markdown)
## Two architectures A custodial gateway hands you a REST API and takes a cut. A self-hosted node hands you full control and full responsibility. Most businesses should start custodial and migrate only when volume justifies the ops burden. ## Webhooks must be idempotent Chains reorg. Gateways retry. Your handler will see the same payment event more than once. ```ts const seen = await db.event.findUnique({ where: { id: event.id } }); if (seen) return new Response("ok"); await db.event.create({ data: { id: event.id } }); await creditOrder(event.orderId, event.amount); ``` ## Confirmation depth Pick a depth per asset and per order value. One confirmation is fine for a $5 digital download; it is reckless for a $5,000 invoice. ## Reconciliation Price at time of quote, price at time of settlement, and network fee all differ. Store all three or your accountant will find you.