Tenback
Deterministic micro-lottery: every 10th player wins the pot. Powered by x402 micropayments on Base.
Problem Statement
💿 TENBACK.EXE - A Micropayment Experiment 💿There's something magical about systems that just work, where the rules are clear, the outcomes are certain, and everything happens exactly as promised.Tenback is that kind of program.You send 1 USDC through x402. A global counter increments, by Cloudflare Durable Objects running somewhere in the cloud. When that counter hits 10, the lucky player receives the entire accumulated pot as USDC on Base. Then the counter resets to zero and the cycle begins again. No randomness. No gambling. The tenth caller always wins: it's deterministic, provable, fair. It's built on modern infrastructure but designed with the spirit of early computing: elegant simplicity, transparent rules, and that satisfying feeling when distributed systems synchronize perfectly.A hackathon project for DevConnect Buenos Aires.Powered by x402 protocol. ✨🖥️💜
Solution
Traditional lotteries require trust and rely on opaque randomness. Tenback eliminates both by being fully deterministic: every 10th player wins the pot, period.Players send 1 USDC micropayments using the x402 protocol, which increments a global Cloudflare Durable Object counter. The Durable Object's single-threaded execution model ensures strict FIFO ordering with zero race conditions: no front-running, no sniping.x402's cryptographic authorization prevents replay attacks and double-counting. When the counter hits 10, the winner receives the entire pot instantly on Base. It's not gambling. It's pure math and timing.THE INTEGRATION CHALLENGES & FEEDBACK:Challenge #1: Cloudflare Workers Compatibility Coinbase's SDK uses Node.js Buffer extensively. Cloudflare Workers don't support Buffer natively. Solution: enabled nodejs_compat flag in wrangler.toml.Feedback for CDP: Consider publishing a Workers-compatible build or documenting the nodejs_compat requirement for edge deployment.Challenge #2: CDP Facilitator Reliability on Base Mainnet During development, CDP's facilitator endpoint returned frequent 500 errors. To stay on schedule, we implemented direct onchain settlement as fallback using our own x402 infrastructure.Feedback for CDP: Facilitator uptime is critical for production apps. Consider:Status page for facilitator endpointsClear error messages (vs generic 500s)Fallback guidance in documentationDespite these challenges, x402 protocol integration was straightforward, and Base Smart Wallets worked perfectly with the payment flow.
Hackathon
ETHGlobal Buenos Aires
2025
Contributors
- ukstv
3 contributions