Selling digital files for USDC with one Cloudflare Worker (no Stripe, no database)
I wanted to sell two small PDFs for crypto without a payment processor, a database, or a wallet connection on the server. The result is one Cloudflare Worker (free plan) that only receives USDC on Base to a public address. Here is how it works, including the parts that are weak. Live example: Setrov Store . The core problem: which payment belongs to which order? A plain transfer to an address…
A Cloudflare Worker can be used to sell small PDF files for USDC without the need for a payment processor, database, or wallet connection on the server. The system receives USDC on Base to a public address and uses a unique tag in the order amount to differentiate between transactions. The Worker signs orders with HMAC-SHA256 using a secret key, which is rotated to invalidate open orders.
The buyer provides the transaction hash, and the Worker verifies the transaction on the Base network before generating a signed download link that expires in 2 hours. This system is suitable for small digital goods, a crypto-native audience, and situations where running a database is undesirable. However, it may not be ideal for larger transactions, refunds, or files exceeding a few MB, where a real payment stack is recommended.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.