--- # **RecurChain – Project Documentation** *Autonomous Recurring Payments Powered by USDC on Base* --- ## **Overview** **RecurChain** is an autonomous payments system that allows users to automate recurring realworld payments like rent, school fees, utilities, subscriptions, and donations in **USDC (USD Coin)** on the **Base** blockchain. Users deposit USDC into their smart account, set up a payment schedule, and RecurChain’s agent handles the payment each cycle without manual intervention. RecurChain generates revenue by charging a **small transaction fee per automated payment**, offering paid subscription tiers (e.g., unlimited payments for Pro or Business users), and taking a **small margin when converting USDC to local currencies (e.g., Naira)** via on‑ramp/off‑ramp partners. Even if the final recipient only accepts **Naira (₦)**, RecurChain integrates with trusted payout partners (“exchangers”) who convert USDC to Naira and send the funds via bank transfer — ensuring payments go through correctly while maintaining an onchain record of every transaction. --- ## **Why USDC? (And Not USDT or Others)** | Feature | USDC | USDT | | --------------------------------------- | ----- | ---------------------- | | **Highly regulated** | ✅ Yes | ❌ Less transparent | | **1:1 redeemable for 1 U.S. Dollar** | ✅ Yes | ⚠️ Sometimes uncertain | | **High institutional trust** | Yes | Medium | | **Native to Base / Coinbase ecosystem** | Yes | No | | **Audit-friendly / transparent** | Yes | No | **Why RecurChain uses USDC:** USDC offers stability, regulatory trust, and onchain transparency. Base is closely aligned with Coinbase, making USDC a native, well-supported stablecoin. This choice minimizes user risk and supports reliable recurring payments. --- ## **Vision** To be the leading decentralized agent-based platform for automating recurring payments, using stablecoins to bring real-world financial activities onchain, with transparency and ease. --- ## **Mission** * Automate real-world recurring financial commitments * Provide fully autonomous, trustless payment execution * Offer transparent and auditable payment logs * Serve users globally, including those who receive only local fiat * Build consistent, high-utility transactions on Base --- ## **Key Objectives** * Deliver **zero-touch payment automation** * Maintain **full onchain proof** for every payment * Support **fiat payouts** for local-currency-only recipients * Simplify the user experience with Privy onboarding * Drive stable USDC volume and network usage on Base --- ## **Core Features** ### **1. Privy Login (Walletless Onboarding)** **Privy** = Web3 auth + embedded wallet * Users sign up with Google, GitHub, or Email * Privy automatically creates a smart account (wallet) for them * No need for users to manage private keys or sign transactions --- ### **2. Smart Account (AA – Account Abstraction)** **AA** = Account Abstraction * Abstracts wallet logic into a contract * Users don’t approve every transaction manually * Allows session keys and gas sponsorship * Enables agents to act autonomously & securely --- ### **3. USDC Deposit Layer** * Users can deposit USDC from their external wallet (e.g., MetaMask, Coinbase Wallet) * Or via on‑ramp services that support USDC * Funds go into their smart account for recurring payments --- ### **4. Recurring Payment Agent** * Agent monitors scheduled payments * On payment date: agent triggers USDC transfer * Agent sends notification (email / app) * Agent logs transaction onchain --- ### **5. Local Currency (₦) Payout Layer** * If recipient only accepts Naira: 1. Agent sends USDC to a trusted on/off‑ramp partner 2. Partner converts USDC → Naira 3. Partner transfers Naira via bank (NIP or local payment) * A receipt is generated showing both onchain payment + payout --- ### **6. Transaction History & Receipts** * **Onchain receipt:** TX hash, amount, timestamp * **Offchain proof:** Bank details, Naira amount, exchange rate * **Shareable receipt:** PDF or viewable link for school, landlord, or employer * **Audit log:** Complete record for users or admin --- ### **7. Dashboard / User Interface** * Add, edit, or delete recurring payments * Pause or resume automation * Change amount, schedule, or recipient * View payment history and upcoming payments * Download receipts --- ## **User Workflow** 1. **Sign Up (Privy)** * User signs up using Email / Google / GitHub * Privy creates a smart account (AA) behind the scenes 2. **Profile Setup** * Fill out user info and preferred bank (for Naira payouts) 3. **Deposit USDC** * Send USDC from external wallet or buy via on‑ramp * Balance shows up in smart account 4. **Configure Recurring Payment** * Choose bill type (Rent, School, etc.) * Enter amount, frequency, recipient crypto address or bank account * Optionally set a monthly cap or first payment date 5. **Agent Activation** * Agent is deployed with session keys * Runs autonomously per schedule 6. **Payment Execution** * Agent checks balance * Sends USDC onchain if crypto address * If bank: sends to exchanger, payouts in Naira, logs proof 7. **Receipt & History** * Onchain transaction logged * Offchain proof for Naira payments * Shareable receipt link / PDF 8. **Monitoring & Management** * User views payment history and upcoming bills * User can pause or modify agent --- ## **Technology Stack** **Frontend** * Next.js * React * TypeScript * Tailwind CSS * Framer Motion **Backend** * Node.js * Express.js * REST API * Worker / Scheduler (BullMQ or cron) **Blockchain** * Base Network (Layer 2) * USDC (stablecoin) * Smart Accounts via Account Abstraction (ERC‑4337 or equivalent) * Session Keys & Gas Sponsor (Paymaster) **Authentication** * Privy (Email / Google / GH login + embedded wallet) **Cash‑Out / Payout Partners** * On/off‑ramp providers with API (for USDC ↔ Naira) * Bank transfers via NIP (Nigeria InterBank Payment) or similar systems --- ## **Edge Cases & Solutions** | Edge Case | Problem | Solution | | -------------------------------- | -------------------------------- | ---------------------------------------------------------------- | | **Low USDC balance** | Agent can’t complete a payment | Pause agent, notify user, option to auto-top-up if enabled | | **Recipient requires Naira** | Vendor doesn’t accept crypto | Use verified converter to payout in Naira | | **High FX volatility** | Conversion rate risk | Capture rate at time of payment; allow user set tolerance | | **Incorrect bank details** | Payout fails or sent incorrectly | Validate and verify account before first run | | **Failed payout** | Exchanger or bank fails | Retry logic with fallback provider; notify user | | **Gas surge / network issues** | Onchain send fails | Use paymaster or multi-relayer strategy | | **Schedule mismatch / timezone** | Payment fires at wrong time | Respect user timezone in scheduling; show local dates | | **Duplicate or double payments** | Same job runs twice | Idempotency keys; smart contract checks to prevent double-spend | | **Fraudulent setup** | Unauthorized bills | KYC or verification for payees; secure onboarding flow via Privy | --- ## **Revenue Model** * **Per Payment Transaction Fee:** A small USDC fee every time the agent pays something * **Subscription Tiers** * **Basic**: Limited number of recurring payments * **Pro**: Unlimited payments + priority support * **Enterprise**: For large payers — schools, landlords, cooperatives * **Cash-Out Commission:** Small margin when converting USDC → Naira during payouts * **Partner Integrations:** Provide APIs for institutions (schools, churches) for recurring billing --- ## **Future Enhancements** * AI-powered “Spending Advisor” that suggests optimal payment splits * Auto top-up: When balance is low, agent triggers a buy from on‑ramp * Multi-currency support (other stablecoins or fiat) * International payout support (Naira, Cedi, etc.) * Salary distribution or payroll agent for SMB * Business invoicing and automated payment reminders --- ## **Security & Compliance** * **Privy Authentication:** Walletless login, embedded smart wallets * **Session Keys:** Limited permissions for recurring agents * **Gas Sponsorship:** Use paymaster to sponsor gas securely * **Secrets Management:** Use vault or environment secrets; no private key leaks * **Audit Logs:** Every transaction, conversion, and agent action is recorded * **KYC/AML**: Use for payout partners to comply with local regulations * **Encryption:** Personal data encrypted at rest and in transit --- ## **License** Licensed under **MIT**. Open for modification and reuse with attribution. --- ## **Competitors** Here are a few competitors / related services in the recurring payments + stablecoin + blockchain space: * **Cybrid** — Infrastructure for stablecoin payments and automated financial operations * **Skyfire** — AI-driven payment and agent automation platform * **Stripe (Crypto Subscriptions)** — Stripe supports stablecoin subscriptions and payments * **Reap** — Fintech for businesses, offering stablecoin tools among its product suite --- ## **Contact** **Project Lead:** Clement Raymond 📧 [chinexzy37@gmail.com](mailto:chinexzy37@gmail.com) 🐦 Twitter: @phantomofcode ---