Skip to content
All work

01 · Payments, fintech

CashTap: Crypto payment infrastructure on USDC, Base and Lightning

Client
Payments product
Industry
Payments, fintech
When
2024, ongoing
My part
Architecture and most of the build
Status
In production

Overview

CashTap is a crypto payment product built around USDC on Base and the Lightning Network. The goal is simple to state and hard to deliver: let a business issue an invoice or a payment link and get paid in stablecoins by anyone, whether they hold crypto on another chain, hold Bitcoin on Lightning, or only have a bank card.

This is the product I have gone deepest on. I designed most of the architecture and wrote most of the implementation across the wallet layer, the payment rails, and the web application.

What I built

  • 01Dedicated wallet per invoice on Base, created through Crossmint, with a wallet pool so addresses are ready before a customer asks for one.
  • 02USDC settlement on Base with gasless transactions through an Alchemy relayer, so payers never need ETH for gas.
  • 03Fiat on-ramp and off-ramp integrations: Bridge for USDC to bank wires, Coinbase Onramp and Offramp, Stripe for cards, Transak for payment links.
  • 04KYC and virtual bank account flows, so the product can hold and move fiat under a compliant setup.
  • 05Lightning Network to USDC on Base swap flows, including a working evaluation of the Boltz Exchange SDK and a Layerswap integration for Lightning.
  • 06A Lightning QR payment flow, and documentation of the ChangeNOW swaps API for programmatic use.
  • 07SuccusPay, a multi-vendor portal built on the same rails. Designed a WhatsApp-based payment approval flow.
  • 08Evaluation of the x402 payment protocol for machine-to-machine payments.

Architecture notes

Next.js front end and Node.js services. Provider integrations sit behind a thin adapter layer so a new on-ramp or swap provider is one module, not a rewrite.

Payments are modeled as a state machine. Every provider webhook is idempotent and only advances state; nothing is trusted from the client. Reconciliation runs against on-chain balances, not provider dashboards.

Wallet creation is decoupled from checkout: a pool keeps pre-created Crossmint wallets warm and assigns one per invoice, which removes the slowest step from the payer path.

What was hard

Problem

One address per invoice without making the payer wait or pay gas.

Approach

A wallet pool pre-creates addresses on Base, and an Alchemy relayer sponsors gas for sweeps and transfers. The payer sees an address instantly and only ever sends USDC.

Problem

Every on-ramp and swap provider reports status differently, and some report the same event twice.

Approach

A single payment state machine, idempotent webhook handlers keyed on provider event IDs, and reconciliation against chain state so a duplicate or missing webhook cannot corrupt an invoice.

Problem

Bridging Lightning (Bitcoin) into USDC on an EVM chain in one payer flow.

Approach

Compared Boltz submarine swaps and Layerswap end to end, documented limits and failure modes, and built the flow so the payer holds a Lightning invoice and the merchant receives USDC on Base.

Outcome

CashTap runs as a production payment product with fiat and crypto rails, and the same rails now power SuccusPay for multi-vendor use.